discussions table
The discussions table in the Learning Management System Database Schema schema has 9 columns, keyed by id, with 4 foreign keys to courses, cohorts, lessons and users. 1 column in discussion_posts references it.
cohort_id null makes the thread visible to every run of the course; set, it is scoped to one cohort.
Columns (9)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| course_id | uuid | not null, references courses.id | |
| cohort_id | uuid | references cohorts.id | |
| lesson_id | uuid | references lessons.id | |
| title | varchar(255) | not null | |
| is_pinned | boolean | not null | |
| is_locked | boolean | not null | |
| created_by | uuid | not null, references users.id | |
| created_at | timestamptz | not null |
Indexes (2)
(course_id, is_pinned, created_at)(lesson_id)
Relationships
discussions.course_idreferencescourses.iddiscussions.cohort_idreferencescohorts.iddiscussions.lesson_idreferenceslessons.iddiscussions.created_byreferencesusers.iddiscussion_posts.discussion_idreferencesdiscussions