notifications table

The notifications table in the Learning Management System Database Schema schema has 8 columns, keyed by id, with 2 foreign keys to users and courses.

reference_id is a loose pointer to whatever the notification is about, kept untyped so adding a new notification type needs no migration.

Columns (8)

Columns of the notifications table
ColumnTypeConstraintsDescription
iduuidprimary key
user_iduuidnot null, references users.id
typenotification_typenot null
course_iduuidreferences courses.id
reference_iduuid
bodyvarchar(500)not null
is_readbooleannot null
created_attimestamptznot null

Indexes (1)

  • (user_id, is_read, created_at)

Relationships