I am building an Rails 3.2.6 app and I need to add a default value to a column on an already created table called tasks. How can I do this with a migration?
Thanks!
I am building an Rails 3.2.6 app and I need to add a default value to a column on an already created table called tasks. How can I do this with a migration?
Thanks!
Use change_column(table_name, column_name, type, options = {}):
def up
change_column :tasks, :my_column, :integer, :default => 1
end