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)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| parent_id | uuid | references forums.id | |
| slug | varchar(140) | unique, not null | |
| name | varchar(120) | not null | |
| description | varchar(500) | ||
| position | integer | not null | |
| topic_count | integer | not null | |
| post_count | integer | not null | |
| last_topic_id | uuid | ||
| is_locked | boolean | not null | |
| min_reputation_to_post | integer |
Indexes (1)
(parent_id, position)
Relationships
forums.parent_idreferencesforums.idtopics.forum_idreferencesforumsuser_bans.forum_idreferencesforums