Revisione/drizzle/0001_hardening.sql

11 lines
687 B
SQL

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`);