class CreateProducts < ActiveRecord::Migration[5.0]
def change
create_table :products do |t|
t.string :name
t.text :description
end
end
end
rails generate migration
- creates a new migration. Look it up for how to parameters workrails db:migrate
- applies the migrations to the existing databasesrails db:rollback
- rolls the most recent migration back (un-applies)rails db:reset
- drop the database and set it up againrake db:create_migration
- creates a new migration. Look it up for how to parameters workrake db:migrate
- applies the migrations to the existing databasesrake db:rollback
- rolls the most recent migration back (un-applies)rake db:reset
- drop the database and set it up again