enrollments table
The enrollments table in the Learning Management System Database Schema schema has 9 columns, keyed by id, with 2 foreign keys to cohorts and users. 6 columns in lesson_progress, assignment_submissions, quiz_attempts, grades and 2 more reference it.
The spine of the learner side. progress_percent is a cache rebuildable from lesson_progress. Everything a learner does points at an enrolment, never at a course.
Columns (9)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| cohort_id | uuid | not null, references cohorts.id | |
| user_id | uuid | not null, references users.id | |
| status | enrollment_status | not null | |
| progress_percent | smallint | not null | |
| enrolled_at | timestamptz | not null | |
| started_at | timestamptz | ||
| completed_at | timestamptz | ||
| expires_at | timestamptz |
Indexes (3)
(cohort_id, user_id)unique(user_id, status)(status, completed_at)
Relationships
enrollments.cohort_idreferencescohorts.idenrollments.user_idreferencesusers.idlesson_progress.enrollment_idreferencesenrollmentsassignment_submissions.enrollment_idreferencesenrollmentsquiz_attempts.enrollment_idreferencesenrollmentsgrades.enrollment_idreferencesenrollmentscertificates.enrollment_idreferencesenrollmentssession_attendance.enrollment_idreferencesenrollments