-- ******************************************************************
-- 表 kku_activity_config 的创建SQL
-- 对应的Model: App\Module\Activity\Models\ActivityConfig
-- 警告: 此文件由系统自动生成，禁止修改！
-- ******************************************************************

CREATE TABLE `kku_activity_config` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '活动名称',
  `type` tinyint(4) NOT NULL COMMENT '活动类型',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '活动描述',
  `start_time` datetime NOT NULL COMMENT '开始时间',
  `end_time` datetime NOT NULL COMMENT '结束时间',
  `status` tinyint(4) DEFAULT '0' COMMENT '活动状态',
  `display_order` int(11) DEFAULT '0' COMMENT '显示顺序',
  `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '活动图标URL',
  `banner` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '活动横幅URL',
  `reward_group_id` int(11) DEFAULT NULL COMMENT '奖励组ID（关联game_reward_groups表）',
  `reward_group_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '奖励组编码（关联game_reward_groups表的code字段）',
  `config_params` json DEFAULT NULL COMMENT '活动特定配置参数',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_type` (`type`) USING BTREE,
  KEY `idx_status` (`status`) USING BTREE,
  KEY `idx_reward_group_id` (`reward_group_id`) USING BTREE,
  KEY `idx_reward_group_code` (`reward_group_code`) USING BTREE,
  KEY `idx_time` (`start_time`,`end_time`) USING BTREE,
  KEY `idx_status_order` (`status`,`display_order`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='活动基础配置表';
