post_revisions table

The post_revisions table in the Blog Database Schema schema has 8 columns, keyed by id, with 2 foreign keys to posts and users.

Append-only history. posts carries the live version; every prior state including unpublished drafts lives here.

Columns (8)

Columns of the post_revisions table
ColumnTypeConstraintsDescription
iduuidprimary key
post_iduuidnot null, references posts.id
editor_iduuidreferences users.id
revision_numberintegernot null
titlevarchar(255)not null
bodytext
change_summaryvarchar(255)
created_attimestamptznot null

Indexes (2)

  • (post_id, revision_number) unique
  • (post_id, created_at)

Relationships

  • post_revisions.post_id references posts.id
  • post_revisions.editor_id references users.id