Initial commit: PastPaper Master full stack
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
27
supabase/migrations/005_allow_long_question_format_alias.sql
Normal file
27
supabase/migrations/005_allow_long_question_format_alias.sql
Normal file
@@ -0,0 +1,27 @@
|
||||
-- ============================================
|
||||
-- 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'
|
||||
)
|
||||
);
|
||||
Reference in New Issue
Block a user