# 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: 20180725155729) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" create_table "accounts", force: :cascade do |t| t.bigint "canvas_account_id", null: false t.string "account_id" t.bigint "canvas_parent_id" t.string "parent_account_id" t.string "name" t.string "status" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_account_id"], name: "index_accounts_on_canvas_account_id", unique: true end create_table "admins", force: :cascade do |t| t.bigint "canvas_admin_id", null: false t.string "role_name" t.bigint "canvas_role_id", null: false t.json "user_data" t.bigint "canvas_user_id", null: false t.string "workflow_state", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_admin_id"], name: "index_admins_on_canvas_admin_id", unique: true end create_table "assignment_groups", force: :cascade do |t| t.bigint "canvas_assignment_group_id", null: false t.bigint "canvas_course_id" t.string "name" t.text "rules" t.integer "position" t.float "group_weight" t.string "workflow_state" t.datetime "canvas_created_at" t.datetime "canvas_updated_at" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_assignment_group_id"], name: "index_assignment_groups_on_canvas_assignment_group_id", unique: true t.index ["canvas_course_id"], name: "index_assignment_groups_on_canvas_course_id" end create_table "assignments", force: :cascade do |t| t.bigint "canvas_assignment_id", null: false t.string "title" t.text "description" t.datetime "due_at" t.datetime "unlock_at" t.datetime "lock_at" t.integer "points_possible" t.integer "min_score" t.integer "max_score" t.integer "mastery_score" t.string "grading_type" t.string "submission_types" t.string "workflow_state" t.integer "context_id" t.string "context_type" t.integer "canvas_assignment_group_id" t.integer "grading_scheme_id" t.integer "grading_standard_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_assignment_id"], name: "index_assignments_on_canvas_assignment_id", unique: true t.index ["context_id", "context_type"], name: "index_assignments_on_context_id_and_context_type" end create_table "canvas_sync_job_logs", force: :cascade do |t| t.datetime "started_at" t.datetime "completed_at" t.string "exception" t.text "backtrace" t.string "job_class" t.string "status" t.text "metadata" t.text "job_arguments" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "job_id" t.index ["job_id"], name: "index_canvas_sync_job_logs_on_job_id" end create_table "context_module_items", force: :cascade do |t| t.bigint "canvas_context_module_item_id" t.bigint "canvas_context_module_id" t.integer "position" t.string "content_type" t.bigint "content_id" t.bigint "canvas_assignment_id" t.string "workflow_state" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_context_module_id"], name: "index_context_module_items_on_canvas_context_module_id" t.index ["canvas_context_module_item_id"], name: "index_context_module_items_on_canvas_context_module_item_id", unique: true end create_table "context_modules", force: :cascade do |t| t.bigint "canvas_context_module_id" t.bigint "canvas_context_id" t.string "canvas_context_type" t.integer "position" t.string "name" t.string "workflow_state" t.datetime "deleted_at" t.datetime "unlock_at" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_context_id", "canvas_context_type"], name: "index_context_modules_on_context" t.index ["canvas_context_module_id"], name: "index_context_modules_on_canvas_context_module_id", unique: true end create_table "courses", force: :cascade do |t| t.bigint "canvas_course_id", null: false t.string "sis_id" t.string "short_name" t.string "long_name" t.string "status" t.integer "canvas_account_id" t.integer "canvas_term_id" t.integer "term_sis_id" t.datetime "start_date" t.datetime "end_date" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_course_id"], name: "index_courses_on_canvas_course_id", unique: true end create_table "enrollments", force: :cascade do |t| t.bigint "canvas_enrollment_id", null: false t.bigint "canvas_course_id" t.string "course_sis_id" t.bigint "canvas_user_id" t.string "user_sis_id" t.string "role" t.integer "role_id" t.bigint "canvas_section_id" t.string "section_sis_id" t.string "status" t.string "base_role_type" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_course_id"], name: "index_enrollments_on_canvas_course_id" t.index ["canvas_enrollment_id"], name: "index_enrollments_on_canvas_enrollment_id", unique: true t.index ["canvas_user_id"], name: "index_enrollments_on_canvas_user_id" end create_table "roles", force: :cascade do |t| t.integer "canvas_role_id", null: false t.string "label", null: false t.string "base_role_type", null: false t.json "account" t.string "workflow_state", null: false t.json "permissions" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_role_id"], name: "index_roles_on_canvas_role_id", unique: true end create_table "sections", force: :cascade do |t| t.bigint "canvas_section_id", null: false t.string "sis_id" t.bigint "canvas_course_id" t.bigint "canvas_nonxlist_course_id" t.string "name" t.string "status" t.datetime "start_date" t.datetime "end_date" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_course_id"], name: "index_sections_on_canvas_course_id" t.index ["canvas_section_id"], name: "index_sections_on_canvas_section_id", unique: true end create_table "submissions", force: :cascade do |t| t.bigint "canvas_submission_id", null: false t.bigint "canvas_course_id" t.bigint "canvas_assignment_id" t.bigint "canvas_user_id" t.datetime "submitted_at" t.datetime "graded_at" t.integer "score" t.integer "points_possible" t.boolean "excused" t.string "workflow_state" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_assignment_id"], name: "index_submissions_on_canvas_assignment_id" t.index ["canvas_course_id"], name: "index_submissions_on_canvas_course_id" t.index ["canvas_submission_id"], name: "index_submissions_on_canvas_submission_id", unique: true t.index ["canvas_user_id"], name: "index_submissions_on_canvas_user_id" end create_table "terms", force: :cascade do |t| t.integer "canvas_term_id", null: false t.string "name" t.datetime "start_at" t.datetime "end_at" t.string "workflow_state" t.integer "grading_period_group_id" t.string "sis_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_term_id"], name: "index_terms_on_canvas_term_id", unique: true end create_table "users", force: :cascade do |t| t.bigint "canvas_user_id", null: false t.string "sis_id" t.string "email" t.string "first_name" t.string "last_name" t.string "status" t.string "login_id" t.string "full_name" t.string "sortable_name" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_user_id"], name: "index_users_on_canvas_user_id", unique: true end end