add item set and relation
This commit is contained in:
11
db/migrate/20170811070634_create_item_sets.rb
Normal file
11
db/migrate/20170811070634_create_item_sets.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateItemSets < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :item_sets do |t|
|
||||
t.string :name
|
||||
t.integer :min_selectable_qty
|
||||
t.integer :max_selectable_qty
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
10
db/migrate/20170811071108_create_menu_item_sets.rb
Normal file
10
db/migrate/20170811071108_create_menu_item_sets.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
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
|
||||
end
|
||||
10
db/migrate/20170811071327_create_menu_instance_item_sets.rb
Normal file
10
db/migrate/20170811071327_create_menu_instance_item_sets.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
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
|
||||
end
|
||||
Reference in New Issue
Block a user