Add user follows to following feed

This commit is contained in:
2026-09-15 09:22:25 +02:00
parent 55174684af
commit c4a84ec135
12 changed files with 213 additions and 28 deletions
+10
View File
@@ -0,0 +1,10 @@
CREATE TABLE IF NOT EXISTS followed_users (
follower_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
followed_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (follower_id, followed_id),
CHECK (follower_id <> followed_id)
);
CREATE INDEX IF NOT EXISTS idx_followed_users_followed
ON followed_users(followed_id, follower_id);