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
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.
How to fix it
Add a primary key or a unique key over columns that are all declaredNOT NULL.
NULL values, fix the data first, then make the column NOT NULL, then add the unique key. For large tables, split those steps into separate deploy requests.
TEXT, BLOB, or prefix index, use a surrogate key such as a bigint or UUID column instead.

