Skip to content

Enums

File location: schema/enums/<name>.yaml

name: order_status
values:
- pending
- processing
- shipped
- delivered
- cancelled
comment: 'Order lifecycle states'
FieldTypeRequiredDescription
namestringyesEnum type name
valuesstring[]yesEnum values in order
commentstringnoDescription
  • Adding values: New values appended to the end are applied automatically with ALTER TYPE ... ADD VALUE
  • Removing values: Requires --allow-destructive flag
  • Reordering: Not supported (PostgreSQL limitation)

Reference enum types by name in column definitions:

schema/tables/orders.yaml
table: orders
columns:
- name: status
type: order_status
nullable: false
default: "'pending'"