Files
Learn_System/backend/src/db/migrations/057_exam_task_textbook.sql
T
Maxim Dolgolyov c7cfd72e7f feat(exam): Phase 2 — схема per-task textbook link (057_exam_task_textbook.sql)
ALTER TABLE exam_tasks ADD COLUMN textbook_slug TEXT;
ALTER TABLE exam_tasks ADD COLUMN textbook_paragraph INTEGER;

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 16:18:22 +03:00

15 lines
933 B
SQL

-- ═══════════════════════════════════════════════════════════════
-- 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;