Skip to main content

DB enum constraints

This is a compact reference card for columns that are intentionally constrained as enums at the database layer.

Quick orientation

  • Read this if: you are adding or changing kind / status columns in the StateStore.
  • Skip this if: you only need the deployment or data-model overview.
  • Go deeper: use DB naming conventions and the cited migrations.

Constraint matrix

Table / columnAllowed valuesEnforced in
plans.kindaudit, plannerSQLite + Postgres 102_enum_constraints_v2.sql
plans.statusactive, success, escalate, failureSQLite + Postgres 102_enum_constraints_v2.sql
approvals.kindApprovalKind from @tyrum/contractsSQLite + Postgres 102_enum_constraints_v2.sql
approvals.statusApprovalStatus from @tyrum/contractsSQLite + Postgres 102_enum_constraints_v2.sql

Rules

  • Constrain enum-like columns in both dialects at the same migration boundary.
  • Prefer shared schema enums where they already exist instead of inventing DB-only lists.
  • If a status or kind column is intentionally open-ended, document that choice here.

Intentionally unconstrained today

None recorded yet.