Files
sx-fc/db/migrate/20170403155230_create_employees.rb
2018-08-24 11:52:58 +06:30

20 lines
644 B
Ruby
Executable File

class CreateEmployees < ActiveRecord::Migration[5.1]
def change
create_table :employees do |t|
t.string :name, :null => false
t.string :role, :null => false, :default => "cashier"
t.boolean :is_active, :default => true, :index=>true
t.string :emp_id, :null => false
t.integer :order_queue_station_id
t.string :password_digest, :null => false
t.string :token_session, :index=>true
t.datetime :session_expiry
t.datetime :session_last_login
t.string :created_by
t.string :image_path
t.timestamps
end
add_index :employees, [:is_active, :token_session]
end
end