courses table
The courses table in the Learning Management System Database Schema schema has 15 columns, keyed by id, with 1 foreign key to course_categories. 8 columns in user_roles, course_instructors, modules, cohorts and 4 more reference it.
The course is the syllabus, not a run of it. Dates and enrolment live on cohorts, so the same course can run every term.
Columns (15)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| category_id | uuid | references course_categories.id | |
| code | varchar(40) | unique, not null | |
| title | varchar(255) | not null | |
| slug | varchar(280) | unique, not null | |
| summary | varchar(500) | ||
| description | text | ||
| level | course_level | not null | |
| status | course_status | not null | |
| language | char(2) | ||
| estimated_hours | smallint | ||
| price_cents | integer | ||
| currency | char(3) | ||
| published_at | timestamptz | ||
| created_at | timestamptz | not null |
Indexes (2)
(status, published_at)(category_id, status)
Relationships
courses.category_idreferencescourse_categories.iduser_roles.course_idreferencescoursescourse_instructors.course_idreferencescoursesmodules.course_idreferencescoursescohorts.course_idreferencescoursesassignments.course_idreferencescoursesquizzes.course_idreferencescoursesdiscussions.course_idreferencescoursesnotifications.course_idreferencescourses