unique quiz constraint
This commit is contained in:
@@ -0,0 +1 @@
|
||||
DROP INDEX IF EXISTS quizzes_one_per_target;
|
||||
@@ -0,0 +1,6 @@
|
||||
-- One quiz per piece of content. A chapter, lecture or conversation may carry
|
||||
-- at most one live quiz; stand-alone quizzes (no path) are unlimited, and a
|
||||
-- deleted quiz frees its link for a new one.
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS quizzes_one_per_target
|
||||
ON quizzes (target_path)
|
||||
WHERE deleted_at IS NULL AND target_path IS NOT NULL;
|
||||
Reference in New Issue
Block a user