follow+sendMessage
Change-Id: I3e9bbcc89dfc53b9651fd8722da1b445a597629a
diff --git a/src/main/resources/schema.sql b/src/main/resources/schema.sql
index 952313e..5e5dd43 100644
--- a/src/main/resources/schema.sql
+++ b/src/main/resources/schema.sql
@@ -63,3 +63,25 @@
FOREIGN KEY (post_id) REFERENCES posts(post_id),
PRIMARY KEY (user_id, post_id)
);
+
+-- 关注关系表
+CREATE TABLE IF NOT EXISTS `user_follows` (
+ follower_id INT NOT NULL,
+ followed_id INT NOT NULL,
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ FOREIGN KEY (follower_id) REFERENCES users(user_id),
+ FOREIGN KEY (followed_id) REFERENCES users(user_id),
+ PRIMARY KEY (follower_id, followed_id)
+);
+
+-- 私信表
+CREATE TABLE IF NOT EXISTS `private_messages` (
+ message_id INT AUTO_INCREMENT PRIMARY KEY,
+ sender_id INT NOT NULL,
+ receiver_id INT NOT NULL,
+ content TEXT NOT NULL,
+ sent_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ is_read BOOLEAN DEFAULT false,
+ FOREIGN KEY (sender_id) REFERENCES users(user_id),
+ FOREIGN KEY (receiver_id) REFERENCES users(user_id)
+);
\ No newline at end of file