For example i have this model:
class Product < ActiveRecord::Base
attr_accessible :name, :order
end
Then when i did rake db:migrate
it created this db/migrate/20120825132038_create_products.rb:
class CreateProducts < ActiveRecord::Migration
def change
create_table :products do |t|
t.integer :order
t.string :name
t.timestamps
end
end
end
But it all happend cuz i used rails generate Product order:integer name:string
Now after i go to Product model and changes it manually to:
class Product < ActiveRecord::Base
attr_accessible :name, :order, :category_id
validates :name, uniqueness: true
belongs_to :category
end
How can i auto update the db/migrate/20120825132038_create_products.rb with the updates?