# 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. # # This file is the source Rails uses to define your schema when running `bin/rails # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to # be faster and is potentially less error prone than running all of your # migrations from scratch. Old migrations may fail to apply correctly if those # migrations use external dependencies or application code. # # It's strongly recommended that you check this file into your version control system. ActiveRecord::Schema[7.1].define(version: 2024_02_07_101411) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" create_table "courses", force: :cascade do |t| t.string "title" t.string "unit_code" t.integer "toggl_project" t.jsonb "panopto_folders" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.date "semester_start_date", default: "2023-10-02" t.string "homepage" t.boolean "archived", default: false, null: false t.string "default_live_video_url" t.index ["toggl_project"], name: "index_courses_on_toggl_project", unique: true t.index ["unit_code"], name: "index_courses_on_unit_code", unique: true end create_table "good_job_batches", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.datetime "created_at", null: false t.datetime "updated_at", null: false t.text "description" t.jsonb "serialized_properties" t.text "on_finish" t.text "on_success" t.text "on_discard" t.text "callback_queue_name" t.integer "callback_priority" t.datetime "enqueued_at" t.datetime "discarded_at" t.datetime "finished_at" end create_table "good_job_executions", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.datetime "created_at", null: false t.datetime "updated_at", null: false t.uuid "active_job_id", null: false t.text "job_class" t.text "queue_name" t.jsonb "serialized_params" t.datetime "scheduled_at" t.datetime "finished_at" t.text "error" t.integer "error_event", limit: 2 t.index ["active_job_id", "created_at"], name: "index_good_job_executions_on_active_job_id_and_created_at" end create_table "good_job_processes", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.datetime "created_at", null: false t.datetime "updated_at", null: false t.jsonb "state" end create_table "good_job_settings", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.datetime "created_at", null: false t.datetime "updated_at", null: false t.text "key" t.jsonb "value" t.index ["key"], name: "index_good_job_settings_on_key", unique: true end create_table "good_jobs", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.text "queue_name" t.integer "priority" t.jsonb "serialized_params" t.datetime "scheduled_at" t.datetime "performed_at" t.datetime "finished_at" t.text "error" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.uuid "active_job_id" t.text "concurrency_key" t.text "cron_key" t.uuid "retried_good_job_id" t.datetime "cron_at" t.uuid "batch_id" t.uuid "batch_callback_id" t.boolean "is_discrete" t.integer "executions_count" t.text "job_class" t.integer "error_event", limit: 2 t.text "labels", array: true t.index ["active_job_id", "created_at"], name: "index_good_jobs_on_active_job_id_and_created_at" t.index ["batch_callback_id"], name: "index_good_jobs_on_batch_callback_id", where: "(batch_callback_id IS NOT NULL)" t.index ["batch_id"], name: "index_good_jobs_on_batch_id", where: "(batch_id IS NOT NULL)" t.index ["concurrency_key"], name: "index_good_jobs_on_concurrency_key_when_unfinished", where: "(finished_at IS NULL)" t.index ["cron_key", "created_at"], name: "index_good_jobs_on_cron_key_and_created_at_cond", where: "(cron_key IS NOT NULL)" t.index ["cron_key", "cron_at"], name: "index_good_jobs_on_cron_key_and_cron_at_cond", unique: true, where: "(cron_key IS NOT NULL)" t.index ["finished_at"], name: "index_good_jobs_jobs_on_finished_at", where: "((retried_good_job_id IS NULL) AND (finished_at IS NOT NULL))" t.index ["labels"], name: "index_good_jobs_on_labels", where: "(labels IS NOT NULL)", using: :gin t.index ["priority", "created_at"], name: "index_good_job_jobs_for_candidate_lookup", where: "(finished_at IS NULL)" t.index ["priority", "created_at"], name: "index_good_jobs_jobs_on_priority_created_at_when_unfinished", order: { priority: "DESC NULLS LAST" }, where: "(finished_at IS NULL)" t.index ["queue_name", "scheduled_at"], name: "index_good_jobs_on_queue_name_and_scheduled_at", where: "(finished_at IS NULL)" t.index ["scheduled_at"], name: "index_good_jobs_on_scheduled_at", where: "(finished_at IS NULL)" end create_table "lectures", force: :cascade do |t| t.string "title", null: false t.datetime "start_time", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.bigint "course_id" t.string "event_uuid" t.boolean "cancelled", default: false t.integer "kind", default: 0 t.boolean "online", default: false, null: false t.string "live_video_url" t.index ["course_id"], name: "index_lectures_on_course_id" end create_table "recordings", force: :cascade do |t| t.string "title", null: false t.datetime "start_time", null: false t.string "recording_uuid", null: false t.bigint "course_id", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.bigint "lecture_id" t.index ["course_id"], name: "index_recordings_on_course_id" t.index ["lecture_id"], name: "index_recordings_on_lecture_id" t.index ["recording_uuid"], name: "index_recordings_on_recording_uuid", unique: true end create_table "tracked_time_entries", force: :cascade do |t| t.integer "kind" t.jsonb "toggl_data" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.bigint "associated_toggl_entry_id", null: false t.string "subject_type", null: false t.bigint "subject_id", null: false t.index ["associated_toggl_entry_id"], name: "index_tracked_time_entries_on_associated_toggl_entry_id", unique: true t.index ["subject_type", "subject_id"], name: "index_tracked_time_entries_on_subject" end create_table "work_items", force: :cascade do |t| t.string "title", null: false t.bigint "course_id", null: false t.datetime "due_at", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.datetime "available_from" t.datetime "completed_at" t.string "document_link" t.index ["course_id"], name: "index_work_items_on_course_id" end add_foreign_key "recordings", "courses" add_foreign_key "work_items", "courses" end