From 12015f608380498a068fea0d9f19b298e750741b Mon Sep 17 00:00:00 2001 From: cryptogopher Date: Sat, 2 Nov 2019 23:35:08 +0100 Subject: [PATCH] Added Quantity.formula Added timestamps to all models --- db/migrate/001_create_units.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/db/migrate/001_create_units.rb b/db/migrate/001_create_units.rb index d9d0f14..67c593d 100644 --- a/db/migrate/001_create_units.rb +++ b/db/migrate/001_create_units.rb @@ -4,24 +4,28 @@ class CreateUnits < ActiveRecord::Migration t.references :project t.string :name t.string :shortname + t.timestamps null: false end create_table :quantities do |t| t.references :project - t.string :name - t.string :description t.integer :domain + t.string :name + t.string :formula + t.string :description t.boolean :primary # fields for awesome_nested_set t.references :parent t.integer :lft, :null => false, :index => true t.integer :rgt, :null => false, :index => true + t.timestamps null: false end create_table :sources do |t| t.references :project t.string :name t.text :description + t.timestamps null: false end create_table :ingredients do |t| @@ -33,6 +37,7 @@ class CreateUnits < ActiveRecord::Migration t.references :source t.string :source_ident t.boolean :hidden + t.timestamps null: false end create_table :nutrients do |t| @@ -40,6 +45,7 @@ class CreateUnits < ActiveRecord::Migration t.references :quantity t.decimal :amount, precision: 12, scale: 6 t.references :unit + t.timestamps null: false end reversible do |dir|