Created
July 19, 2012 08:50
-
-
Save erez-rabih/3141665 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 AddFlagToSomeModels < ActiveRecord::Migration | |
def self.up | |
add_column :some_models, :flag, :boolean, :default => true, :null => false | |
SomeModel.first.update_attribute(:flag, false) | |
end | |
def self.down | |
remove_column :some_models, :active | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment