Created
December 8, 2016 01:40
-
-
Save miligraf/158324d23542c209f689feca29c1c89d to your computer and use it in GitHub Desktop.
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
class RenameReadColumToState < ActiveRecord::Migration | |
def change | |
add_column :messages, :state, :integer, default: 0 | |
execute "UPDATE messages SET state = CAST(read AS INTEGER);" | |
remove_column :messages, :read | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment