Add user follows to following feed
This commit is contained in:
+10
-1
@@ -1,4 +1,4 @@
|
||||
"""Startup equivalents of migrations 19–22 (kept in sync by tests)."""
|
||||
"""Startup equivalents of migrations 19–23 (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);''',
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user