lecture-attendance-manager/db/schema.rb
Joshua Coles 58c1280309 Update Lecture-Recording relationship and add Lecture cancellation status
The commit introduces notable changes to the Lecture-Recording model relationship in our application and adds a new cancellation status to Lecture model.

Models Lecture and Recording previously had a belongs_to :recording and belongs_to :lecture relationship respectively. However, this setup was not reflecting the correct relationship between these two entities in the actual educational setup where a lecture can have a recording but a recording is always of a lecture. Thus, the relationship has been revised to has_one :recording in Lecture and belongs_to :lecture in Recording models.

Also, added the ability to mark a lecture as "cancelled". This addresses the requirement of representing real-world scenarios where lectures are sometimes cancelled. This cancellation status is then reflected in the Attendance Tracker view and is also handled in the ScrapePanoptoJob.

Additionally, new changes are reflected in the application's schema, migration files, admin dashboard, and stylesheets (for displaying cancelled lectures).
2023-10-02 09:47:46 +01:00

63 lines
2.4 KiB
Ruby
Generated

# 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.0].define(version: 2023_10_02_083755) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "attendances", force: :cascade do |t|
t.bigint "lecture_id", null: false
t.string "associated_toggl_entry"
t.integer "kind"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["lecture_id"], name: "index_attendances_on_lecture_id"
end
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"
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.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
add_foreign_key "attendances", "lectures"
add_foreign_key "recordings", "courses"
end