diff --git a/src/database.rs b/src/database.rs index 42fe7be..009af27 100644 --- a/src/database.rs +++ b/src/database.rs @@ -128,8 +128,6 @@ const MIGRATION: &str = " DEFINE FIELD IF NOT EXISTS max_attempts ON exam TYPE int DEFAULT 1; DEFINE FIELD IF NOT EXISTS allow_rejoin ON exam TYPE bool DEFAULT true; DEFINE INDEX IF NOT EXISTS exam_course ON exam FIELDS course; - UPDATE exam SET max_attempts = 1 WHERE max_attempts = NONE; - UPDATE exam SET allow_rejoin = true WHERE allow_rejoin = NONE; DEFINE TABLE IF NOT EXISTS exam_attempt SCHEMAFULL; DEFINE FIELD IF NOT EXISTS exam ON exam_attempt TYPE record; @@ -138,8 +136,6 @@ const MIGRATION: &str = " DEFINE FIELD IF NOT EXISTS started_at ON exam_attempt TYPE int; DEFINE FIELD IF NOT EXISTS finished_at ON exam_attempt TYPE option; DEFINE FIELD IF NOT EXISTS left_at ON exam_attempt TYPE option; - UPDATE exam_attempt SET seq = 1 WHERE seq = NONE; - REMOVE INDEX IF EXISTS exam_attempt_exam_user ON TABLE exam_attempt; DEFINE INDEX IF NOT EXISTS exam_attempt_exam_user_seq ON exam_attempt FIELDS exam, user, seq UNIQUE; DEFINE INDEX IF NOT EXISTS exam_attempt_exam ON exam_attempt FIELDS exam;