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 -1
View File
@@ -1,4 +1,4 @@
"""Startup equivalents of migrations 1922 (kept in sync by tests)."""
"""Startup equivalents of migrations 1923 (kept in sync by tests)."""
FEATURE_SCHEMA = (
'''CREATE TABLE IF NOT EXISTS push_devices (
@@ -55,4 +55,13 @@ FEATURE_SCHEMA = (
ON push_notifications(available_at) WHERE state='pending';''',
'''CREATE UNIQUE INDEX IF NOT EXISTS idx_user_badges_registration_cohort
ON user_badges(user_id) WHERE badge_code IN ('alpha_tester', 'beta_tester', 'early_bird');''',
'''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);''',
)