What this error means
NO_UNIQUE_KEY means a table does not have a usable unique, not-null key. A PRIMARY KEY satisfies this requirement. A UNIQUE KEY can also satisfy it if every indexed column is NOT NULL and the key does not use a text/blob column or a prefix index.
A common error message is:
Why PlanetScale rejects it
PlanetScale uses Vitess online schema change workflows to apply changes without downtime. Those workflows need a stable row identity while copying and reconciling data. Nullable unique keys do not qualify because MySQL allows multipleNULL values in a unique index.
Without a primary key or a NOT NULL unique key, InnoDB uses an internal hidden row ID that is assigned independently on each MySQL instance, so it is not a shared identity across PRIMARY, REPLICA, and RDONLY tablets. Online DDL (VReplication) also needs a shared unique key between the source and target schemas, so adding the first primary key to a keyless table fails with found no possible unique key.
How to fix it
Define a primary key when you create the table. APRIMARY KEY satisfies the unique, not-null key requirement.
TEXT, BLOB, or prefix index, use a surrogate key such as a bigint or UUID column instead.
Related docs
- Changing primary and unique keys
- Tables without a primary key
- How online schema change tools work
- Safe migrations

