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)

Columns of the user_bans table
ColumnTypeConstraintsDescription
iduuidprimary key
user_iduuidnot null, references users.id
issued_byuuidnot null, references users.id
scopeban_scopenot null
forum_iduuidreferences forums.id
reasonvarchar(1000)not null
starts_attimestamptznot null
expires_attimestamptz
lifted_attimestamptz

Indexes (2)

  • (user_id, expires_at)
  • (scope, forum_id)

Relationships