zone and seat_table models

This commit is contained in:
Min Zeya Phyo
2017-03-24 20:31:58 +06:30
parent 41c24d871d
commit 3ec71e85fe
9 changed files with 260 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
class CreateZones < ActiveRecord::Migration[5.0]
def change
create_table :zones do |t|
t.string :name, :null => false
t.boolean :is_active, :default => true
t.timestamps
end
end
end

View File

@@ -0,0 +1,15 @@
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.timestamps
end
end
end