# 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: 2022_09_26_221926) 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_id", null: false t.string "sis_id" t.bigint "canvas_parent_account_id" t.string "sis_parent_account_id" t.string "name" t.string "workflow_state" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_id"], name: "index_accounts_on_canvas_id", unique: true end create_table "admins", force: :cascade do |t| t.bigint "canvas_id", null: false t.string "role_name" t.bigint "canvas_account_id" t.bigint "canvas_role_id" t.bigint "canvas_user_id" t.string "workflow_state" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_account_id"], name: "index_admins_on_canvas_account_id" t.index ["canvas_id"], name: "index_admins_on_canvas_id", unique: true t.index ["canvas_role_id"], name: "index_admins_on_canvas_role_id" t.index ["canvas_user_id"], name: "index_admins_on_canvas_user_id" end create_table "assignment_groups", force: :cascade do |t| t.bigint "canvas_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_course_id"], name: "index_assignment_groups_on_canvas_course_id" t.index ["canvas_id"], name: "index_assignment_groups_on_canvas_id", unique: true end create_table "assignments", force: :cascade do |t| t.bigint "canvas_id", null: false t.string "title" t.text "description" t.datetime "due_at" t.datetime "unlock_at" t.datetime "lock_at" t.float "points_possible" t.float "min_score" t.float "max_score" t.float "mastery_score" t.string "grading_type" t.string "submission_types" t.string "workflow_state" t.integer "canvas_context_id" t.string "canvas_context_type" t.integer "canvas_assignment_group_id" t.integer "canvas_grading_scheme_id" t.integer "canvas_grading_standard_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_context_id", "canvas_context_type"], name: "index_assignments_on_canvas_context_id_and_canvas_context_type" t.index ["canvas_id"], name: "index_assignments_on_canvas_id", unique: true end create_table "canvas_sync_job_logs", id: :serial, 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" t.datetime "updated_at" t.string "job_id" t.integer "fork_count" t.index ["job_id"], name: "index_canvas_sync_job_logs_on_job_id" end create_table "canvas_sync_sync_batches", id: :serial, force: :cascade do |t| t.datetime "started_at" t.datetime "completed_at" t.string "status" t.datetime "created_at" t.datetime "updated_at" t.boolean "full_sync", default: false t.string "batch_genre" t.string "batch_bid" end create_table "content_migrations", force: :cascade do |t| t.bigint "canvas_id" t.bigint "canvas_context_id" t.string "canvas_context_type" t.string "workflow_state" t.text "migration_settings" t.datetime "started_at" t.datetime "finished_at" t.float "progress" t.bigint "canvas_source_course_id" t.string "migration_type" t.bigint "canvas_child_subscription_id" t.bigint "canvas_root_account_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_id"], name: "index_content_migrations_on_canvas_id", unique: true end create_table "context_module_items", force: :cascade do |t| t.bigint "canvas_id" t.bigint "canvas_context_module_id" t.integer "position" t.bigint "canvas_content_id" t.string "canvas_content_type" 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_id"], name: "index_context_module_items_on_canvas_id", unique: true end create_table "context_modules", force: :cascade do |t| t.bigint "canvas_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_id"], name: "index_context_modules_on_canvas_id", unique: true end create_table "courses", force: :cascade do |t| t.bigint "canvas_id", null: false t.string "sis_id" t.string "course_code" t.string "name" t.string "workflow_state" t.integer "canvas_account_id" t.integer "canvas_term_id" t.datetime "start_at" t.datetime "end_at" t.bigint "grading_standard_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_id"], name: "index_courses_on_canvas_id", unique: true end create_table "enrollments", force: :cascade do |t| t.bigint "canvas_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 "canvas_role_id" t.bigint "canvas_section_id" t.string "workflow_state" 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_id"], name: "index_enrollments_on_canvas_id", unique: true t.index ["canvas_user_id"], name: "index_enrollments_on_canvas_user_id" end create_table "grading_period_groups", force: :cascade do |t| t.bigint "canvas_id", null: false t.string "title" t.boolean "weighted" t.boolean "display_totals_for_all_grading_periods" t.string "workflow_state" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_id"], name: "index_grading_period_groups_on_canvas_id", unique: true end create_table "grading_periods", force: :cascade do |t| t.bigint "canvas_id", null: false t.string "title" t.float "weight" t.datetime "start_date" t.datetime "end_date" t.datetime "close_date" t.bigint "canvas_grading_period_group_id" t.string "workflow_state" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_grading_period_group_id"], name: "index_grading_periods_on_canvas_grading_period_group_id" t.index ["canvas_id"], name: "index_grading_periods_on_canvas_id", unique: true end create_table "group_memberships", force: :cascade do |t| t.bigint "canvas_id", null: false t.bigint "canvas_user_id", null: false t.bigint "canvas_group_id", null: false t.string "group_sis_id" t.string "user_sis_id" t.string "workflow_state" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_id"], name: "index_group_memberships_on_canvas_id", unique: true end create_table "groups", force: :cascade do |t| t.bigint "canvas_id", null: false t.string "sis_id" t.bigint "canvas_group_category_id" t.string "group_category_sis_id" t.bigint "canvas_account_id" t.bigint "canvas_course_id" t.string "name" t.string "workflow_state" t.bigint "context_id" t.string "context_type" t.integer "max_membership" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_id"], name: "index_groups_on_canvas_id", unique: true end create_table "learning_outcomes", force: :cascade do |t| t.bigint "canvas_id", null: false t.integer "canvas_context_id" t.string "canvas_context_type" t.string "name" t.string "friendly_name" t.string "workflow_state" t.datetime "canvas_created_at" t.datetime "canvas_updated_at" t.string "migration_id" t.string "vendor_guid" t.string "low_grade" t.string "high_grade" t.string "calculation_method" t.string "calculation_int" t.integer "outcome_import_id" t.integer "root_account_ids", default: [], array: true t.text "description" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_context_id", "canvas_context_type"], name: "index_learning_outcomes_on_context" t.index ["canvas_id"], name: "index_learning_outcomes_on_canvas_id", unique: true end create_table "pseudonyms", force: :cascade do |t| t.bigint "canvas_id", null: false t.bigint "canvas_user_id" t.string "sis_id" t.string "unique_id" t.string "workflow_state" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_id"], name: "index_pseudonyms_on_canvas_id", unique: true t.index ["canvas_user_id"], name: "index_pseudonyms_on_canvas_user_id" end create_table "roles", force: :cascade do |t| t.integer "canvas_id", null: false t.string "label" t.string "base_role_type" t.integer "canvas_account_id" t.string "workflow_state" t.json "permissions" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_account_id"], name: "index_roles_on_canvas_account_id" t.index ["canvas_id"], name: "index_roles_on_canvas_id", unique: true end create_table "sections", force: :cascade do |t| t.bigint "canvas_id", null: false t.string "sis_id" t.bigint "canvas_course_id" t.bigint "canvas_nonxlist_course_id" t.string "name" t.string "workflow_state" t.datetime "start_at" t.datetime "end_at" 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_id"], name: "index_sections_on_canvas_id", unique: true end create_table "submissions", force: :cascade do |t| t.bigint "canvas_id", null: false t.bigint "canvas_course_id" t.bigint "canvas_assignment_id" t.bigint "canvas_user_id" t.datetime "submitted_at" t.datetime "due_at" t.datetime "graded_at" t.float "score" t.float "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_id"], name: "index_submissions_on_canvas_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_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_id"], name: "index_terms_on_canvas_id", unique: true end create_table "user_observers", force: :cascade do |t| t.bigint "observing_user_id" t.bigint "observed_user_id" t.string "workflow_state" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["observed_user_id", "observing_user_id"], name: "index_user_observers_on_observed_user_id_and_observing_user_id", unique: true t.index ["observed_user_id"], name: "index_user_observers_on_observed_user_id" t.index ["observing_user_id"], name: "index_user_observers_on_observing_user_id" end create_table "users", force: :cascade do |t| t.bigint "canvas_id", null: false t.string "email" t.string "first_name" t.string "last_name" t.string "workflow_state" t.string "login_id" t.string "name" t.string "sortable_name" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["canvas_id"], name: "index_users_on_canvas_id", unique: true end end