Enums
File location: schema/enums/<name>.yaml
Example
Section titled “Example”name: order_statusvalues: - pending - processing - shipped - delivered - cancelledcomment: 'Order lifecycle states'Fields
Section titled “Fields”| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Enum type name |
values | string[] | yes | Enum values in order |
comment | string | no | Description |
Behavior
Section titled “Behavior”- Adding values: New values appended to the end are applied automatically with
ALTER TYPE ... ADD VALUE - Removing values: Requires
--allow-destructiveflag - Reordering: Not supported (PostgreSQL limitation)
Usage in tables
Section titled “Usage in tables”Reference enum types by name in column definitions:
table: orderscolumns: - name: status type: order_status nullable: false default: "'pending'"