Skip to main content
Products -> ERDPricingDocsBlogSign in한국어Start with ERD

Enums

Enums define a fixed set of allowed values for a column. They are useful for status fields, categories, roles, and any column that should only accept a predefined list of options.


Create an enum

  1. Open the Enums tab in the left sidebar
  2. Click + Add Enum
  3. Enter the enum name (e.g., status, role, priority)
  4. Add values — each value represents one allowed option

The new enum appears in the Enums tab list and becomes available as a column type.


Enum properties

PropertyDescription
NameThe enum type name (e.g., order_status, user_role)
SchemaOptional schema prefix
ValuesOrdered list of allowed values

Managing values

  • Click + Add Value to append a new value to the list
  • Each value has a name field (e.g., active, inactive, pending)
  • Click the delete icon next to a value to remove it
  • Drag values to reorder them

Use an enum as a column type

Once an enum is created, you can reference it as a column type:

  1. Open a table in the edit panel
  2. Add or edit a column
  3. In the Type field, type the enum name (e.g., order_status)
  4. The autocomplete dropdown shows matching enums — select the one you want

The column type is now linked to the enum. On the canvas, the column displays the enum type name.


Edit an enum

Click on any enum in the Enums tab to open its editor. You can:

  • Rename the enum
  • Add, remove, or reorder values
  • Changes are saved as you edit

Delete an enum

  1. Select the enum in the Enums tab
  2. Click the Delete button
caution

Deleting an enum does not automatically update columns that reference it. Those columns will retain the enum name as a plain text type string. Update or reassign those column types manually after deletion.


Example

A typical order_status enum:

Value
pending
confirmed
shipped
delivered
cancelled

Referenced by the orders.status column with type order_status.


Tips

  • Use descriptive enum names that indicate the domain — payment_method is clearer than method
  • Keep enum values lowercase and consistent (e.g., snake_case or UPPER_CASE — pick one convention)
  • Enums are especially useful for columns that drive application logic (status machines, role-based access, configuration flags)
  • If you import a schema via SQL or DBML, existing enum definitions are automatically parsed and created