post_report
Change-Id: I191da6e9ea7371e66dadead873abd057f5d08c74
diff --git a/src/main/resources/schema.sql b/src/main/resources/schema.sql
index f6d061b..1ee0c87 100644
--- a/src/main/resources/schema.sql
+++ b/src/main/resources/schema.sql
@@ -143,4 +143,19 @@
FOREIGN KEY (`user_id`) REFERENCES `users`(`user_id`),
FOREIGN KEY (`post_id`) REFERENCES `posts`(`post_id`),
INDEX idx_post_ratings_post_id ON post_ratings (post_id)
+);
+
+CREATE TABLE IF NOT EXISTS `reports` (
+ `report_id` INT AUTO_INCREMENT PRIMARY KEY COMMENT '举报ID',
+ `post_id` INT NOT NULL COMMENT '被举报的帖子ID',
+ `user_id` INT NOT NULL COMMENT '举报人ID',
+ `reason` TEXT NOT NULL COMMENT '举报原因',
+ `status` ENUM('pending', 'resolved', 'rejected') DEFAULT 'pending' COMMENT '处理状态(待处理/已解决/已驳回)',
+ `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '举报时间',
+ `resolved_by` INT DEFAULT NULL COMMENT '处理人ID(管理员)',
+ `resolved_at` TIMESTAMP DEFAULT NULL COMMENT '处理时间',
+ `resolution_notes` TEXT DEFAULT NULL COMMENT '处理备注',
+ FOREIGN KEY (`post_id`) REFERENCES `posts`(`post_id`),
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`user_id`),
+ FOREIGN KEY (`resolved_by`) REFERENCES `users`(`user_id`)
);
\ No newline at end of file