user_bans table
The user_bans table in the Forum Database Schema schema has 9 columns, keyed by id, with 3 foreign keys to users and forums.
A ban is a row with an expiry, not a flag on users, so a history of sanctions survives. expires_at null is permanent; forum_id set scopes it to one board.
Columns (9)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| user_id | uuid | not null, references users.id | |
| issued_by | uuid | not null, references users.id | |
| scope | ban_scope | not null | |
| forum_id | uuid | references forums.id | |
| reason | varchar(1000) | not null | |
| starts_at | timestamptz | not null | |
| expires_at | timestamptz | ||
| lifted_at | timestamptz |
Indexes (2)
(user_id, expires_at)(scope, forum_id)