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
|