Skip to content

Commit

Permalink
Added reset_column_information calls to appropriate self.down methods…
Browse files Browse the repository at this point in the history
… in the migrations, small namespace fix for a missing :: prefix
  • Loading branch information
rocksolidwebdesign committed Apr 5, 2011
1 parent c2957c5 commit 598f85c
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ def self.up

def self.down
remove_column ::RefinerySetting.table_name, :form_value_type

::RefinerySetting.reset_column_information
end
end
2 changes: 2 additions & 0 deletions db/migrate/20101206013505_change_to_devise_users_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ def self.down

rename_column ::User.table_name, :encrypted_password, :crypted_password
rename_column ::User.table_name, :username, :login

::User.reset_column_information
end
end
2 changes: 2 additions & 0 deletions db/migrate/20101217113424_add_locale_to_slugs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ def self.down
remove_column :slugs, :locale

remove_index :slugs, :locale

::Slug.reset_column_information
end
end
2 changes: 2 additions & 0 deletions db/migrate/20110106184757_add_remember_created_at_to_users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ def self.up

def self.down
remove_column :users, :remember_created_at

::User.reset_column_information
end
end
4 changes: 3 additions & 1 deletion db/migrate/20110307025652_translate_custom_title_on_pages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def self.up

end

::Page.reset_column_information
::Page::Translation.reset_column_information
end

def self.down
Expand All @@ -24,5 +24,7 @@ def self.down
end

remove_column ::Page::Translation.table_name, :custom_title

::Page::Translation.reset_column_information
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ def self.down
::Page.translated_attribute_names.map(&:to_sym).each do |column_name|
add_column ::Page.table_name, column_name, Page::Translation.columns.detect{|c| c.name.to_sym == column_name}.type
end

::Page.reset_column_information
end
end
4 changes: 3 additions & 1 deletion db/migrate/20110325213325_remove_password_salt_from_users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class RemovePasswordSaltFromUsers < ActiveRecord::Migration
def self.up
remove_column :users, :password_salt
# Make the current password invalid :(
User.all.each do |u|
::User.all.each do |u|
u.update_attribute(:encrypted_password, u.encrypted_password[29..-1])
end

Expand All @@ -11,5 +11,7 @@ def self.up

def self.down
add_column :users, :password_salt, :string

::User.reset_column_information
end
end

0 comments on commit 598f85c

Please sign in to comment.