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)

Columns of the enrollments table
ColumnTypeConstraintsDescription
iduuidprimary key
cohort_iduuidnot null, references cohorts.id
user_iduuidnot null, references users.id
statusenrollment_statusnot null
progress_percentsmallintnot null
enrolled_attimestamptznot null
started_attimestamptz
completed_attimestamptz
expires_attimestamptz

Indexes (3)

  • (cohort_id, user_id) unique
  • (user_id, status)
  • (status, completed_at)

Relationships