Added :meals and :compositions_ingredients tables
Changed Column -> QuantityColumn Updated :ingredients table to handle recipes
This commit is contained in:
@@ -27,7 +27,7 @@ class CreateSchema < ActiveRecord::Migration
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
create_table :columns do |t|
|
||||
create_table :quantity_columns do |t|
|
||||
t.references :column_view, polymorphic: true
|
||||
t.references :quantity
|
||||
end
|
||||
@@ -49,6 +49,7 @@ class CreateSchema < ActiveRecord::Migration
|
||||
t.references :source
|
||||
t.string :source_ident
|
||||
t.boolean :hidden
|
||||
t.decimal :ready_amount, precision: 12, scale: 6
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
@@ -82,5 +83,21 @@ class CreateSchema < ActiveRecord::Migration
|
||||
t.references :unit
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
create_table :meals do |t|
|
||||
t.references :project
|
||||
t.text :notes
|
||||
t.timestamp :eaten_at
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
create_table :compositions_ingredients do |t|
|
||||
t.references :composition, polymorphic: true
|
||||
t.references :ingredient
|
||||
t.references :part_of
|
||||
t.decimal :ready_ratio, precision: 12, scale: 6
|
||||
t.decimal :amount, precision: 12, scale: 6
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user