-- 删除旧的eb_live_room_like表
DROP TABLE IF EXISTS eb_live_room_like;

-- 重新创建正确的表结构
CREATE TABLE `eb_live_room_like` (
  `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `user_id` INT NOT NULL COMMENT '用户ID',
  `room_id` INT NOT NULL COMMENT '直播间ID',
  `user_nickname` VARCHAR(100) DEFAULT NULL COMMENT '用户昵称',
  `like_count` INT NOT NULL DEFAULT 1 COMMENT '点赞次数',
  `last_like_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '最后点赞时间',
  `create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`),
  KEY `idx_user_id` (`user_id`),
  KEY `idx_room_id` (`room_id`),
  KEY `idx_create_time` (`create_time`),
  UNIQUE KEY `uk_user_room` (`user_id`, `room_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='直播间点赞记录表';

-- 验证表结构
DESC eb_live_room_like;

-- 查看直播间8的信息
SELECT id, title, like_count FROM eb_live_room WHERE id = 8;
