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

CREATE TABLE `kku_item_group_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '记录ID，主键',
  `group_id` int(11) NOT NULL COMMENT '物品组ID，外键关联kku_item_groups表',
  `item_id` int(11) NOT NULL COMMENT '物品ID，外键关联kku_item_items表',
  `weight` decimal(5,3) NOT NULL COMMENT '权重，决定从物品组中选择该物品的概率',
  `created_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_group_id` (`group_id`) USING BTREE,
  KEY `idx_item_id` (`item_id`) USING BTREE,
  CONSTRAINT `fk_group_group` FOREIGN KEY (`group_id`) REFERENCES `kku_item_groups` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,
  CONSTRAINT `fk_group_item` FOREIGN KEY (`item_id`) REFERENCES `kku_item_items` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='物品组内容表';
