-- Logs de tentativas de retry por perfil
CREATE TABLE IF NOT EXISTS video_retry_attempt_logs (
  id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  video_job_id BIGINT UNSIGNED NOT NULL,
  quality VARCHAR(20) NOT NULL,
  attempt_no INT NOT NULL DEFAULT 0,
  exit_code INT NOT NULL DEFAULT 0,
  error_tail TEXT NULL,
  profile_json TEXT NULL,
  created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  INDEX idx_vral_job (video_job_id),
  INDEX idx_vral_quality (quality),
  INDEX idx_vral_created (created_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
