tap/db/migrate/20141109174952_create_orders.rb
2014-11-09 22:53:39 +01:00

12 lines
236 B
Ruby

class CreateOrders < ActiveRecord::Migration
def change
create_table :orders do |t|
t.text :products
t.references :user, index: true
t.timestamps
end
add_index :orders, [:user_id, :created_at]
end
end