diff --git a/backend/src/db/migrations/057_exam_task_textbook.sql b/backend/src/db/migrations/057_exam_task_textbook.sql new file mode 100644 index 0000000..43d4012 --- /dev/null +++ b/backend/src/db/migrations/057_exam_task_textbook.sql @@ -0,0 +1,14 @@ +-- ═══════════════════════════════════════════════════════════════ +-- 057: Per-task textbook link for exam_tasks +-- +-- Adds two columns to exam_tasks: +-- textbook_slug — textbook chapter slug (e.g. 'algebra-8-ch2') +-- textbook_paragraph — paragraph number inside that chapter (pN → N as integer) +-- +-- These are populated by backend/scripts/tag-exam-textbook.js. +-- The controller (exam-prep.js) prefers these task-level values +-- over the subtopic-level fallback from exam_topics. +-- ═══════════════════════════════════════════════════════════════ + +ALTER TABLE exam_tasks ADD COLUMN textbook_slug TEXT; +ALTER TABLE exam_tasks ADD COLUMN textbook_paragraph INTEGER;