class CreateMenuItemInstances < ActiveRecord::Migration[5.1]
  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.string :item_instance_name, :null => false
      t.json    :item_attributes
      t.decimal :price,:precision => 10, :scale => 2, :null => false, :default => 0.00
      t.boolean :is_on_promotion, :null => false, :default => false
      t.decimal :promotion_price, :precision => 10, :scale => 2, :null => false, :default => 0.00
      t.boolean :is_available, :null => false, :default => true
      t.timestamps
    end
  end
end
