posts table
The posts table in the Blog Database Schema schema has 15 columns, keyed by id, with 2 foreign keys to users and media. 7 columns in post_revisions, post_categories, post_tags, post_media and 3 more reference it.
published_at in the future IS the scheduling mechanism; no separate queue table. The counts are caches rebuildable from comments and post_views.
Columns (15)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| author_id | uuid | not null, references users.id | |
| slug | varchar(200) | unique, not null | |
| title | varchar(255) | not null | |
| excerpt | varchar(500) | ||
| body | text | ||
| featured_media_id | uuid | references media.id | |
| status | post_status | not null | |
| reading_minutes | smallint | ||
| comment_count | integer | not null | |
| view_count | integer | not null | |
| is_featured | boolean | not null | |
| published_at | timestamptz | ||
| created_at | timestamptz | not null | |
| updated_at | timestamptz | not null |
Indexes (3)
(status, published_at)(author_id, published_at)(is_featured, published_at)
Relationships
posts.author_idreferencesusers.idposts.featured_media_idreferencesmedia.idpost_revisions.post_idreferencespostspost_categories.post_idreferencespostspost_tags.post_idreferencespostspost_media.post_idreferencespostscomments.post_idreferencespostsseo_meta.post_idreferencespostspost_views.post_idreferencesposts