Skip to main content

Custom types & enums

Define named enums once and reuse them as field types anywhere in the diagram — instead of repeating the same set of allowed values on field after field.

The Types panel showing three enums

Defining an enum​

Open the Types panel and:

  1. Click + New type and edit its name.
  2. Click + value to add values.
  3. Edit or remove value chips inline (you can't remove the last value).
  4. Remove a whole type with the trash icon.

Using an enum​

Select the enum as a field's type in any type picker — it appears alongside the dialect's built-in types.

:::warning Deleting a type in use If you delete a type that a field still references, validation flags an enum-type-missing error on that field. Repoint or remove the field first. :::

Sample enums​

The Acme Storefront sample defines three:

TypeValues
product_statusdraft, active, archived
order_statuspending, paid, shipped, cancelled
payment_methodcard, paypal, bank_transfer

These map to a native ENUM or a CHECK constraint in the generated SQL, depending on the dialect — see Export → SQL.