add index in migrate file
This commit is contained in:
@@ -5,17 +5,18 @@ class CreateBookings < ActiveRecord::Migration[5.1]
|
||||
|
||||
t.references :dining_facility, foreign_key: true
|
||||
t.string :type, :null => false, :default => "Table"
|
||||
t.datetime :checkin_at, :null => false
|
||||
t.datetime :checkin_at, :index => true, :null => false
|
||||
t.string :checkin_by
|
||||
t.datetime :checkout_at
|
||||
t.string :checkout_by
|
||||
t.string :checkout_by, :index => true
|
||||
t.datetime :reserved_at
|
||||
t.string :reserved_by
|
||||
t.string :booking_status, :null => false, :default => "new"
|
||||
t.string :reserved_by, :index => true
|
||||
t.string :booking_status, :index => true, :null => false, :default => "new"
|
||||
t.string :sale_id, foreign_key: true, :limit => 16
|
||||
t.string :customer_id, foreign_key: true, :limit => 16
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
add_index :bookings, [:checkin_at, :checkout_by, :reserved_by, :booking_status], name: 'index_bookings'
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user