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

  create_table "answers", force: :cascade do |t|
    t.text     "content"
    t.string   "answer_type"
    t.integer  "question_id"
    t.datetime "created_at",  null: false
    t.datetime "updated_at",  null: false
  end

  add_index "answers", ["question_id"], name: "index_answers_on_question_id"

  create_table "given_answers", force: :cascade do |t|
    t.boolean  "correct_answer"
    t.text     "free_answer"
    t.integer  "question_id"
    t.integer  "answer_id"
    t.integer  "result_id"
    t.datetime "created_at",     null: false
    t.datetime "updated_at",     null: false
  end

  add_index "given_answers", ["answer_id"], name: "index_given_answers_on_answer_id"
  add_index "given_answers", ["question_id"], name: "index_given_answers_on_question_id"
  add_index "given_answers", ["result_id"], name: "index_given_answers_on_result_id"

  create_table "questions", force: :cascade do |t|
    t.text     "content"
    t.string   "question_type"
    t.integer  "quiz_id"
    t.datetime "created_at",    null: false
    t.datetime "updated_at",    null: false
  end

  add_index "questions", ["quiz_id"], name: "index_questions_on_quiz_id"

  create_table "quizzes", force: :cascade do |t|
    t.string   "name"
    t.datetime "created_at",     null: false
    t.datetime "updated_at",     null: false
    t.integer  "user_id"
    t.string   "publish_string"
  end

  add_index "quizzes", ["user_id"], name: "index_quizzes_on_user_id"

  create_table "results", force: :cascade do |t|
    t.integer  "number_of_answers"
    t.integer  "number_of_correct_answers"
    t.integer  "quiz_id"
    t.integer  "user_id"
    t.datetime "created_at",                      null: false
    t.datetime "updated_at",                      null: false
    t.integer  "number_of_questions"
    t.integer  "number_of_free_answer_questions"
    t.integer  "number_of_free_answers"
    t.string   "link"
    t.integer  "total_number_of_correct_answers"
  end

  add_index "results", ["quiz_id"], name: "index_results_on_quiz_id"
  add_index "results", ["user_id"], name: "index_results_on_user_id"

  create_table "users", force: :cascade do |t|
    t.string   "name"
    t.string   "email"
    t.integer  "role"
    t.datetime "created_at",                      null: false
    t.datetime "updated_at",                      null: false
    t.string   "password_digest"
    t.string   "remember_digest"
    t.boolean  "admin",           default: false
  end

end
