
CREATE TABLE IF NOT EXISTS `ad_events` (
  `spot_id` INT UNSIGNED NOT NULL,
  `zone_id` INT UNSIGNED NOT NULL,
  `event_type` ENUM('impression','click') NOT NULL,
  `event_date` DATE NOT NULL,
  `cnt` INT UNSIGNED NOT NULL DEFAULT 0,
  PRIMARY KEY (`spot_id`, `event_type`, `event_date`),
  KEY `zone_date` (`zone_id`, `event_date`),
  KEY `date_idx` (`event_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
