feat: Introduce multi-tenancy support with organization-specific data, add interactive transcript functionality, and enhance lesson/course schemas.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
-- Migration: Add unique constraint to enrollments table
|
||||
-- Required for fn_enroll_student ON CONFLICT logic
|
||||
|
||||
DO $$
|
||||
BEGIN
|
||||
IF NOT EXISTS (SELECT 1 FROM pg_constraint WHERE conname = 'enrollments_user_id_course_id_key') THEN
|
||||
ALTER TABLE enrollments ADD CONSTRAINT enrollments_user_id_course_id_key UNIQUE (user_id, course_id);
|
||||
END IF;
|
||||
END $$;
|
||||
Reference in New Issue
Block a user