site_suspensions table
The site_suspensions table in the Reddit Clone Database Schema schema has 10 columns, keyed by id, with 3 foreign keys to users. 1 column in ban_appeals references it.
Site-wide sanction, deliberately a different table from subreddit_bans: they are issued by different people, appealed to different people, and have different consequences. is_shadowban means the account still posts and simply is not shown to anyone else, which cannot be modelled as a status alone because the user must not be told.
Columns (10)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| user_id | uuid | not null, references users.id | |
| issued_by | uuid | references users.id | |
| type | suspension_type | not null | |
| reason | varchar(1000) | not null | |
| is_shadowban | boolean | not null | |
| starts_at | timestamptz | not null | |
| expires_at | timestamptz | ||
| lifted_at | timestamptz | ||
| lifted_by | uuid | references users.id |
Indexes (2)
(user_id, expires_at)(type, starts_at)
Relationships
site_suspensions.user_idreferencesusers.idsite_suspensions.issued_byreferencesusers.idsite_suspensions.lifted_byreferencesusers.idban_appeals.suspension_idreferencessite_suspensions