1
0

Added Quantity.formula

Added timestamps to all models
This commit is contained in:
cryptogopher 2019-11-02 23:35:08 +01:00
parent 31518660c8
commit 12015f6083

View File

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