-- ============================================================================
-- Live-path fix #4b: structural question types — matching & comprehension.
--
-- Adds two enum values and a generic `extra_data` JSON column:
--   matching      : extra_data = {"pairs":[{"left":"..","right":".."}, ...]}
--   comprehension : extra_data = {"passage":"..","questions":[{"text":"..","marks":n,"model_answer":".."}, ...]}
-- Idempotent (MODIFY re-sets the same enum; ADD COLUMN IF NOT EXISTS is MariaDB-safe).
-- ============================================================================

ALTER TABLE `exam_questions`
  MODIFY `question_type` ENUM('mcq','theory','fill_blank','true_false','matching','comprehension') NOT NULL DEFAULT 'mcq';

ALTER TABLE `exam_questions`
  ADD COLUMN IF NOT EXISTS `extra_data` LONGTEXT DEFAULT NULL;
