Skip to content

Instantly share code, notes, and snippets.

@erez-rabih
Created July 19, 2012 08:50
Show Gist options
  • Save erez-rabih/3141665 to your computer and use it in GitHub Desktop.
Save erez-rabih/3141665 to your computer and use it in GitHub Desktop.
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