-- Create exam_meetings table
CREATE TABLE IF NOT EXISTS `exam_meetings` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `course_id` VARCHAR(50) NOT NULL,
  `recid` VARCHAR(50) NOT NULL,
  `itemid` VARCHAR(50) NOT NULL,
  `meeting_id` VARCHAR(120) NOT NULL,
  `provider` ENUM('videosdk', 'livekit') NOT NULL DEFAULT 'videosdk',
  `created_by` VARCHAR(50) NOT NULL,
  `is_active` TINYINT(1) NOT NULL DEFAULT 1,
  `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_exam_meeting` (`course_id`, `recid`, `itemid`),
  KEY `idx_meeting_id` (`meeting_id`),
  KEY `idx_is_active` (`is_active`),
  KEY `idx_created_by` (`created_by`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
