28 lines
863 B
SQL
28 lines
863 B
SQL
-- ============================================
|
|
-- PastPaper Master — Allow legacy long_question format alias
|
|
-- Version: 005
|
|
-- Date: 2026-03-24
|
|
-- ============================================
|
|
--
|
|
-- Some existing seeds and older generated SQL used `long_question` in the
|
|
-- `question_format` column, while the 003 taxonomy migration introduced
|
|
-- `long_answer` as the canonical value. Allow both temporarily so historical
|
|
-- inserts do not fail. New generators should continue emitting `long_answer`.
|
|
|
|
ALTER TABLE paper_questions
|
|
DROP CONSTRAINT IF EXISTS paper_questions_question_format_check;
|
|
|
|
ALTER TABLE paper_questions
|
|
ADD CONSTRAINT paper_questions_question_format_check
|
|
CHECK (
|
|
question_format IN (
|
|
'mc',
|
|
'true_false',
|
|
'fill_blank',
|
|
'short_answer',
|
|
'long_answer',
|
|
'long_question',
|
|
'coding'
|
|
)
|
|
);
|