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)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| user_id | uuid | not null, references users.id | |
| type | notification_type | not null | |
| course_id | uuid | references courses.id | |
| reference_id | uuid | ||
| body | varchar(500) | not null | |
| is_read | boolean | not null | |
| created_at | timestamptz | not null |
Indexes (1)
(user_id, is_read, created_at)
Relationships
notifications.user_idreferencesusers.idnotifications.course_idreferencescourses.id