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)

Columns of the posts table
ColumnTypeConstraintsDescription
iduuidprimary key
author_iduuidnot null, references users.id
slugvarchar(200)unique, not null
titlevarchar(255)not null
excerptvarchar(500)
bodytext
featured_media_iduuidreferences media.id
statuspost_statusnot null
reading_minutessmallint
comment_countintegernot null
view_countintegernot null
is_featuredbooleannot null
published_attimestamptz
created_attimestamptznot null
updated_attimestamptznot null

Indexes (3)

  • (status, published_at)
  • (author_id, published_at)
  • (is_featured, published_at)

Relationships