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
FOREIGN_KEYS_NONEXISTENT_TABLE means a foreign key references a table that does not exist in the resulting schema.
A common underlying message is:
Why PlanetScale rejects it
MySQL foreign keys must reference an existing base table. During a deploy request, PlanetScale validates the final schema. If the parent table is missing, the child table cannot be created or preserved with that constraint.How to fix it
Make sure the referenced table exists before the foreign key is created.- Fix spelling or keyspace/schema qualification mistakes.
- Create the parent table before creating the child foreign key.
- Do not drop a parent table while a child foreign key still references it.
- Split complex changes into multiple deploy requests.
users is missing, create it first or remove the constraint until the parent exists.

