Migrations comes up with the convenient way to alter your database in a structured and organized pattern.
it makes use of Ruby DSL so no need to write SQL statements, allowing your schema to reflect changes independently.
Anatomy of Migration
class CreateProducts < ActiveRecord::Migration
def up
create_table :products do |t|
t.string :name
t.text :description
t.timestamps
end
end
def down
drop_table :products
end
end
0 Comment(s)