CREATE TABLE IF NOT EXISTS `wpjy_report_acl` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `report_slug` varchar(120) NOT NULL,
  `id_grupo` bigint unsigned NOT NULL,
  `rule` enum('allow','deny') NOT NULL DEFAULT 'allow',
  `inherit_mode` enum('exact','with_descendants') NOT NULL DEFAULT 'exact',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_report_slug` (`report_slug`),
  KEY `idx_report_group` (`id_grupo`),
  KEY `idx_report_acl_lookup` (`report_slug`,`id_grupo`,`rule`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
