Skip to main content

Documentation Index

Fetch the complete documentation index at: https://planetscale.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

What this error means

DUPLICATE_ENUM_VALUE means an ENUM column definition contains the same value more than once. This can include duplicate empty-string values. A common error message is:
enum value '' occurs more than once.

Why PlanetScale rejects it

Enum values are stored internally by ordinal position. Duplicate values make the schema ambiguous and can cause unexpected behavior when comparing schemas, generating diffs, or applying deploy requests.

How to fix it

Remove the duplicate enum value from the column definition. Invalid:
CREATE TABLE shirts (
  id bigint unsigned NOT NULL,
  size enum('small', 'medium', 'medium', 'large') NOT NULL,
  PRIMARY KEY (id)
);
Valid:
CREATE TABLE shirts (
  id bigint unsigned NOT NULL,
  size enum('small', 'medium', 'large') NOT NULL,
  PRIMARY KEY (id)
);
If the duplicate values were meant to represent different labels, store distinct enum values and map display names in your application.

Need help?

Get help from the PlanetScale Support team, or join our Discord community to see how others are using PlanetScale.