parsley/db/schema.rb

216 lines
7.8 KiB
Ruby
Raw Normal View History

2016-01-12 18:43:00 -06:00
# 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.
#
2022-12-01 18:02:26 -06:00
# This file is the source Rails uses to define your schema when running `bin/rails
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
2020-08-06 20:26:45 -05:00
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
2016-01-12 18:43:00 -06:00
#
# It's strongly recommended that you check this file into your version control system.
2022-12-01 18:02:26 -06:00
ActiveRecord::Schema[7.0].define(version: 2018_09_15_134841) do
2018-09-11 10:38:07 -05:00
create_table "food_units", force: :cascade do |t|
t.integer "food_id", null: false
2018-03-29 01:57:00 -05:00
t.string "name", null: false
t.decimal "gram_weight", precision: 10, scale: 2, null: false
2018-09-11 10:38:07 -05:00
t.index ["food_id"], name: "index_food_units_on_food_id"
2016-07-05 16:31:36 -05:00
end
2018-09-11 10:38:07 -05:00
create_table "foods", force: :cascade do |t|
2018-03-29 01:57:00 -05:00
t.string "name"
t.string "density"
t.text "notes"
2022-12-01 18:02:26 -06:00
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
2019-02-02 15:32:42 -06:00
t.string "ndbn", limit: 25
2018-03-29 01:57:00 -05:00
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"
t.integer "calcium"
t.decimal "iron", precision: 10, scale: 2
t.integer "magnesium"
t.integer "phosphorus"
t.integer "potassium"
t.integer "sodium"
t.decimal "zinc", precision: 10, scale: 2
t.decimal "copper", precision: 10, scale: 3
t.decimal "manganese", precision: 10, scale: 3
t.decimal "vit_c", precision: 10, scale: 1
t.decimal "vit_b6", precision: 10, scale: 3
t.decimal "vit_b12", precision: 10, scale: 2
t.integer "vit_a"
t.decimal "vit_e", precision: 10, scale: 2
t.decimal "vit_d", precision: 10, scale: 1
t.decimal "vit_k", precision: 10, scale: 1
t.decimal "cholesterol", precision: 10, scale: 3
2020-08-06 20:26:45 -05:00
t.index ["ndbn"], name: "index_foods_on_ndbn"
2016-01-12 18:43:00 -06:00
end
2016-07-07 17:47:47 -05:00
create_table "logs", force: :cascade do |t|
2018-03-29 01:57:00 -05:00
t.integer "user_id"
t.integer "recipe_id"
t.integer "source_recipe_id"
2022-12-01 18:02:26 -06:00
t.datetime "date", precision: nil
2018-03-29 01:57:00 -05:00
t.integer "rating"
2022-12-01 18:02:26 -06:00
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
2018-03-29 01:57:00 -05:00
t.text "notes"
2016-07-07 17:47:47 -05:00
end
2016-10-14 12:19:00 -05:00
create_table "notes", force: :cascade do |t|
2018-03-29 01:57:00 -05:00
t.integer "user_id", null: false
t.text "content", null: false
2022-12-01 18:02:26 -06:00
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
2016-10-14 12:19:00 -05:00
t.index ["user_id"], name: "index_notes_on_user_id"
end
2016-01-12 18:43:00 -06:00
create_table "recipe_ingredients", force: :cascade do |t|
2018-09-11 10:38:07 -05:00
t.integer "food_id"
2018-03-29 01:57:00 -05:00
t.integer "recipe_id"
t.string "name"
t.integer "sort_order"
t.string "quantity"
t.string "units"
2022-12-01 18:02:26 -06:00
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
2018-03-29 01:57:00 -05:00
t.text "preparation"
2018-09-07 21:56:13 -05:00
t.integer "recipe_as_ingredient_id"
2016-07-27 22:30:57 -05:00
t.index ["recipe_id"], name: "index_recipe_ingredients_on_recipe_id"
2016-01-12 18:43:00 -06:00
end
create_table "recipe_steps", force: :cascade do |t|
2018-03-29 01:57:00 -05:00
t.integer "recipe_id"
t.integer "sort_order"
t.text "step"
2022-12-01 18:02:26 -06:00
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
2016-07-27 22:30:57 -05:00
t.index ["recipe_id"], name: "index_recipe_steps_on_recipe_id"
2016-01-12 18:43:00 -06:00
end
create_table "recipes", force: :cascade do |t|
2018-03-29 01:57:00 -05:00
t.string "name"
t.text "description"
t.text "source"
t.string "yields"
t.integer "total_time"
t.integer "active_time"
2022-12-01 18:02:26 -06:00
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
2018-03-29 01:57:00 -05:00
t.boolean "deleted"
t.integer "user_id"
t.boolean "is_log"
t.float "rating"
t.text "step_text"
2018-09-12 14:17:18 -05:00
t.boolean "is_ingredient"
end
2016-10-20 15:48:33 -05:00
create_table "recipes_tags", id: false, force: :cascade do |t|
t.integer "recipe_id"
t.integer "tag_id"
t.index ["recipe_id"], name: "index_recipes_tags_on_recipe_id"
t.index ["tag_id"], name: "index_recipes_tags_on_tag_id"
end
create_table "tags", force: :cascade do |t|
2018-03-29 01:57:00 -05:00
t.string "name"
t.string "lowercase_name"
2022-12-01 18:02:26 -06:00
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
2016-10-20 15:48:33 -05:00
t.index ["lowercase_name"], name: "index_tags_on_lowercase_name", unique: true
end
2018-08-27 17:46:33 -05:00
create_table "task_items", force: :cascade do |t|
t.integer "task_list_id", null: false
t.string "name"
t.string "quantity"
2022-12-01 18:02:26 -06:00
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
2018-09-06 18:16:13 -05:00
t.boolean "completed"
2018-08-27 17:46:33 -05:00
t.index ["task_list_id"], name: "index_task_items_on_task_list_id"
end
create_table "task_lists", force: :cascade do |t|
t.integer "user_id", null: false
t.string "name"
2022-12-01 18:02:26 -06:00
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
2018-08-27 17:46:33 -05:00
t.index ["user_id"], name: "index_task_lists_on_user_id"
end
create_table "usda_food_weights", force: :cascade do |t|
2018-03-29 01:57:00 -05:00
t.integer "usda_food_id", null: false
t.decimal "amount", precision: 7, scale: 3
t.string "description"
t.decimal "gram_weight", precision: 7, scale: 1
2022-12-01 18:02:26 -06:00
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
2016-07-27 22:30:57 -05:00
t.index ["usda_food_id"], name: "index_usda_food_weights_on_usda_food_id"
end
2016-01-24 17:10:43 -06:00
create_table "usda_foods", force: :cascade do |t|
2018-09-14 19:46:02 -05:00
t.string "ndbn", limit: 25, null: false
2018-03-29 01:57:00 -05:00
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"
2022-12-01 18:02:26 -06:00
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
2018-03-29 01:57:00 -05:00
t.integer "calcium"
t.decimal "iron", precision: 10, scale: 2
t.integer "magnesium"
t.integer "phosphorus"
t.integer "potassium"
t.integer "sodium"
t.decimal "zinc", precision: 10, scale: 2
t.decimal "copper", precision: 10, scale: 3
t.decimal "manganese", precision: 10, scale: 3
t.decimal "vit_c", precision: 10, scale: 1
t.decimal "vit_b6", precision: 10, scale: 3
t.decimal "vit_b12", precision: 10, scale: 2
t.integer "vit_a"
t.decimal "vit_e", precision: 10, scale: 2
t.decimal "vit_d", precision: 10, scale: 1
t.decimal "vit_k", precision: 10, scale: 1
t.decimal "cholesterol", precision: 10, scale: 3
2018-09-14 19:32:49 -05:00
t.string "source"
t.string "manufacturer"
t.text "ingredients"
t.string "nutrient_unit"
2016-07-27 22:30:57 -05:00
t.index ["long_description"], name: "index_usda_foods_on_long_description"
t.index ["ndbn"], name: "index_usda_foods_on_ndbn"
2016-01-24 17:10:43 -06:00
end
create_table "users", force: :cascade do |t|
2018-03-29 01:57:00 -05:00
t.string "username"
t.string "email"
t.string "full_name"
t.string "password_digest"
t.boolean "admin"
2022-12-01 18:02:26 -06:00
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
2016-01-12 18:43:00 -06:00
end
end