Skip to content

Use EXCLUDE USING gist exclusion constraints to guard against concurrent draft creations #187

Description

@BastiDood

Back in 2024, we had an exclusion constraint on the drap.draft.active_period column to ensure that concurrent writes to the draft table do not accidentally create two new drafts; only one must succeed while other writes fail. But when we introduced Drizzle ORM in 2025, we lost this exclusion constraint because Drizzle doesn't support the syntax (yet!).

// TODO: Exclusive index range for `activePeriod`.

Metadata

Metadata

Assignees

Labels

blockedBlocked by an upstream dependency or other external factorsbugSomething isn't workingdbRequires updates to the data model

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions