AAttendrix Docsv1.0
Database
ReferenceImplemented

Database Tables & Schemas

Authoritative catalog and schema specifications for all 56 Attendrix PostgreSQL tables.

Database Tables & Schemas

Attendrix is backed by a relational PostgreSQL 17 database hosted on Supabase in AWS ap-south-1 (Mumbai). The database enforces strict referential integrity, statement-level audit logging, and Row-Level Security (RLS) across all tenant boundaries.

DATABASE STORAGE INVARIANT
INV-SEC-01

No tenant may query or mutate records outside their auth.uid() scope, except via audited SECURITY DEFINER functions that explicitly enforce role validation.

Architectural Organization

The Attendrix database comprises 56 application domain tables organized into 6 core functional subsystems:

  1. Core Academic & Timetable (15 tables)
  2. Attendance, Identity & Gamification (11 tables)
  3. Google Calendar Synchronization Pipeline (6 tables)
  4. Campus Pedestrian Routing & Transit (13 tables)
  5. Push Notifications & Student Tasks (8 tables)
  6. Audit & Governance (3 tables)

Core Academic & Timetable

Defines institutional structure, semesters, departments, courses, batch curricula, and scheduled lecture occurrences.

classes

Primary Key: class_id

Foreign Key Constraints:

  • batch_idbatches.batch_id (classes_batch_id_fkey)
  • semester_idsemesters.semester_id (classes_semester_id_fkey)
  • venuecampus_buildings.id (fk_classes_venue)
Field / PropTypeDefaultDescription
class_idrequired
uuidgen_random_uuid()**Primary Key**.
class_refrequired
textColumn `class_ref` stored as `text`.
batch_idrequired
textForeign key referencing `batches.batch_id`.
semester_idrequired
uuidForeign key referencing `semesters.semester_id`.
scheduled_startrequired
timestamp with time zonePostgreSQL UDT: `timestamptz`.
scheduled_endrequired
timestamp with time zonePostgreSQL UDT: `timestamptz`.
venue
textForeign key referencing `campus_buildings.id`.
is_plus_slotrequired
booleanfalsePostgreSQL UDT: `bool`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
course_idrequired
textColumn `course_id` stored as `text`.
is_extra_classrequired
booleanfalsePostgreSQL UDT: `bool`.
scheduled_daterequired
textColumn `scheduled_date` stored as `text`.
is_cancelledrequired
booleanfalsePostgreSQL UDT: `bool`.
cancelled_at
timestamp with time zonePostgreSQL UDT: `timestamptz`.
cancellation_reason
textColumn `cancellation_reason` stored as `text`.

courses

Primary Key: course_code

Foreign Key Constraints:

  • department_iddepartments.department_id (courses_department_id_fkey)
Field / PropTypeDefaultDescription
course_coderequired
text**Primary Key**.
course_namerequired
textColumn `course_name` stored as `text`.
course_type_coderequired
USER-DEFINEDPostgreSQL UDT: `course_type_code`.
is_labrequired
booleanfalsePostgreSQL UDT: `bool`.
creditsrequired
smallintPostgreSQL UDT: `int2`.
department_idrequired
textForeign key referencing `departments.department_id`.
is_activerequired
booleantruePostgreSQL UDT: `bool`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
syllabus_url
textColumn `syllabus_url` stored as `text`.

batch_courses

Primary Key: course_slot, batch_id, course_code

Foreign Key Constraints:

  • batch_idbatches.batch_id (batch_courses_batch_id_fkey)
  • course_codecourses.course_code (batch_courses_course_code_fkey)
  • venuecampus_buildings.id (fk_batch_courses_venue)
Field / PropTypeDefaultDescription
offering_idrequired
uuidgen_random_uuid()Column `offering_id` stored as `uuid`.
batch_idrequired
text**Primary Key**. Foreign key referencing `batches.batch_id`.
course_coderequired
text**Primary Key**. Foreign key referencing `courses.course_code`.
course_slotrequired
text**Primary Key**.
course_id
textColumn `course_id` stored as `text`.
is_mandatoryrequired
booleantruePostgreSQL UDT: `bool`.
added_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
enrolled_student_countrequired
integer0PostgreSQL UDT: `int4`.
venue
textForeign key referencing `campus_buildings.id`.

batches

Primary Key: batch_id

Foreign Key Constraints:

  • department_iddepartments.department_id (batches_department_id_fkey)
Field / PropTypeDefaultDescription
batch_idrequired
text**Primary Key**.
department_idrequired
textForeign key referencing `departments.department_id`.
batch_numberrequired
smallintPostgreSQL UDT: `int2`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
department_namerequired
textColumn `department_name` stored as `text`.
is_activerequired
booleantruePostgreSQL UDT: `bool`.

semesters

Primary Key: semester_id

Field / PropTypeDefaultDescription
semester_idrequired
uuidgen_random_uuid()**Primary Key**.
semester_namerequired
textColumn `semester_name` stored as `text`.
start_daterequired
dateColumn `start_date` stored as `date`.
end_daterequired
dateColumn `end_date` stored as `date`.
is_activerequired
booleanfalsePostgreSQL UDT: `bool`.
locked_at
timestamp with time zonePostgreSQL UDT: `timestamptz`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
semester_number
integerPostgreSQL UDT: `int4`.
semester_slot_system
smallintPostgreSQL UDT: `int2`.

departments

Primary Key: department_id

Field / PropTypeDefaultDescription
department_idrequired
text**Primary Key**.
department_namerequired
textColumn `department_name` stored as `text`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

slot_occurrences

Primary Key: slot_system, slot_name, day_of_week, period_number

Field / PropTypeDefaultDescription
slot_namerequired
text**Primary Key**.
slot_systemrequired
smallint**Primary Key**. PostgreSQL UDT: `int2`.
day_of_weekrequired
smallint**Primary Key**. PostgreSQL UDT: `int2`.
period_numberrequired
smallint**Primary Key**. PostgreSQL UDT: `int2`.
start_timerequired
time without time zonePostgreSQL UDT: `time`.
end_timerequired
time without time zonePostgreSQL UDT: `time`.
is_plus_slotrequired
booleanfalsePostgreSQL UDT: `bool`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
id
uuidgen_random_uuid()Column `id` stored as `uuid`.

course_meetings

Primary Key: id

Foreign Key Constraints:

  • batch_idbatches.batch_id (course_meetings_batch_id_fkey)
  • slot_occurrence_idslot_occurrences.id (course_meetings_slot_occurrence_id_fkey)
Field / PropTypeDefaultDescription
idrequired
uuidgen_random_uuid()**Primary Key**.
batch_idrequired
textForeign key referencing `batches.batch_id`.
course_idrequired
textColumn `course_id` stored as `text`.
slot_occurrence_idrequired
uuidForeign key referencing `slot_occurrences.id`.
is_primaryrequired
booleantruePostgreSQL UDT: `bool`.
venue_override
textColumn `venue_override` stored as `text`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

elective_courses

Primary Key: offering_id

Foreign Key Constraints:

  • course_codecourses.course_code (elective_courses_course_code_fkey)
  • department_iddepartments.department_id (elective_courses_department_id_fkey)
  • venuecampus_buildings.id (fk_elective_courses_venue)
Field / PropTypeDefaultDescription
offering_idrequired
uuidgen_random_uuid()**Primary Key**.
course_id
textColumn `course_id` stored as `text`.
course_coderequired
textForeign key referencing `courses.course_code`.
department_idrequired
textForeign key referencing `departments.department_id`.
slot_namerequired
textColumn `slot_name` stored as `text`.
slot_systemrequired
smallint1PostgreSQL UDT: `int2`.
venue
textForeign key referencing `campus_buildings.id`.
is_activerequired
booleantruePostgreSQL UDT: `bool`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
enrolled_student_countrequired
integer0PostgreSQL UDT: `int4`.

elective_offering_semesters

Primary Key: semester_number, offering_id

Foreign Key Constraints:

  • offering_idelective_courses.offering_id (elective_offering_semesters_offering_id_fkey)
Field / PropTypeDefaultDescription
offering_idrequired
uuid**Primary Key**. Foreign key referencing `elective_courses.offering_id`.
semester_numberrequired
smallint**Primary Key**. PostgreSQL UDT: `int2`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

department_semester_rules

Primary Key: rule_id

Foreign Key Constraints:

  • department_iddepartments.department_id (department_semester_rules_department_id_fkey)
Field / PropTypeDefaultDescription
rule_idrequired
uuidgen_random_uuid()**Primary Key**.
department_idrequired
textForeign key referencing `departments.department_id`.
semester_numberrequired
smallintPostgreSQL UDT: `int2`.
elective_categoryrequired
textColumn `elective_category` stored as `text`.
required_countrequired
smallintPostgreSQL UDT: `int2`.

course_syllabi

Primary Key: syllabus_id

Foreign Key Constraints:

  • course_codecourses.course_code (course_syllabi_course_code_fkey)
Field / PropTypeDefaultDescription
syllabus_idrequired
uuidgen_random_uuid()**Primary Key**.
course_coderequired
textForeign key referencing `courses.course_code`.
syllabus_pathrequired
textColumn `syllabus_path` stored as `text`.
created_atrequired
timestamp with time zonetimezone('utc'::text, now())PostgreSQL UDT: `timestamptz`.
prerequisites
textColumn `prerequisites` stored as `text`.
lecture_hours
smallintPostgreSQL UDT: `int2`.
tutorial_hours
smallintPostgreSQL UDT: `int2`.
practical_hours
smallintPostgreSQL UDT: `int2`.
outside_hours
smallintPostgreSQL UDT: `int2`.
lecture_sessions
smallintPostgreSQL UDT: `int2`.
course_outcomes
ARRAYPostgreSQL UDT: `_text`.
modules
jsonbColumn `modules` stored as `jsonb`.
textbooks
ARRAYPostgreSQL UDT: `_text`.
reference_list
ARRAYPostgreSQL UDT: `_text`.
raw_markdown
textColumn `raw_markdown` stored as `text`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
course_namerequired
textColumn `course_name` stored as `text`.

academic_calendar_events

Primary Key: event_id

Foreign Key Constraints:

  • semester_idsemesters.semester_id (academic_calendar_events_semester_id_fkey)
Field / PropTypeDefaultDescription
event_idrequired
uuidgen_random_uuid()**Primary Key**.
semester_idrequired
uuidForeign key referencing `semesters.semester_id`.
event_namerequired
textColumn `event_name` stored as `text`.
start_daterequired
dateColumn `start_date` stored as `date`.
end_daterequired
dateColumn `end_date` stored as `date`.
event_typerequired
textColumn `event_type` stored as `text`.
description
textColumn `description` stored as `text`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
follows_day
smallintPostgreSQL UDT: `int2`.
formatted_date
textColumn `formatted_date` stored as `text`.

academic_calendar_overrides

Primary Key: id

Foreign Key Constraints:

  • course_meeting_idcourse_meetings.id (academic_calendar_overrides_course_meeting_id_fkey)
Field / PropTypeDefaultDescription
idrequired
uuidgen_random_uuid()**Primary Key**.
override_daterequired
dateColumn `override_date` stored as `date`.
override_typerequired
textColumn `override_type` stored as `text`.
effective_day
smallintPostgreSQL UDT: `int2`.
course_id
textColumn `course_id` stored as `text`.
course_meeting_id
uuidForeign key referencing `course_meetings.id`.
override_start
time without time zonePostgreSQL UDT: `time`.
override_end
time without time zonePostgreSQL UDT: `time`.
override_venue
textColumn `override_venue` stored as `text`.
description
textColumn `description` stored as `text`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

class_cancellation_reports

Primary Key: report_id

Foreign Key Constraints:

  • class_idclasses.class_id (class_cancellation_reports_class_id_fkey)
Field / PropTypeDefaultDescription
report_idrequired
uuidgen_random_uuid()**Primary Key**.
class_idrequired
uuidForeign key referencing `classes.class_id`.
user_idrequired
uuidColumn `user_id` stored as `uuid`.
reported_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

Attendance, Identity & Gamification

Powers the inverted attendance ledger, student profiles, Amplix points economy, and automated streak/achievement milestones.

absences

Primary Key: absence_id

Foreign Key Constraints:

  • class_idclasses.class_id (absences_class_id_fkey)
Field / PropTypeDefaultDescription
absence_idrequired
uuidgen_random_uuid()**Primary Key**.
user_idrequired
uuidColumn `user_id` stored as `uuid`.
class_idrequired
uuidForeign key referencing `classes.class_id`.
marked_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
marked_by
uuidColumn `marked_by` stored as `uuid`.
sourcerequired
textColumn `source` stored as `text`.
reason
textColumn `reason` stored as `text`.

user_course_attendance_state

Primary Key: user_id, course_id

Foreign Key Constraints:

  • user_idusers.id (user_course_attendance_state_user_id_fkey)
Field / PropTypeDefaultDescription
user_idrequired
uuid**Primary Key**. Foreign key referencing `users.id`.
course_idrequired
text**Primary Key**.
staterequired
text'NORMAL'::textColumn `state` stored as `text`.
last_percentagerequired
numericColumn `last_percentage` stored as `numeric`.
updated_at
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

user_course_enrollments

Primary Key: id

Foreign Key Constraints:

  • user_idusers.id (user_course_enrollments_user_id_fkey)
Field / PropTypeDefaultDescription
idrequired
uuidgen_random_uuid()**Primary Key**.
user_idrequired
uuidForeign key referencing `users.id`.
course_idrequired
textColumn `course_id` stored as `text`.
enrolled_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

users

Primary Key: id

Foreign Key Constraints:

  • batch_idbatches.batch_id (users_batch_id_fkey)
  • department_iddepartments.department_id (users_department_id_fkey)
  • idnull.null (users_id_fkey)
Field / PropTypeDefaultDescription
idrequired
uuid**Primary Key**. Foreign key referencing `null.null`.
emailrequired
textColumn `email` stored as `text`.
full_namerequired
textColumn `full_name` stored as `text`.
rolerequired
USER-DEFINED'student'::user_rolePostgreSQL UDT: `user_role`.
avatar_url
textColumn `avatar_url` stored as `text`.
email_verifiedrequired
booleanfalsePostgreSQL UDT: `bool`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
username
textColumn `username` stored as `text`.
bio
textColumn `bio` stored as `text`.
department_id
textForeign key referencing `departments.department_id`.
batch_id
textForeign key referencing `batches.batch_id`.
current_semester
smallintPostgreSQL UDT: `int2`.
onboarding_completedrequired
booleanfalsePostgreSQL UDT: `bool`.
roll_number
textColumn `roll_number` stored as `text`.
amplix_balancerequired
integer0PostgreSQL UDT: `int4`.
current_streakrequired
integer0PostgreSQL UDT: `int4`.
highest_streakrequired
integer0PostgreSQL UDT: `int4`.
enrolled_coursesrequired
jsonb'[]'::jsonbColumn `enrolled_courses` stored as `jsonb`.
profile_updated_at
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
odometer
integer0PostgreSQL UDT: `int4`.

user_preferences

Primary Key: user_id

Foreign Key Constraints:

  • user_idusers.id (user_preferences_user_id_fkey)
Field / PropTypeDefaultDescription
user_idrequired
uuid**Primary Key**. Foreign key referencing `users.id`.
themerequired
text'system'::textColumn `theme` stored as `text`.
time_formatrequired
text'12h'::textColumn `time_format` stored as `text`.
timezonerequired
text'Asia/Kolkata'::textColumn `timezone` stored as `text`.
languagerequired
text'en'::textColumn `language` stored as `text`.
action_tonerequired
USER-DEFINED'direct'::action_tonePostgreSQL UDT: `action_tone`.
notifications_enabledrequired
booleantruePostgreSQL UDT: `bool`.
notif_class_reminderrequired
booleantruePostgreSQL UDT: `bool`.
notif_reminder_minutesrequired
smallint10PostgreSQL UDT: `int2`.
notif_class_cancelledrequired
booleantruePostgreSQL UDT: `bool`.
notif_class_rescheduledrequired
booleantruePostgreSQL UDT: `bool`.
notif_task_publishedrequired
booleantruePostgreSQL UDT: `bool`.
notif_task_due_soonrequired
booleantruePostgreSQL UDT: `bool`.
notif_exam_reminderrequired
booleantruePostgreSQL UDT: `bool`.
notif_daily_briefrequired
booleantruePostgreSQL UDT: `bool`.
notif_attendance_alertrequired
booleantruePostgreSQL UDT: `bool`.
notif_weekly_summaryrequired
booleantruePostgreSQL UDT: `bool`.
quiet_hours_enabledrequired
booleanfalsePostgreSQL UDT: `bool`.
quiet_hours_startrequired
time without time zone'22:00:00'::time without time zonePostgreSQL UDT: `time`.
quiet_hours_endrequired
time without time zone'07:00:00'::time without time zonePostgreSQL UDT: `time`.
attendance_thresholdrequired
smallint80PostgreSQL UDT: `int2`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
enable_apodrequired
booleantruePostgreSQL UDT: `bool`.
user_messrequired
text''::textColumn `user_mess` stored as `text`.
at_a_glance_viewrequired
booleantruePostgreSQL UDT: `bool`.
use_scheduled_classes_for_greeting_messagerequired
booleantruePostgreSQL UDT: `bool`.
use_action_tone_for_greeting_messagerequired
booleantruePostgreSQL UDT: `bool`.
daily_brief_timerequired
time without time zone'07:00:00'::time without time zonePostgreSQL UDT: `time`.
notif_mess_reminderrequired
booleantruePostgreSQL UDT: `bool`.
notif_breakfast_reminderrequired
booleantruePostgreSQL UDT: `bool`.
notif_lunch_reminderrequired
booleantruePostgreSQL UDT: `bool`.
notif_evening_tea_reminderrequired
booleantruePostgreSQL UDT: `bool`.
notif_dinner_reminderrequired
booleantruePostgreSQL UDT: `bool`.
notif_mess_reminder_minutesrequired
smallint20PostgreSQL UDT: `int2`.

amplix_ledger

Primary Key: ledger_id

Foreign Key Constraints:

  • achievement_progress_idachievement_progress.achievement_progress_id (amplix_ledger_achievement_progress_id_fkey)
  • challenge_progress_idchallenge_progress.progress_id (amplix_ledger_challenge_progress_id_fkey)
  • class_idclasses.class_id (amplix_ledger_class_id_fkey)
Field / PropTypeDefaultDescription
ledger_idrequired
uuidgen_random_uuid()**Primary Key**.
user_idrequired
uuidColumn `user_id` stored as `uuid`.
event_typerequired
textColumn `event_type` stored as `text`.
pointsrequired
integerPostgreSQL UDT: `int4`.
balance_afterrequired
integerPostgreSQL UDT: `int4`.
class_id
uuidForeign key referencing `classes.class_id`.
event_daterequired
dateColumn `event_date` stored as `date`.
notes
textColumn `notes` stored as `text`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
achievement_progress_id
uuidForeign key referencing `achievement_progress.achievement_progress_id`.
challenge_progress_id
uuidForeign key referencing `challenge_progress.progress_id`.

achievement_templates

Primary Key: achievement_id

Field / PropTypeDefaultDescription
achievement_idrequired
text**Primary Key**.
achievement_namerequired
textColumn `achievement_name` stored as `text`.
achievement_descriptionrequired
textColumn `achievement_description` stored as `text`.
badge_icon
textColumn `badge_icon` stored as `text`.
achievement_conditionrequired
USER-DEFINEDPostgreSQL UDT: `achievement_condition`.
threshold_valuerequired
integerPostgreSQL UDT: `int4`.
amplix_rewardrequired
integer0PostgreSQL UDT: `int4`.
is_activerequired
booleantruePostgreSQL UDT: `bool`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

achievement_progress

Primary Key: achievement_progress_id

Foreign Key Constraints:

  • achievement_idachievement_templates.achievement_id (achievement_progress_achievement_id_fkey)
Field / PropTypeDefaultDescription
achievement_progress_idrequired
uuidgen_random_uuid()**Primary Key**.
student_idrequired
uuidColumn `student_id` stored as `uuid`.
achievement_idrequired
textForeign key referencing `achievement_templates.achievement_id`.
progressrequired
integer0PostgreSQL UDT: `int4`.
statusrequired
text'in_progress'::textColumn `status` stored as `text`.
claimed_at
timestamp with time zonePostgreSQL UDT: `timestamptz`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

challenge_templates

Primary Key: challenge_id

Field / PropTypeDefaultDescription
challenge_idrequired
text**Primary Key**.
challenge_namerequired
textColumn `challenge_name` stored as `text`.
challenge_descriptionrequired
textColumn `challenge_description` stored as `text`.
challenge_typerequired
USER-DEFINEDPostgreSQL UDT: `challenge_type`.
challenge_conditionrequired
USER-DEFINEDPostgreSQL UDT: `challenge_condition`.
condition_paramsrequired
jsonb'{}'::jsonbColumn `condition_params` stored as `jsonb`.
target_valuerequired
integerPostgreSQL UDT: `int4`.
amplix_rewardrequired
integer0PostgreSQL UDT: `int4`.
weekly_weightrequired
integer1PostgreSQL UDT: `int4`.
monthly_weightrequired
integer1PostgreSQL UDT: `int4`.
template_versionrequired
integer1PostgreSQL UDT: `int4`.
is_activerequired
booleantruePostgreSQL UDT: `bool`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

challenge_progress

Primary Key: progress_id

Foreign Key Constraints:

  • challenge_idchallenge_templates.challenge_id (challenge_progress_challenge_id_fkey)
  • semester_idsemesters.semester_id (challenge_progress_semester_id_fkey)
Field / PropTypeDefaultDescription
progress_idrequired
uuidgen_random_uuid()**Primary Key**.
user_idrequired
uuidColumn `user_id` stored as `uuid`.
challenge_idrequired
textForeign key referencing `challenge_templates.challenge_id`.
semester_idrequired
uuidForeign key referencing `semesters.semester_id`.
period_keyrequired
textColumn `period_key` stored as `text`.
template_versionrequired
integerPostgreSQL UDT: `int4`.
progressrequired
integer0PostgreSQL UDT: `int4`.
target_valuerequired
integerPostgreSQL UDT: `int4`.
amplix_rewardrequired
integerPostgreSQL UDT: `int4`.
statusrequired
text'pending'::textColumn `status` stored as `text`.
completed_at
timestamp with time zonePostgreSQL UDT: `timestamptz`.
claimed_at
timestamp with time zonePostgreSQL UDT: `timestamptz`.
expires_atrequired
timestamp with time zonePostgreSQL UDT: `timestamptz`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

challenge_progress_classes

Primary Key: progress_id, class_id

Foreign Key Constraints:

  • class_idclasses.class_id (challenge_progress_classes_class_id_fkey)
  • progress_idchallenge_progress.progress_id (challenge_progress_classes_progress_id_fkey)
Field / PropTypeDefaultDescription
progress_idrequired
uuid**Primary Key**. Foreign key referencing `challenge_progress.progress_id`.
class_idrequired
uuid**Primary Key**. Foreign key referencing `classes.class_id`.
contributed_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

Google Calendar Synchronization Pipeline

Implements statement-coalesced calendar synchronization, distributed lease management, and OAuth token encryption.

user_google_integrations

Primary Key: user_id

Field / PropTypeDefaultDescription
user_idrequired
uuid**Primary Key**.
google_emailrequired
textColumn `google_email` stored as `text`.
calendar_id
textColumn `calendar_id` stored as `text`.
calendar_color_id
text'7'::textColumn `calendar_color_id` stored as `text`.
is_sync_enabledrequired
booleantruePostgreSQL UDT: `bool`.
vault_secret_idrequired
uuidColumn `vault_secret_id` stored as `uuid`.
sync_statusrequired
text'pending_initial_sync'::textColumn `sync_status` stored as `text`.
last_synced_at
timestamp with time zonePostgreSQL UDT: `timestamptz`.
last_error
textColumn `last_error` stored as `text`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
sync_generationrequired
integer1PostgreSQL UDT: `int4`.

user_calendar_events

Primary Key: class_id, user_id

Foreign Key Constraints:

  • class_idclasses.class_id (user_calendar_events_class_id_fkey)
Field / PropTypeDefaultDescription
user_idrequired
uuid**Primary Key**.
class_idrequired
uuid**Primary Key**. Foreign key referencing `classes.class_id`.
google_event_idrequired
textColumn `google_event_id` stored as `text`.
sync_staterequired
text'synced'::textColumn `sync_state` stored as `text`.
synced_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
source_hash
textColumn `source_hash` stored as `text`.

gcal_sync_queue

Primary Key: job_id

Field / PropTypeDefaultDescription
job_idrequired
bigint**Primary Key**. PostgreSQL UDT: `int8`.
job_typerequired
textColumn `job_type` stored as `text`.
payloadrequired
jsonbColumn `payload` stored as `jsonb`.
statusrequired
text'pending'::textColumn `status` stored as `text`.
attemptsrequired
integer0PostgreSQL UDT: `int4`.
max_attemptsrequired
integer5PostgreSQL UDT: `int4`.
next_run_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
processing_started_at
timestamp with time zonePostgreSQL UDT: `timestamptz`.
worker_id
textColumn `worker_id` stored as `text`.
last_error
textColumn `last_error` stored as `text`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
completed_at
timestamp with time zonePostgreSQL UDT: `timestamptz`.

gcal_sync_pending

Primary Key: batch_id

Field / PropTypeDefaultDescription
batch_idrequired
text**Primary Key**.
sync_generationrequired
integer1PostgreSQL UDT: `int4`.
requested_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
locked_until
timestamp with time zonePostgreSQL UDT: `timestamptz`.

user_calendar_sync_leases

Primary Key: user_id

Foreign Key Constraints:

  • user_idusers.id (user_calendar_sync_leases_user_id_fkey)
Field / PropTypeDefaultDescription
user_idrequired
uuid**Primary Key**. Foreign key referencing `users.id`.
worker_idrequired
textColumn `worker_id` stored as `text`.
lease_expires_atrequired
timestamp with time zonePostgreSQL UDT: `timestamptz`.
updated_at
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

oauth_states

Primary Key: state

Field / PropTypeDefaultDescription
staterequired
text**Primary Key**.
user_idrequired
uuidColumn `user_id` stored as `uuid`.
pkce_verifier
text''::textColumn `pkce_verifier` stored as `text`.
expires_atrequired
timestamp with time zone(now() + '00:10:00'::interval)PostgreSQL UDT: `timestamptz`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
redirect_uri
textColumn `redirect_uri` stored as `text`.

Campus Pedestrian Routing & Transit

Contains the offline graph network, precomputed all-pairs shortest paths (152,904 pairs), real-time bus tracking, and dining menus.

campus_buildings

Primary Key: id

Field / PropTypeDefaultDescription
idrequired
text**Primary Key**.
namerequired
textColumn `name` stored as `text`.
category
textColumn `category` stored as `text`.
latrequired
double precisionPostgreSQL UDT: `float8`.
lngrequired
double precisionPostgreSQL UDT: `float8`.
nearest_node_idrequired
bigintPostgreSQL UDT: `int8`.
snap_dist_m
realPostgreSQL UDT: `float4`.
description
textColumn `description` stored as `text`.
created_at
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
lon
double precisionPostgreSQL UDT: `float8`.
amenity
textColumn `amenity` stored as `text`.
building_type
textColumn `building_type` stored as `text`.

graph_nodes

Primary Key: id

Field / PropTypeDefaultDescription
idrequired
bigint**Primary Key**. PostgreSQL UDT: `int8`.
latrequired
double precisionPostgreSQL UDT: `float8`.
lonrequired
double precisionPostgreSQL UDT: `float8`.
lng
double precisionPostgreSQL UDT: `float8`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

graph_edges

Primary Key: id

Foreign Key Constraints:

  • source_node_idgraph_nodes.id (graph_edges_source_node_id_fkey)
  • target_node_idgraph_nodes.id (graph_edges_target_node_id_fkey)
Field / PropTypeDefaultDescription
idrequired
bigint**Primary Key**. PostgreSQL UDT: `int8`.
source_node_idrequired
bigintForeign key referencing `graph_nodes.id`. PostgreSQL UDT: `int8`.
target_node_idrequired
bigintForeign key referencing `graph_nodes.id`. PostgreSQL UDT: `int8`.
distance_mrequired
double precisionPostgreSQL UDT: `float8`.
walk_secondsrequired
integerPostgreSQL UDT: `int4`.
is_bidirectionalrequired
booleantruePostgreSQL UDT: `bool`.
geometryrequired
jsonbColumn `geometry` stored as `jsonb`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

routing_dataset_versions

Primary Key: version

Field / PropTypeDefaultDescription
versionrequired
integer**Primary Key**. PostgreSQL UDT: `int4`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
published_at
timestamp with time zonePostgreSQL UDT: `timestamptz`.
node_countrequired
integerPostgreSQL UDT: `int4`.
route_countrequired
integerPostgreSQL UDT: `int4`.
tier1_observed_countrequired
integer0PostgreSQL UDT: `int4`.
tier2_edge_weight_countrequired
integer0PostgreSQL UDT: `int4`.
tier3_graph_dist_countrequired
integer0PostgreSQL UDT: `int4`.
tier4_fallback_countrequired
integer0PostgreSQL UDT: `int4`.
metadatarequired
jsonb'{}'::jsonbColumn `metadata` stored as `jsonb`.
is_activerequired
booleanfalsePostgreSQL UDT: `bool`.

routing_dataset_routes

Primary Key: origin_node_id, version, destination_node_id

Foreign Key Constraints:

  • destination_node_idgraph_nodes.id (routing_dataset_routes_destination_node_id_fkey)
  • origin_node_idgraph_nodes.id (routing_dataset_routes_origin_node_id_fkey)
  • versionrouting_dataset_versions.version (routing_dataset_routes_version_fkey)
Field / PropTypeDefaultDescription
versionrequired
integer**Primary Key**. Foreign key referencing `routing_dataset_versions.version`. PostgreSQL UDT: `int4`.
origin_node_idrequired
bigint**Primary Key**. Foreign key referencing `graph_nodes.id`. PostgreSQL UDT: `int8`.
destination_node_idrequired
bigint**Primary Key**. Foreign key referencing `graph_nodes.id`. PostgreSQL UDT: `int8`.
walk_secondsrequired
integerPostgreSQL UDT: `int4`.
distance_m
double precisionPostgreSQL UDT: `float8`.
sourcerequired
textColumn `source` stored as `text`.

observed_walking_trips

Primary Key: id

Foreign Key Constraints:

  • destination_node_idgraph_nodes.id (observed_walking_trips_destination_node_id_fkey)
  • origin_node_idgraph_nodes.id (observed_walking_trips_origin_node_id_fkey)
  • user_idusers.id (observed_walking_trips_user_id_fkey)
Field / PropTypeDefaultDescription
idrequired
uuidgen_random_uuid()**Primary Key**.
user_idrequired
uuidForeign key referencing `users.id`.
origin_node_idrequired
bigintForeign key referencing `graph_nodes.id`. PostgreSQL UDT: `int8`.
destination_node_idrequired
bigintForeign key referencing `graph_nodes.id`. PostgreSQL UDT: `int8`.
started_atrequired
timestamp with time zonePostgreSQL UDT: `timestamptz`.
arrived_atrequired
timestamp with time zonePostgreSQL UDT: `timestamptz`.
duration_secondsrequired
integerPostgreSQL UDT: `int4`.
distance_meters
double precisionPostgreSQL UDT: `float8`.
gps_fix_countrequired
integer0PostgreSQL UDT: `int4`.
avg_horizontal_accuracy_m
realPostgreSQL UDT: `float4`.
is_outlierrequired
booleanfalsePostgreSQL UDT: `bool`.
outlier_reason
textColumn `outlier_reason` stored as `text`.
device_metadata
jsonb'{}'::jsonbColumn `device_metadata` stored as `jsonb`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

route_cache

Primary Key: id

Foreign Key Constraints:

  • dest_building_idcampus_buildings.id (route_cache_dest_building_id_fkey)
  • origin_building_idcampus_buildings.id (route_cache_origin_building_id_fkey)
Field / PropTypeDefaultDescription
idrequired
uuidgen_random_uuid()**Primary Key**.
origin_building_id
textForeign key referencing `campus_buildings.id`.
dest_building_id
textForeign key referencing `campus_buildings.id`.
route_resultrequired
jsonbColumn `route_result` stored as `jsonb`.
distance_mrequired
double precisionPostgreSQL UDT: `float8`.
walk_secondsrequired
integerPostgreSQL UDT: `int4`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

route_statistics

Primary Key: origin_node_id, destination_node_id

Foreign Key Constraints:

  • destination_node_idgraph_nodes.id (route_statistics_destination_node_id_fkey)
  • origin_node_idgraph_nodes.id (route_statistics_origin_node_id_fkey)
Field / PropTypeDefaultDescription
origin_node_idrequired
bigint**Primary Key**. Foreign key referencing `graph_nodes.id`. PostgreSQL UDT: `int8`.
destination_node_idrequired
bigint**Primary Key**. Foreign key referencing `graph_nodes.id`. PostgreSQL UDT: `int8`.
sample_countrequired
integer0PostgreSQL UDT: `int4`.
p50_duration_secondsrequired
integerPostgreSQL UDT: `int4`.
p75_duration_secondsrequired
integerPostgreSQL UDT: `int4`.
p90_duration_seconds
integerPostgreSQL UDT: `int4`.
min_duration_seconds
integerPostgreSQL UDT: `int4`.
max_duration_seconds
integerPostgreSQL UDT: `int4`.
mean_duration_seconds
numericColumn `mean_duration_seconds` stored as `numeric`.
representative_distance_m
double precisionPostgreSQL UDT: `float8`.
last_observed_at
timestamp with time zonePostgreSQL UDT: `timestamptz`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

buses

Primary Key: bus_id

Field / PropTypeDefaultDescription
bus_idrequired
uuidgen_random_uuid()**Primary Key**.
route_namerequired
textColumn `route_name` stored as `text`.
stops_summaryrequired
textColumn `stops_summary` stored as `text`.
is_active
booleantruePostgreSQL UDT: `bool`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

bus_stops

Primary Key: id

Foreign Key Constraints:

  • nearest_node_idgraph_nodes.id (bus_stops_nearest_node_id_fkey)
Field / PropTypeDefaultDescription
idrequired
uuidgen_random_uuid()**Primary Key**.
stop_idrequired
textColumn `stop_id` stored as `text`.
namerequired
textColumn `name` stored as `text`.
latrequired
double precisionPostgreSQL UDT: `float8`.
lngrequired
double precisionPostgreSQL UDT: `float8`.
nearest_node_id
bigintForeign key referencing `graph_nodes.id`. PostgreSQL UDT: `int8`.
is_activerequired
booleantruePostgreSQL UDT: `bool`.
description
textColumn `description` stored as `text`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

bus_timings

Primary Key: timing_id

Foreign Key Constraints:

  • bus_idbuses.bus_id (bus_timings_bus_id_fkey)
Field / PropTypeDefaultDescription
timing_idrequired
uuidgen_random_uuid()**Primary Key**.
bus_id
uuidForeign key referencing `buses.bus_id`.
departure_timerequired
time without time zonePostgreSQL UDT: `time`.
is_special
booleanfalsePostgreSQL UDT: `bool`.
sort_orderrequired
integerPostgreSQL UDT: `int4`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

messes

Primary Key: mess_id

Field / PropTypeDefaultDescription
mess_idrequired
uuidgen_random_uuid()**Primary Key**.
namerequired
textColumn `name` stored as `text`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

mess_menu

Primary Key: menu_id

Foreign Key Constraints:

  • mess_idmesses.mess_id (mess_menu_mess_id_fkey)
Field / PropTypeDefaultDescription
menu_idrequired
uuidgen_random_uuid()**Primary Key**.
mess_id
uuidForeign key referencing `messes.mess_id`.
weekdayrequired
smallintPostgreSQL UDT: `int2`.
mealrequired
textColumn `meal` stored as `text`.
menurequired
textColumn `menu` stored as `text`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

Push Notifications & Student Tasks

OneSignal push notification queues, dispatch logs, academic assignment trackers, and NASA APOD media caching.

notification_devices

Primary Key: device_id

Field / PropTypeDefaultDescription
device_idrequired
uuidgen_random_uuid()**Primary Key**.
user_idrequired
uuidColumn `user_id` stored as `uuid`.
onesignal_subscription_idrequired
textColumn `onesignal_subscription_id` stored as `text`.
platformrequired
textColumn `platform` stored as `text`.
app_version
textColumn `app_version` stored as `text`.
device_model
textColumn `device_model` stored as `text`.
is_activerequired
booleantruePostgreSQL UDT: `bool`.
last_seen_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
registered_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
deactivated_at
timestamp with time zonePostgreSQL UDT: `timestamptz`.

notification_queue

Primary Key: job_id

Foreign Key Constraints:

  • recipient_batch_idbatches.batch_id (notification_queue_recipient_batch_id_fkey)
Field / PropTypeDefaultDescription
job_idrequired
bigint**Primary Key**. PostgreSQL UDT: `int8`.
notification_typerequired
textColumn `notification_type` stored as `text`.
recipient_user_id
uuidColumn `recipient_user_id` stored as `uuid`.
recipient_batch_id
textForeign key referencing `batches.batch_id`.
course_id
textColumn `course_id` stored as `text`.
payloadrequired
jsonb'{}'::jsonbColumn `payload` stored as `jsonb`.
dedup_key
textColumn `dedup_key` stored as `text`.
statusrequired
text'pending'::textColumn `status` stored as `text`.
attemptsrequired
integer0PostgreSQL UDT: `int4`.
max_attemptsrequired
integer3PostgreSQL UDT: `int4`.
scheduled_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
processing_started_at
timestamp with time zonePostgreSQL UDT: `timestamptz`.
worker_id
textColumn `worker_id` stored as `text`.
sent_at
timestamp with time zonePostgreSQL UDT: `timestamptz`.
last_error
textColumn `last_error` stored as `text`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
dedup_key_checked
booleanfalsePostgreSQL UDT: `bool`.
next_retry_at
timestamp with time zonePostgreSQL UDT: `timestamptz`.

notification_log

Primary Key: log_id

Foreign Key Constraints:

  • related_class_idclasses.class_id (notification_log_related_class_id_fkey)
  • related_task_idtasks.task_id (notification_log_related_task_id_fkey)
Field / PropTypeDefaultDescription
log_idrequired
uuidgen_random_uuid()**Primary Key**.
user_idrequired
uuidColumn `user_id` stored as `uuid`.
notification_typerequired
textColumn `notification_type` stored as `text`.
titlerequired
textColumn `title` stored as `text`.
bodyrequired
textColumn `body` stored as `text`.
datarequired
jsonb'{}'::jsonbColumn `data` stored as `jsonb`.
onesignal_id
textColumn `onesignal_id` stored as `text`.
is_readrequired
booleanfalsePostgreSQL UDT: `bool`.
read_at
timestamp with time zonePostgreSQL UDT: `timestamptz`.
sent_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
related_class_id
uuidForeign key referencing `classes.class_id`.
related_task_id
uuidForeign key referencing `tasks.task_id`.
dedup_key
textColumn `dedup_key` stored as `text`.
delivery_status
text'sent'::textColumn `delivery_status` stored as `text`.
onesignal_recipients
integer0PostgreSQL UDT: `int4`.

notification_daily_stats

Primary Key: None

Field / PropTypeDefaultDescription
stat_date
dateColumn `stat_date` stored as `date`.
notification_type
textColumn `notification_type` stored as `text`.
delivery_status
textColumn `delivery_status` stored as `text`.
total_jobs
bigintPostgreSQL UDT: `int8`.
total_recipients
bigintPostgreSQL UDT: `int8`.

tasks

Primary Key: task_id

Foreign Key Constraints:

  • batch_idbatches.batch_id (tasks_batch_id_fkey)
  • course_codecourses.course_code (tasks_course_code_fkey)
  • semester_idsemesters.semester_id (tasks_semester_id_fkey)
Field / PropTypeDefaultDescription
task_idrequired
uuidgen_random_uuid()**Primary Key**.
semester_idrequired
uuidForeign key referencing `semesters.semester_id`.
batch_id
textForeign key referencing `batches.batch_id`.
task_typerequired
textColumn `task_type` stored as `text`.
titlerequired
textColumn `title` stored as `text`.
description
textColumn `description` stored as `text`.
due_date
timestamp with time zonePostgreSQL UDT: `timestamptz`.
exam_start
timestamp with time zonePostgreSQL UDT: `timestamptz`.
exam_end
timestamp with time zonePostgreSQL UDT: `timestamptz`.
venue
textColumn `venue` stored as `text`.
max_score
numericColumn `max_score` stored as `numeric`.
attachmentsrequired
jsonb'[]'::jsonbColumn `attachments` stored as `jsonb`.
is_visiblerequired
booleantruePostgreSQL UDT: `bool`.
created_byrequired
uuidColumn `created_by` stored as `uuid`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
course_coderequired
textForeign key referencing `courses.course_code`.

student_task_records

Primary Key: record_id

Foreign Key Constraints:

  • task_idtasks.task_id (student_task_records_task_id_fkey)
Field / PropTypeDefaultDescription
record_idrequired
uuidgen_random_uuid()**Primary Key**.
user_idrequired
uuidColumn `user_id` stored as `uuid`.
task_idrequired
uuidForeign key referencing `tasks.task_id`.
statusrequired
text'pending'::textColumn `status` stored as `text`.
obtained_marks
numericColumn `obtained_marks` stored as `numeric`.
personal_note
textColumn `personal_note` stored as `text`.
marked_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

app_version_control

Primary Key: version_id

Field / PropTypeDefaultDescription
version_idrequired
uuidgen_random_uuid()**Primary Key**.
current_versionrequired
textColumn `current_version` stored as `text`.
build_numberrequired
bigintPostgreSQL UDT: `int8`.
version_download_link
textColumn `version_download_link` stored as `text`.
is_web_availablerequired
booleanfalsePostgreSQL UDT: `bool`.
force_updaterequired
booleanfalsePostgreSQL UDT: `bool`.
is_currentrequired
booleanfalsePostgreSQL UDT: `bool`.
release_notes
textColumn `release_notes` stored as `text`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
updated_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

apod

Primary Key: apod_date

Field / PropTypeDefaultDescription
apod_daterequired
date**Primary Key**.
titlerequired
textColumn `title` stored as `text`.
descriptionrequired
textColumn `description` stored as `text`.
image_url
textColumn `image_url` stored as `text`.
hd_image_url
textColumn `hd_image_url` stored as `text`.
media_typerequired
text'image'::textColumn `media_type` stored as `text`.
fetched_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
blur_hash
textColumn `blur_hash` stored as `text`.

Audit & Governance

Immutable system logs tracking administrative actions, timetable regenerations, and Row-Level Security policy execution.

admin_audit_log

Primary Key: log_id

Foreign Key Constraints:

  • semester_idsemesters.semester_id (admin_audit_log_semester_id_fkey)
Field / PropTypeDefaultDescription
log_idrequired
uuidgen_random_uuid()**Primary Key**.
admin_idrequired
uuidColumn `admin_id` stored as `uuid`.
action_typerequired
textColumn `action_type` stored as `text`.
target_tablerequired
textColumn `target_table` stored as `text`.
target_idrequired
textColumn `target_id` stored as `text`.
before_state
jsonbColumn `before_state` stored as `jsonb`.
after_state
jsonbColumn `after_state` stored as `jsonb`.
semester_id
uuidForeign key referencing `semesters.semester_id`.
performed_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

audit_log

Primary Key: audit_id

Field / PropTypeDefaultDescription
audit_idrequired
bigint**Primary Key**. PostgreSQL UDT: `int8`.
table_namerequired
textColumn `table_name` stored as `text`.
operationrequired
textColumn `operation` stored as `text`.
actor_id
uuidColumn `actor_id` stored as `uuid`.
row_pk
textColumn `row_pk` stored as `text`.
old_data
jsonbColumn `old_data` stored as `jsonb`.
new_data
jsonbColumn `new_data` stored as `jsonb`.
created_atrequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.

scheduling_audit_log

Primary Key: log_id

Foreign Key Constraints:

  • batch_idbatches.batch_id (scheduling_audit_log_batch_id_fkey)
  • class_idclasses.class_id (scheduling_audit_log_class_id_fkey)
  • course_codecourses.course_code (scheduling_audit_log_course_code_fkey)
  • semester_idsemesters.semester_id (scheduling_audit_log_semester_id_fkey)
Field / PropTypeDefaultDescription
log_idrequired
uuidgen_random_uuid()**Primary Key**.
run_idrequired
uuidColumn `run_id` stored as `uuid`.
semester_id
uuidForeign key referencing `semesters.semester_id`.
batch_id
textForeign key referencing `batches.batch_id`.
execution_timerequired
timestamp with time zonenow()PostgreSQL UDT: `timestamptz`.
actionrequired
textColumn `action` stored as `text`.
class_id
uuidForeign key referencing `classes.class_id`.
reason
textColumn `reason` stored as `text`.
details
jsonbColumn `details` stored as `jsonb`.
course_coderequired
textForeign key referencing `courses.course_code`.

Was this page helpful?

Your feedback directly guides the engineering documentation roadmap.

On this page