Authoring

Drafts and publishing

A draft is a separate row, not a status flag. Publishing replaces the published document and deletes the draft in one transaction; discarding leaves the published version untouched.

shipped

Every document may exist twice: as <id> and as drafts.<id>. The site keeps serving what is published while an editor works on what is next.

Publishing is transactional — replace, delete, record a revision, all or nothing — and it enforces the constraints that matter at exactly the moment they become real: a strong reference to a missing document, or a slug another published document already holds.