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)

Columns of the discussions table
ColumnTypeConstraintsDescription
iduuidprimary key
course_iduuidnot null, references courses.id
cohort_iduuidreferences cohorts.id
lesson_iduuidreferences lessons.id
titlevarchar(255)not null
is_pinnedbooleannot null
is_lockedbooleannot null
created_byuuidnot null, references users.id
created_attimestamptznot null

Indexes (2)

  • (course_id, is_pinned, created_at)
  • (lesson_id)

Relationships