tap/db/migrate/20141123151756_create_orders.rb

13 lines
272 B
Ruby
Raw Normal View History

2014-11-09 22:53:39 +01:00
class CreateOrders < ActiveRecord::Migration
def change
create_table :orders do |t|
t.references :user, index: true
2014-11-23 21:12:31 +01:00
t.string :products
t.integer :cost
2014-11-09 22:53:39 +01:00
2014-11-23 21:12:31 +01:00
t.timestamps null: false
2014-11-09 22:53:39 +01:00
end
add_index :orders, [:user_id, :created_at]
end
end