Permalink
Browse files

Add migration to absolutely ensure that everyone is up to date with t…

…he new column name for user plugins
  • Loading branch information...
1 parent 103be21 commit 497ac42952775a9ee1b50bfc334af72366a10167 @parndt parndt committed Jul 8, 2010
Showing with 10 additions and 0 deletions.
  1. +9 −0 db/migrate/20100708014636_ensure_user_plugins_use_name_and_not_title.rb
  2. +1 −0 refinerycms.gemspec
@@ -0,0 +1,9 @@
+class EnsureUserPluginsUseNameAndNotTitle < ActiveRecord::Migration
+ def self.up
+ rename_column :user_plugins, :title, :name if UserPlugin.table_exists? and UserPlugin.column_names.include?('title') and !UserPlugin.column_names.include?('name')
+ end
+
+ def self.down
+ # We don't need to go backwards, there already is one that should handle that..
+ end
+end
View
@@ -81,6 +81,7 @@ Gem::Specification.new do |s|
'db/migrate/20100629081543_add_callback_proc_as_string_to_refinery_settings.rb',
'db/migrate/20100701053151_remove_superuser_from_users.rb',
'db/migrate/20100702022630_add_spam_to_inquiries.rb',
+ 'db/migrate/20100708014636_ensure_user_plugins_use_name_and_not_title.rb',
'db/schema.rb',
'db/seeds',
'db/seeds/inquiry_settings.rb',

0 comments on commit 497ac42

Please sign in to comment.