add pivot table for menu
This commit is contained in:
9
db/migrate/20170810121704_create_item_sets.rb
Normal file
9
db/migrate/20170810121704_create_item_sets.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class CreateItemSets < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :item_sets do |t|
|
||||
t.string :name, :null => false
|
||||
t.integer :min_selectable_qty
|
||||
t.integer :max_selectable_qty
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,8 @@
|
||||
class CreateMenuInstanceItemSets < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :menu_instance_item_sets do |t|
|
||||
t.references :item_set_id, foreign_key: true
|
||||
t.references :menu_item_instance_id, foreign_key: true
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
8
db/migrate/20170811121704_create_menu_item_sets.rb
Normal file
8
db/migrate/20170811121704_create_menu_item_sets.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
class CreateMenuItemSets < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :menu_item_sets do |t|
|
||||
t.references :item_set_id, foreign_key: true
|
||||
t.references :menu_item_id, foreign_key: true
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user