pet_users.sql 1.2 KB

123456789101112131415161718192021
  1. -- ******************************************************************
  2. -- 表 kku_pet_users 的创建SQL
  3. -- 对应的Model: App\Module\Pet\Models\PetUser
  4. -- 警告: 此文件由系统自动生成,禁止修改!
  5. -- ******************************************************************
  6. CREATE TABLE `kku_pet_users` (
  7. `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  8. `user_id` bigint NOT NULL COMMENT '用户ID',
  9. `name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '宠物名称',
  10. `level` tinyint unsigned DEFAULT '1' COMMENT '等级',
  11. `experience` int unsigned DEFAULT '0' COMMENT '经验',
  12. `stamina` int unsigned DEFAULT '100' COMMENT '体力',
  13. `status` tinyint unsigned DEFAULT '1' COMMENT '宠物状态:0未知,1正常,2战斗中,3死亡',
  14. `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  15. `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  16. `deleted_at` timestamp NULL DEFAULT NULL COMMENT '删除时间',
  17. PRIMARY KEY (`id`) USING BTREE,
  18. KEY `idx_user` (`user_id`) USING BTREE,
  19. KEY `idx_deleted_at` (`deleted_at`) USING BTREE
  20. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户的宠物';