diff --git a/src/main/resources/schema.sql b/src/main/resources/schema.sql
index 5cb15a5..09276b4 100644
--- a/src/main/resources/schema.sql
+++ b/src/main/resources/schema.sql
@@ -21,6 +21,7 @@
   `torrent_id` INT AUTO_INCREMENT PRIMARY KEY,
   `user_id` INT NOT NULL,
   `torrent_name` VARCHAR(255) NOT NULL,
+  `file_path` VARCHAR(255) NOT NULL,
   `info_hash` BINARY(20) NOT NULL,
   `file_size` FLOAT NOT NULL,
   FOREIGN KEY (`user_id`) REFERENCES `users`(`user_id`)
@@ -46,17 +47,19 @@
   `view_count` INT DEFAULT 0 COMMENT '浏览数',
   `post_title` VARCHAR(255) NOT NULL,
   `post_content` TEXT NOT NULL,
+  `torrent_id` INT DEFAULT NULL,
   `post_type` ENUM('resource', 'discussion') NOT NULL,
   `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
   `last_calculated` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后热度计算时间',
   FOREIGN KEY (`user_id`) REFERENCES `users`(`user_id`),
+  FOREIGN KEY (`torrent_id`) REFERENCES `torrents`(`torrent_id`),
   INDEX `idx_hot_score` (`hot_score`),          -- 新增热度索引
   INDEX `idx_post_type` (`post_type`)           -- 新增类型索引
 );
 -- 标签表（保持不变）
 CREATE TABLE IF NOT EXISTS `tags`(
-  `tag_id` INT AUTO_INCREMENT PRIMARY KEY,
-  `tag_name` VARCHAR(255) NOT NULL UNIQUE,
+  `tag_id` INT PRIMARY KEY,
+  `tag_name` VARCHAR(255) NOT NULL,
   `parent_id` INT DEFAULT NULL,
   FOREIGN KEY (`parent_id`) REFERENCES `tags`(`tag_id`)
 );
@@ -120,7 +123,7 @@
   FOREIGN KEY (`post_id`) REFERENCES `posts`(`post_id`),
   INDEX `idx_user_view_time` (`user_id`, `view_time` DESC)  -- 新增用户浏览时间索引
 );
-CREATE TABLE user_tag_preference (
+CREATE TABLE IF NOT EXISTS user_tag_preference (
     user_id INT NOT NULL COMMENT '用户ID',
     tag_id INT NOT NULL COMMENT '标签ID',
     weight DOUBLE DEFAULT 1.0 COMMENT '偏好权重（浏览越多权重越高）',
