users table
The users table in the Forum Database Schema schema has 11 columns, keyed by id. 13 columns in user_badges, topics, posts, post_revisions and 5 more reference it.
reputation and post_count are caches rebuildable from votes and posts. The reputation index is what makes a leaderboard cheap.
Columns (11)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| username | varchar(40) | unique, not null | |
| varchar(255) | unique, not null | ||
| display_name | varchar(80) | ||
| avatar_url | varchar(500) | ||
| signature | varchar(500) | ||
| reputation | integer | not null | |
| post_count | integer | not null | |
| status | user_status | not null | |
| joined_at | timestamptz | not null | |
| last_seen_at | timestamptz |
Indexes (2)
(status, reputation)(last_seen_at)
Relationships
user_badges.user_idreferencesuserstopics.author_idreferencesuserstopics.last_post_user_idreferencesusersposts.author_idreferencesuserspost_revisions.editor_idreferencesusersvotes.user_idreferencesuserstopic_subscriptions.user_idreferencesusersreports.reporter_idreferencesusersreports.reported_user_idreferencesusersmoderation_actions.moderator_idreferencesusersmoderation_actions.target_user_idreferencesusersuser_bans.user_idreferencesusersuser_bans.issued_byreferencesusers