CREATE TABLE IF NOT EXISTS crewdna_submissions (
  id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  event_code VARCHAR(100) NOT NULL,
  participant_name VARCHAR(150) NOT NULL,
  participant_email VARCHAR(190) NOT NULL,
  answers_json LONGTEXT NOT NULL,
  scores_json LONGTEXT NOT NULL,
  suggested_role VARCHAR(80) NOT NULL,
  second_role VARCHAR(80) NOT NULL,
  third_role VARCHAR(80) NOT NULL,
  final_email_sent TINYINT(1) NOT NULL DEFAULT 0,
  created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  INDEX idx_event_code (event_code),
  INDEX idx_participant_email (participant_email)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
