-- ============================================================
-- WENUS — MIGRATION: TABELA DE INGRESSOS DE EVENTOS
-- Informativa por enquanto — venda futura
-- ============================================================

CREATE TABLE IF NOT EXISTS `event_tickets` (
  `id`          int(11)        NOT NULL AUTO_INCREMENT,
  `event_id`    int(11)        NOT NULL,
  `organizer_id` int(11)       NOT NULL,
  `name`        varchar(100)   NOT NULL COMMENT 'Ex: Casal, Solteiro, VIP, Pista...',
  `price`       decimal(8,2)   NOT NULL COMMENT 'Valor em reais',
  `description` varchar(255)   DEFAULT NULL COMMENT 'Informação extra opcional',
  `ordem`       tinyint(3)     NOT NULL DEFAULT 0 COMMENT 'Ordem de exibição',
  `ativo`       tinyint(1)     NOT NULL DEFAULT 1,
  `created_at`  timestamp      NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  INDEX `idx_event_id` (`event_id`),
  CONSTRAINT `fk_ticket_event`
    FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_ticket_organizer`
    FOREIGN KEY (`organizer_id`) REFERENCES `organizers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
  COMMENT='Tabela de valores/tipos de ingresso por evento — informativa (venda futura)';
