Created
November 12, 2011 19:53
-
-
Save libryder/1361017 to your computer and use it in GitHub Desktop.
Migration example to rename column
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# It's recommended to change the class and filename to be a little more descriptive for your environment | |
class RenameTableColumn < ActiveRecord::Migration | |
def up | |
rename_column :table_name, :producthistory_id, :product_history_id | |
end | |
def down | |
rename_column :table_name, :product_history_id, :producthistory_id | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment