29 lines
1.0 KiB
Ruby
Executable File
29 lines
1.0 KiB
Ruby
Executable File
class CreateMenuItems < ActiveRecord::Migration[5.1]
|
|
def change
|
|
create_table :menu_items do |t|
|
|
t.string :item_code, :null => false, :index => true
|
|
t.string :name, :null => false
|
|
t.string :alt_name
|
|
t.string :image_path
|
|
t.text :description
|
|
t.string :information
|
|
t.string :unit
|
|
t.string :type, :null => false, :default => "SimpleMenuItem"
|
|
t.references :menu_category, foreign_key: true
|
|
t.json :item_attributes
|
|
t.json :item_options
|
|
# t.references :menu_item, foreign_key: true
|
|
t.references :account, foreign_key: true
|
|
t.integer :min_qty, :null => false, :default => 1
|
|
t.boolean :taxable, :null => false, :default => true
|
|
t.boolean :is_sub_item, :null => false, :default => false
|
|
t.boolean :is_available, :null => false, :default => true
|
|
# t.integer :min_selectable_item, :null => false, :default => 1
|
|
# t.integer :max_selectable_item, :null => false, :default => 1
|
|
t.string :created_by
|
|
|
|
t.timestamps
|
|
end
|
|
end
|
|
end
|