users table
The users table in the Blog Database Schema schema has 10 columns, keyed by id. 4 columns in posts, post_revisions, media and comments reference it.
Authors, editors and admins in one table, separated by role. The slug powers /author/jane-doe.
Columns (10)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| varchar(255) | unique, not null | ||
| slug | varchar(80) | unique, not null | |
| display_name | varchar(120) | not null | |
| role | user_role | not null | |
| bio | varchar(1000) | ||
| avatar_url | varchar(500) | ||
| website | varchar(255) | ||
| is_active | boolean | not null | |
| created_at | timestamptz | not null |
Indexes (1)
(role, is_active)
Relationships
posts.author_idreferencesuserspost_revisions.editor_idreferencesusersmedia.uploaded_byreferencesuserscomments.user_idreferencesusers