related_subreddits table
The related_subreddits table in the Reddit Clone Database Schema schema has 5 columns, with 2 foreign keys to subreddits.
Both moderator-curated and algorithmic neighbours in one table, distinguished by source, so the sidebar and the recommender can read the same rows without arguing about precedence.
Columns (5)
| Column | Type | Constraints | Description |
|---|---|---|---|
| subreddit_id | uuid | not null, references subreddits.id | |
| related_subreddit_id | uuid | not null, references subreddits.id | |
| source | relation_source | not null | |
| score | double | not null | |
| computed_at | timestamptz | not null |
Relationships
related_subreddits.subreddit_idreferencessubreddits.idrelated_subreddits.related_subreddit_idreferencessubreddits.id