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

CREATE TABLE `kku_pet_users` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint NOT NULL COMMENT '用户ID',
  `name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '宠物名称',
  `grade` enum('FIRST','SECOND','THIRD','FOURTH') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '品阶',
  `level` tinyint unsigned DEFAULT '1' COMMENT '等级',
  `experience` int unsigned DEFAULT '0' COMMENT '经验',
  `stamina` smallint unsigned DEFAULT '100' COMMENT '体力',
  `max_experience` int unsigned DEFAULT '0' COMMENT '最高经验',
  `max_stamina` int unsigned DEFAULT '100' COMMENT '体力 上限',
  `status` tinyint unsigned DEFAULT '1' COMMENT '宠物状态：0未知，1正常，2战斗中，3死亡',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted_at` timestamp NULL DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_user` (`user_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户的宠物';
