1
0

Added :meals and :compositions_ingredients tables

Changed Column -> QuantityColumn
Updated :ingredients table to handle recipes
This commit is contained in:
cryptogopher
2020-04-13 01:11:34 +02:00
parent dbb8bdc62e
commit ced06a25bc
6 changed files with 28 additions and 9 deletions

View File

@@ -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