Skip to content

Commit

Permalink
Added proper calls to reset_column_information in the migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
rocksolidwebdesign committed Apr 5, 2011
1 parent e9d9002 commit c2957c5
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 0 deletions.
@@ -1,6 +1,8 @@
class AddValueTypeToRefinerySettings < ActiveRecord::Migration
def self.up
add_column ::RefinerySetting.table_name, :form_value_type, :string

::RefinerySetting.reset_column_information
end

def self.down
Expand Down
2 changes: 2 additions & 0 deletions db/migrate/20101206013505_change_to_devise_users_table.rb
Expand Up @@ -10,6 +10,8 @@ def self.up

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

::User.reset_column_information
end

def self.down
Expand Down
2 changes: 2 additions & 0 deletions db/migrate/20101216194133_remove_cached_slug_from_pages.rb
Expand Up @@ -3,6 +3,8 @@ def self.up
if ::Page.column_names.map(&:to_s).include?('cached_slug')
remove_column ::Page.table_name, :cached_slug
end

::Page.reset_column_information
end

def self.down
Expand Down
2 changes: 2 additions & 0 deletions db/migrate/20101217113424_add_locale_to_slugs.rb
Expand Up @@ -3,6 +3,8 @@ def self.up
add_column :slugs, :locale, :string, :limit => 5

add_index :slugs, :locale

::Slug.reset_column_information
end

def self.down
Expand Down
2 changes: 2 additions & 0 deletions db/migrate/20110106184757_add_remember_created_at_to_users.rb
@@ -1,6 +1,8 @@
class AddRememberCreatedAtToUsers < ActiveRecord::Migration
def self.up
add_column :users, :remember_created_at, :datetime

::User.reset_column_information
end

def self.down
Expand Down
2 changes: 2 additions & 0 deletions db/migrate/20110307025652_translate_custom_title_on_pages.rb
Expand Up @@ -9,6 +9,8 @@ def self.up
end

end

::Page.reset_column_information
end

def self.down
Expand Down
Expand Up @@ -3,6 +3,8 @@ def self.up
::Page.translated_attribute_names.map(&:to_sym).each do |column_name|
remove_column ::Page.table_name, column_name if ::Page.column_names.map(&:to_sym).include?(column_name)
end

::Page.reset_column_information
end

def self.down
Expand Down
2 changes: 2 additions & 0 deletions db/migrate/20110325213325_remove_password_salt_from_users.rb
Expand Up @@ -5,6 +5,8 @@ def self.up
User.all.each do |u|
u.update_attribute(:encrypted_password, u.encrypted_password[29..-1])
end

::User.reset_column_information
end

def self.down
Expand Down

0 comments on commit c2957c5

Please sign in to comment.