forums table

The forums table in the Forum Database Schema schema has 11 columns, keyed by id, with 1 foreign key to forums. 2 columns in topics and user_bans reference it.

Self-referencing so a board can hold sub-boards. last_topic_id is deliberately not a foreign key: it is a display cache, and a cascade from it would be a liability.

Columns (11)

Columns of the forums table
ColumnTypeConstraintsDescription
iduuidprimary key
parent_iduuidreferences forums.id
slugvarchar(140)unique, not null
namevarchar(120)not null
descriptionvarchar(500)
positionintegernot null
topic_countintegernot null
post_countintegernot null
last_topic_iduuid
is_lockedbooleannot null
min_reputation_to_postinteger

Indexes (1)

  • (parent_id, position)

Relationships