-- 表 kku_pet_skill_logs 的创建SQL

DROP TABLE IF EXISTS `kku_pet_skill_logs`;
CREATE TABLE `kku_pet_skill_logs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `pet_id` bigint unsigned NOT NULL,
  `skill_id` int unsigned NOT NULL,
  `used_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `effect_result` json DEFAULT NULL COMMENT '技能使用结果',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `skill_id` (`skill_id`),
  KEY `idx_pet_skill` (`pet_id`,`skill_id`),
  CONSTRAINT `kku_pet_skill_logs_ibfk_1` FOREIGN KEY (`pet_id`) REFERENCES `kku_pet_users` (`id`),
  CONSTRAINT `kku_pet_skill_logs_ibfk_2` FOREIGN KEY (`skill_id`) REFERENCES `kku_pet_skills` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='技能 使用日志';
