ALTER TABLE questions
    DROP CONSTRAINT IF EXISTS questions_question_type_check;

ALTER TABLE questions
    ADD CONSTRAINT questions_question_type_check
    CHECK (question_type IN ('MCQ', 'TRUE_FALSE', 'SHORT_ANSWER', 'AUDIO', 'DYNAMIC'));

ALTER TABLE questions
    ADD COLUMN IF NOT EXISTS dynamic_payload JSONB NULL;

ALTER TABLE question_type_definitions
    ADD COLUMN IF NOT EXISTS stimulus_schema JSONB NOT NULL DEFAULT '[]'::jsonb,
    ADD COLUMN IF NOT EXISTS response_schema JSONB NOT NULL DEFAULT '[]'::jsonb;
