View raw

1 # This file is auto-generated from the current state of the database. Instead 2 # of editing this file, please use the migrations feature of Active Record to 3 # incrementally modify your database, and then regenerate this schema definition. 4 # 5 # This file is the source Rails uses to define your schema when running `bin/rails 6 # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to 7 # be faster and is potentially less error prone than running all of your 8 # migrations from scratch. Old migrations may fail to apply correctly if those 9 # migrations use external dependencies or application code. 10 # 11 # It's strongly recommended that you check this file into your version control system. 12 13 ActiveRecord::Schema[8.0].define(version: 2025_01_01_160120) do 14 create_table "scores", force: :cascade do |t| 15 t.integer "tartiflette_id", null: false 16 t.integer "scoring_criterium_id", null: false 17 t.integer "value" 18 t.datetime "created_at", null: false 19 t.datetime "updated_at", null: false 20 t.string "session_id", null: false 21 t.index ["scoring_criterium_id"], name: "index_scores_on_scoring_criterium_id" 22 t.index ["session_id"], name: "index_scores_on_session_id" 23 t.index ["tartiflette_id", "scoring_criterium_id", "session_id"], name: "index_scores_on_tartiflette_criterium_session", unique: true 24 t.index ["tartiflette_id"], name: "index_scores_on_tartiflette_id" 25 end 26 27 create_table "scoring_criteria", force: :cascade do |t| 28 t.string "name" 29 t.string "category" 30 t.datetime "created_at", null: false 31 t.datetime "updated_at", null: false 32 end 33 34 create_table "sessions", force: :cascade do |t| 35 t.integer "user_id", null: false 36 t.string "ip_address" 37 t.string "user_agent" 38 t.datetime "created_at", null: false 39 t.datetime "updated_at", null: false 40 t.index ["user_id"], name: "index_sessions_on_user_id" 41 end 42 43 create_table "tartiflettes", force: :cascade do |t| 44 t.integer "scoring_id" 45 t.datetime "created_at", null: false 46 t.datetime "updated_at", null: false 47 t.string "name" 48 end 49 50 create_table "users", force: :cascade do |t| 51 t.string "email_address", null: false 52 t.string "password_digest", null: false 53 t.datetime "created_at", null: false 54 t.datetime "updated_at", null: false 55 t.boolean "admin", default: false 56 t.index ["email_address"], name: "index_users_on_email_address", unique: true 57 end 58 59 add_foreign_key "scores", "scoring_criteria" 60 add_foreign_key "scores", "tartiflettes" 61 add_foreign_key "sessions", "users" 62 end 63