Added Quantity.formula
Added timestamps to all models
This commit is contained in:
parent
31518660c8
commit
12015f6083
@ -4,24 +4,28 @@ class CreateUnits < ActiveRecord::Migration
|
|||||||
t.references :project
|
t.references :project
|
||||||
t.string :name
|
t.string :name
|
||||||
t.string :shortname
|
t.string :shortname
|
||||||
|
t.timestamps null: false
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table :quantities do |t|
|
create_table :quantities do |t|
|
||||||
t.references :project
|
t.references :project
|
||||||
t.string :name
|
|
||||||
t.string :description
|
|
||||||
t.integer :domain
|
t.integer :domain
|
||||||
|
t.string :name
|
||||||
|
t.string :formula
|
||||||
|
t.string :description
|
||||||
t.boolean :primary
|
t.boolean :primary
|
||||||
# fields for awesome_nested_set
|
# fields for awesome_nested_set
|
||||||
t.references :parent
|
t.references :parent
|
||||||
t.integer :lft, :null => false, :index => true
|
t.integer :lft, :null => false, :index => true
|
||||||
t.integer :rgt, :null => false, :index => true
|
t.integer :rgt, :null => false, :index => true
|
||||||
|
t.timestamps null: false
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table :sources do |t|
|
create_table :sources do |t|
|
||||||
t.references :project
|
t.references :project
|
||||||
t.string :name
|
t.string :name
|
||||||
t.text :description
|
t.text :description
|
||||||
|
t.timestamps null: false
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table :ingredients do |t|
|
create_table :ingredients do |t|
|
||||||
@ -33,6 +37,7 @@ class CreateUnits < ActiveRecord::Migration
|
|||||||
t.references :source
|
t.references :source
|
||||||
t.string :source_ident
|
t.string :source_ident
|
||||||
t.boolean :hidden
|
t.boolean :hidden
|
||||||
|
t.timestamps null: false
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table :nutrients do |t|
|
create_table :nutrients do |t|
|
||||||
@ -40,6 +45,7 @@ class CreateUnits < ActiveRecord::Migration
|
|||||||
t.references :quantity
|
t.references :quantity
|
||||||
t.decimal :amount, precision: 12, scale: 6
|
t.decimal :amount, precision: 12, scale: 6
|
||||||
t.references :unit
|
t.references :unit
|
||||||
|
t.timestamps null: false
|
||||||
end
|
end
|
||||||
|
|
||||||
reversible do |dir|
|
reversible do |dir|
|
||||||
|
Reference in New Issue
Block a user