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

CREATE TABLE `kku_farm_team_profits` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `user_id` bigint NOT NULL COMMENT '获得收益的用户ID',
  `team_member_id` bigint NOT NULL COMMENT '团队成员ID',
  `harvest_id` bigint NOT NULL COMMENT '收获记录ID',
  `profit_amount` int NOT NULL COMMENT '分成收益数量',
  `profit_rate` decimal(5,4) NOT NULL COMMENT '分成比例',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_user_id` (`user_id`) USING BTREE,
  KEY `idx_team_member_id` (`team_member_id`) USING BTREE,
  KEY `idx_harvest_id` (`harvest_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='团队收益记录表';
