119 lines
4.8 KiB
Ruby
119 lines
4.8 KiB
Ruby
# encoding: UTF-8
|
|
# This file is auto-generated from the current state of the database. Instead
|
|
# of editing this file, please use the migrations feature of Active Record to
|
|
# incrementally modify your database, and then regenerate this schema definition.
|
|
#
|
|
# Note that this schema.rb definition is the authoritative source for your
|
|
# database schema. If you need to create the application database on another
|
|
# system, you should be using db:schema:load, not running all the migrations
|
|
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
|
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
|
#
|
|
# It's strongly recommended that you check this file into your version control system.
|
|
|
|
ActiveRecord::Schema.define(version: 20160309182253) do
|
|
|
|
create_table "ingredients", force: :cascade do |t|
|
|
t.string "name"
|
|
t.string "density"
|
|
t.text "notes"
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
t.string "ndbn", limit: 5
|
|
t.decimal "water", precision: 10, scale: 2
|
|
t.decimal "protein", precision: 10, scale: 2
|
|
t.decimal "lipids", precision: 10, scale: 2
|
|
t.decimal "ash", precision: 10, scale: 2
|
|
t.decimal "carbohydrates", precision: 10, scale: 2
|
|
t.integer "kcal"
|
|
t.decimal "fiber", precision: 10, scale: 1
|
|
t.decimal "sugar", precision: 10, scale: 2
|
|
t.integer "user_id"
|
|
end
|
|
|
|
create_table "recipe_ingredients", force: :cascade do |t|
|
|
t.integer "ingredient_id"
|
|
t.integer "recipe_id"
|
|
t.string "name"
|
|
t.integer "sort_order"
|
|
t.string "quantity"
|
|
t.string "units"
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
t.text "preparation"
|
|
end
|
|
|
|
add_index "recipe_ingredients", ["recipe_id"], name: "index_recipe_ingredients_on_recipe_id"
|
|
|
|
create_table "recipe_steps", force: :cascade do |t|
|
|
t.integer "recipe_id"
|
|
t.integer "sort_order"
|
|
t.text "step"
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
end
|
|
|
|
add_index "recipe_steps", ["recipe_id"], name: "index_recipe_steps_on_recipe_id"
|
|
|
|
create_table "recipes", force: :cascade do |t|
|
|
t.string "name"
|
|
t.text "description"
|
|
t.text "source"
|
|
t.integer "yields"
|
|
t.integer "total_time"
|
|
t.integer "active_time"
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
t.boolean "deleted"
|
|
t.integer "user_id"
|
|
end
|
|
|
|
create_table "usda_food_weights", force: :cascade do |t|
|
|
t.integer "usda_food_id", null: false
|
|
t.decimal "amount", precision: 5, scale: 3
|
|
t.string "description"
|
|
t.decimal "gram_weight", precision: 7, scale: 1
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
end
|
|
|
|
add_index "usda_food_weights", ["usda_food_id"], name: "index_usda_food_weights_on_usda_food_id"
|
|
|
|
create_table "usda_foods", force: :cascade do |t|
|
|
t.string "ndbn", limit: 5, null: false
|
|
t.string "long_description"
|
|
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.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
end
|
|
|
|
add_index "usda_foods", ["long_description"], name: "index_usda_foods_on_long_description"
|
|
add_index "usda_foods", ["ndbn"], name: "index_usda_foods_on_ndbn"
|
|
|
|
create_table "users", force: :cascade do |t|
|
|
t.string "username"
|
|
t.string "email"
|
|
t.string "full_name"
|
|
t.string "password_digest"
|
|
t.boolean "admin"
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
end
|
|
|
|
end
|