tap/db/migrate/20141123151756_create_orders.rb

13 lines
272 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.references :user, index: true
2014-11-23 20:12:31 +00:00
t.string :products
t.integer :cost
2014-11-09 21:53:39 +00:00
2014-11-23 20:12:31 +00:00
t.timestamps null: false
2014-11-09 21:53:39 +00:00
end
add_index :orders, [:user_id, :created_at]
end
end