employee login and authentication with session

This commit is contained in:
Min Zeya Phyo
2017-04-14 22:47:44 +06:30
parent c1e61c1a39
commit db75780267
27 changed files with 137 additions and 96 deletions

View File

@@ -3,8 +3,11 @@ class CreateEmployees < ActiveRecord::Migration[5.0]
create_table :employees do |t|
t.string :name, :null => false
t.string :role, :null => false, :default => "cashier"
t.string :encrypted_access_code, :null => false
t.string :emp_id, :null => false
t.string :password_digest, :null => false
t.string :token_session
t.datetime :session_expiry
t.datetime :session_last_login
t.timestamps
end
end

View File

@@ -1,10 +0,0 @@
class CreateTableBookingOrders < ActiveRecord::Migration[5.0]
def change
create_table :table_booking_orders do |t|
t.references :table_booking
t.references :order, foreign_key: true
t.timestamps
end
end
end

View File

@@ -1,10 +0,0 @@
class CreateRoomBookingOrders < ActiveRecord::Migration[5.0]
def change
create_table :room_booking_orders do |t|
t.references :room_booking
t.references :order, foreign_key: true
t.timestamps
end
end
end

View File

@@ -0,0 +1,10 @@
class CreateBookingOrders < ActiveRecord::Migration[5.0]
def change
create_table :booking_orders do |t|
t.references :booking, foreign_key: true
t.references :order, foreign_key: true
t.timestamps
end
end
end