menu, table,rooms, orders structure
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
class CreateSeatTables < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :seat_tables do |t|
|
||||
t.references :zone, foreign_key: true
|
||||
t.string :name, :null => false
|
||||
t.integer :order_by
|
||||
t.integer :no_of_seater, :null => false, :default => 2
|
||||
t.string :table_type, :null => false, :default => "square"
|
||||
t.float :position_x, :null => false, :default => 0.0
|
||||
t.float :position_y, :null => false, :default => 0.0
|
||||
t.string :created_by
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,13 +0,0 @@
|
||||
class CreateRooms < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :rooms do |t|
|
||||
t.string :name, :null => false
|
||||
t.integer :seater, :null => false, :default => 4
|
||||
t.string :created_by
|
||||
t.boolean :is_active, :null => false, :default => true
|
||||
t.integer :order_by
|
||||
t.references :zone
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -2,7 +2,7 @@ class CreateMenus < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :menus do |t|
|
||||
t.string :name
|
||||
t.boolean :is_active, :null => false
|
||||
t.boolean :is_active, :null => false, :deafult => true
|
||||
t.string :valid_days, :null => false, :default => "1,2,3,4,5,6,7"
|
||||
t.time :valid_time_from, :null => false, :default => "00:00:00"
|
||||
t.time :valid_time_to, :null => false, :default => "23:59:59"
|
||||
|
||||
@@ -5,7 +5,7 @@ class CreateMenuCategories < ActiveRecord::Migration[5.0]
|
||||
t.string :name, :null => false
|
||||
t.string :alt_name
|
||||
t.integer :order_by
|
||||
t.integer :parent_category_id
|
||||
t.references :menu_category, :null => true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
19
db/migrate/20170331024749_create_menu_items.rb
Normal file
19
db/migrate/20170331024749_create_menu_items.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
class CreateMenuItems < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :menu_items do |t|
|
||||
t.string :item_code, :null => false
|
||||
t.string :name, :null => false
|
||||
t.string :alt_name
|
||||
t.string :type, :null => false, :default => "SimpleMenuItem"
|
||||
t.references :menu_category, foreign_key: true
|
||||
t.references :menu_item, foreign_key: true
|
||||
t.integer :min_selectable_item, :null => false, :default => 1
|
||||
t.integer :max_selectable_item, :null => false, :default => 1
|
||||
t.json :options #save value
|
||||
t.json :attributes #value IDS
|
||||
t.string :created_by
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
11
db/migrate/20170402083337_create_menu_item_attributes.rb
Normal file
11
db/migrate/20170402083337_create_menu_item_attributes.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateMenuItemAttributes < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :menu_item_attributes do |t|
|
||||
t.string :attribute_type, :null => false
|
||||
t.string :name, :null => false
|
||||
t.string :value, :null => false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
10
db/migrate/20170402083525_create_menu_item_options.rb
Normal file
10
db/migrate/20170402083525_create_menu_item_options.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class CreateMenuItemOptions < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :menu_item_options do |t|
|
||||
t.string :name, :null => false
|
||||
t.string :value, :null => false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
14
db/migrate/20170402084230_create_menu_item_instances.rb
Normal file
14
db/migrate/20170402084230_create_menu_item_instances.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class CreateMenuItemInstances < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :menu_item_instances do |t|
|
||||
t.references :menu_item, :foreign_key => true, :null => false
|
||||
t.string :item_instance_code, :null => false
|
||||
t.json :attributes
|
||||
t.decimal :price, :null => false
|
||||
t.boolean :is_available, :null => false, :default => true
|
||||
t.boolean :is_on_promotion, :null => false, :default => false
|
||||
t.decimal :promotion_price, :null => false, :default => false
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
15
db/migrate/20170403135121_create_customers.rb
Normal file
15
db/migrate/20170403135121_create_customers.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
class CreateCustomers < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :customers do |t|
|
||||
t.string :name, :null => false
|
||||
t.string :company
|
||||
t.string :contact_no
|
||||
t.string :email
|
||||
t.string :membership_id
|
||||
t.string :membership_type
|
||||
t.string :membership_authentication_code
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
17
db/migrate/20170403135934_create_orders.rb
Normal file
17
db/migrate/20170403135934_create_orders.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class CreateOrders < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :orders do |t|
|
||||
t.datetime :date, :null => false
|
||||
t.string :source, :null => false, :default => "emenu"
|
||||
t.string :order_type, :null => false, :default => "dine-in"
|
||||
t.references :customer, foreign_key: true
|
||||
t.integer :item_count, :null => false, :default => 0
|
||||
t.integer :quantity_count, :null => false, :default => 0
|
||||
t.string :status, :null => false, :default => "new"
|
||||
t.json :waiters
|
||||
t.json :guest_info
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
18
db/migrate/20170403140820_create_order_items.rb
Normal file
18
db/migrate/20170403140820_create_order_items.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
class CreateOrderItems < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :order_items do |t|
|
||||
t.references :order, foreign_key: true, :null => false
|
||||
t.string :order_item_status, :null => false, :default => "new"
|
||||
t.string :item_code, :null => false
|
||||
t.string :item_name, :null => false
|
||||
t.integer :qty, :null => false
|
||||
t.string :item_order_by #person who order this
|
||||
t.string :remark
|
||||
t.string :options
|
||||
t.string :variants
|
||||
t.json :set_menu_items #this parameter is require to route the items correctly
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
16
db/migrate/20170403142424_create_dining_facilities.rb
Normal file
16
db/migrate/20170403142424_create_dining_facilities.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
class CreateDiningFacilities < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :dining_facilities do |t|
|
||||
t.references :zone, foreign_key: true
|
||||
t.string :name, :null => false
|
||||
t.string :type, :null => false, :default => "table"
|
||||
t.integer :seater, :null => false, :default => 2
|
||||
t.integer :order_by
|
||||
|
||||
t.string :created_by
|
||||
t.boolean :is_active, :null => false, :default => true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
11
db/migrate/20170403143526_create_dining_ins.rb
Normal file
11
db/migrate/20170403143526_create_dining_ins.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateDiningIns < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :dining_ins do |t|
|
||||
t.references :table
|
||||
t.references :order
|
||||
t.boolean :currently_occupied, :default => false #there will only be 1 true - where table_id+order_id
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
15
db/migrate/20170403144732_create_room_bookings.rb
Normal file
15
db/migrate/20170403144732_create_room_bookings.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
class CreateRoomBookings < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :room_bookings do |t|
|
||||
t.references :room, :null => false
|
||||
t.datetime :checkin_at
|
||||
t.datetime :checkout_at
|
||||
t.string :checkout_by
|
||||
t.datetime :reserved_at
|
||||
t.string :reserved_by
|
||||
t.string :status, :null => false, :default => "new"
|
||||
t.boolean :is_currently_checkin, :default => false, :null => true
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
11
db/migrate/20170403145042_create_room_orders.rb
Normal file
11
db/migrate/20170403145042_create_room_orders.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateRoomOrders < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :room_orders do |t|
|
||||
t.references :room, foreign_key: true
|
||||
t.references :orders, foreign_key: true
|
||||
t.string :order_by
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user