harden database interactions and improve error handling

This commit is contained in:
ImBenji
2026-04-28 14:36:13 +01:00
parent 5a4caaf1d0
commit e1f168a302
29 changed files with 869 additions and 241 deletions
+11
View File
@@ -0,0 +1,11 @@
ALTER TABLE `courses` ADD COLUMN `audit_status` text DEFAULT 'pending';
--> statement-breakpoint
ALTER TABLE `courses` ADD COLUMN `inference_warning` integer DEFAULT 0;
--> statement-breakpoint
CREATE UNIQUE INDEX IF NOT EXISTS `topics_course_order_unique` ON `topics` (`course_id`, `order`);
--> statement-breakpoint
CREATE UNIQUE INDEX IF NOT EXISTS `lessons_topic_unique` ON `lessons` (`topic_id`);
--> statement-breakpoint
CREATE UNIQUE INDEX IF NOT EXISTS `quiz_questions_topic_question_unique` ON `quiz_questions` (`topic_id`, `question`);
--> statement-breakpoint
CREATE UNIQUE INDEX IF NOT EXISTS `user_progress_course_topic_unique` ON `user_progress` (`course_id`, `topic_id`);
+1
View File
@@ -0,0 +1 @@
{}
+7
View File
@@ -8,6 +8,13 @@
"when": 1777109155026,
"tag": "0000_init",
"breakpoints": true
},
{
"idx": 1,
"version": "6",
"when": 1777200000000,
"tag": "0001_hardening",
"breakpoints": true
}
]
}