tap/db/migrate/20141109174952_create_orders.rb

12 lines
236 B
Ruby
Raw Normal View History

2014-11-09 21:53:39 +00:00
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