class CreateUsdaFood < ActiveRecord::Migration[4.2]
  def change
    create_table :usda_foods do |t|

      t.string :ndbn, limit: 5, index: :unique, null: false
      t.string :long_description, index: true
      t.string :short_description
      t.decimal :water, precision: 10, scale: 2
      t.integer :kcal
      t.decimal :protein, precision: 10, scale: 2
      t.decimal :lipid, precision: 10, scale: 2
      t.decimal :ash, precision: 10, scale: 2
      t.decimal :carbohydrates, precision: 10, scale: 2
      t.decimal :fiber, precision: 10, scale: 1
      t.decimal :sugar, precision: 10, scale: 2
      t.decimal :gram_weight_1, precision: 9, scale: 2
      t.decimal :gram_weight_2, precision: 9, scale: 2
      t.string :gram_weight_desc_1
      t.string :gram_weight_desc_2
      t.string :refuse_description
      t.integer :refuse_percent
      t.string :scientific_name

      t.timestamps null: false
    end
  end
end
