feat: add reviews, notifications, notes and account hardening
This commit is contained in:
12
server/migrations/018_course_reviews.sql
Normal file
12
server/migrations/018_course_reviews.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
-- One review per learner per course.
|
||||
create table if not exists course_reviews (
|
||||
user_id uuid not null references users(id) on delete cascade,
|
||||
course_id uuid not null references courses(id) on delete cascade,
|
||||
rating smallint not null check (rating between 1 and 5),
|
||||
comment text not null default '',
|
||||
created_at timestamptz not null default now(),
|
||||
updated_at timestamptz not null default now(),
|
||||
primary key (user_id, course_id)
|
||||
);
|
||||
|
||||
create index if not exists course_reviews_course_index on course_reviews (course_id, updated_at desc);
|
||||
Reference in New Issue
Block a user