# 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: 2019_08_22_153138) do

  create_table "attempts", force: :cascade do |t|
    t.integer "status"
    t.integer "user_id"
    t.integer "quiz_id"
    t.index ["quiz_id"], name: "index_attempts_on_quiz_id"
    t.index ["user_id"], name: "index_attempts_on_user_id"
  end

  create_table "choices", force: :cascade do |t|
    t.string "text"
    t.boolean "truth_value"
    t.integer "question_id"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.index ["question_id"], name: "index_choices_on_question_id"
  end

  create_table "decks", force: :cascade do |t|
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.integer "user_id"
    t.string "title"
    t.text "description"
    t.boolean "active", default: true
    t.index ["user_id"], name: "index_decks_on_user_id"
  end

  create_table "decks_quizzes", id: false, force: :cascade do |t|
    t.integer "quiz_id", null: false
    t.integer "deck_id", null: false
    t.index ["deck_id", "quiz_id"], name: "index_decks_quizzes_on_deck_id_and_quiz_id"
    t.index ["quiz_id", "deck_id"], name: "index_decks_quizzes_on_quiz_id_and_deck_id"
  end

  create_table "problems", force: :cascade do |t|
    t.boolean "answered", default: false
    t.integer "problem_order"
    t.boolean "correct"
    t.integer "attempt_id"
    t.integer "question_id"
    t.index ["attempt_id"], name: "index_problems_on_attempt_id"
    t.index ["question_id"], name: "index_problems_on_question_id"
  end

  create_table "questions", force: :cascade do |t|
    t.integer "question_type"
    t.text "description"
    t.text "text"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.integer "deck_id"
    t.index ["deck_id"], name: "index_questions_on_deck_id"
  end

  create_table "quizzes", force: :cascade do |t|
    t.string "title"
    t.text "description"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.integer "user_id"
    t.boolean "active", default: true
    t.index ["user_id"], name: "index_quizzes_on_user_id"
  end

  create_table "users", force: :cascade do |t|
    t.string "email", default: "", null: false
    t.string "encrypted_password", default: "", null: false
    t.string "reset_password_token"
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.string "first_name"
    t.string "last_name"
    t.string "confirmation_token"
    t.datetime "confirmed_at"
    t.datetime "confirmation_sent_at"
    t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
    t.index ["email"], name: "index_users_on_email", unique: true
    t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
  end

end
