Tuesday, 31 July 2012

Change the db with migrations on the fly

What if you want to add a column though the console with one line of code? (and you exactly know what this implies)
ActiveRecord::Migration.new.add_column :payments, :card_verification, :string, limit: 8
ActiveRecord::Migration.new.execute "full sql here"

No comments:

Post a Comment