pet_steal_logs.sql 1.6 KB

1234567891011121314151617181920212223242526272829303132
  1. -- ******************************************************************
  2. -- 表 kku_pet_steal_logs 的创建SQL
  3. -- 对应的Model: App\Module\Pet\Models\PetStealLog
  4. -- 警告: 此文件由系统自动生成,禁止修改!
  5. -- ******************************************************************
  6. CREATE TABLE `kku_pet_steal_logs` (
  7. `id` bigint NOT NULL AUTO_INCREMENT,
  8. `stealer_user_id` int NOT NULL COMMENT '偷菜者用户ID',
  9. `stealer_pet_id` bigint DEFAULT NULL COMMENT '偷菜者宠物ID',
  10. `target_user_id` int NOT NULL COMMENT '被偷者用户ID',
  11. `target_pet_id` bigint DEFAULT NULL COMMENT '被偷者宠物ID',
  12. `land_id` int NOT NULL COMMENT '土地ID',
  13. `crop_id` int DEFAULT NULL COMMENT '作物ID',
  14. `success` tinyint(1) NOT NULL COMMENT '是否偷取成功',
  15. `defended` tinyint(1) DEFAULT '0' COMMENT '是否被防御',
  16. `steal_amount` int DEFAULT '0' COMMENT '偷取数量',
  17. `stealer_stamina_cost` int DEFAULT '20' COMMENT '偷菜者体力消耗',
  18. `target_stamina_cost` int DEFAULT '0' COMMENT '被偷者体力消耗',
  19. `pick_log_id` bigint DEFAULT NULL COMMENT '关联的Farm模块摘取日志ID',
  20. `fail_reason` varchar(255) DEFAULT NULL COMMENT '失败原因',
  21. `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  22. PRIMARY KEY (`id`),
  23. KEY `idx_stealer_user_id` (`stealer_user_id`),
  24. KEY `idx_target_user_id` (`target_user_id`),
  25. KEY `idx_land_id` (`land_id`),
  26. KEY `idx_crop_id` (`crop_id`),
  27. KEY `idx_pick_log_id` (`pick_log_id`),
  28. KEY `idx_created_at` (`created_at`),
  29. KEY `idx_success` (`success`),
  30. KEY `idx_defended` (`defended`)
  31. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='宠物偷菜日志表';