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

CREATE TABLE `kku_pet_skill_logs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `pet_id` bigint(20) unsigned NOT NULL,
  `skill_id` int(10) unsigned NOT NULL,
  `used_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `effect_result` json DEFAULT NULL COMMENT '技能使用结果',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `skill_id` (`skill_id`) USING BTREE,
  KEY `idx_pet_skill` (`pet_id`,`skill_id`) USING BTREE,
  CONSTRAINT `kku_pet_skill_logs_ibfk_1` FOREIGN KEY (`pet_id`) REFERENCES `kku_pet_users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `kku_pet_skill_logs_ibfk_2` FOREIGN KEY (`skill_id`) REFERENCES `kku_pet_skills` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='技能 使用日志';
