add index in migrate file
This commit is contained in:
@@ -3,15 +3,16 @@ class CreateDiningFacilities < ActiveRecord::Migration[5.1]
|
||||
create_table :dining_facilities do |t|
|
||||
t.references :zone, foreign_key: true
|
||||
t.string :name, :null => false
|
||||
t.string :status, :null => false, :default => "available"
|
||||
t.string :type, :null => false, :default => "Table"
|
||||
t.string :status, :null => false, :default => "available", :index => true
|
||||
t.string :type, :null => false, :default => "Table", :index => true
|
||||
t.integer :seater, :null => false, :default => 2
|
||||
t.integer :order_by
|
||||
|
||||
t.string :created_by
|
||||
t.boolean :is_active, :null => false, :default => true
|
||||
t.boolean :is_active, :null => false, :default => true, :index => true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
add_index :dining_facilities, [:status, :type, :is_active]
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user