Skip to main content
A deploy request can fail while copying a table because existing rows do not fit the new schema. PlanetScale copies the table in the background and inserts those rows into a new table that uses the deployed schema. If that schema makes a column NOT NULL and a row still has NULL in the column, the copy stops:
The column name in quotes is the one to fix. The rest of the message is the insert that failed. The copy runs while your application keeps writing to the table. If the application inserts or updates a row with NULL in that column during the copy, the deploy fails with a slightly different message:
In that case the application is still writing NULL. Update it to always set the column before retrying.

How to fix it

Update the rows that still have NULL in that column, then retry the failed tables.
Use a value that is valid for the new column. Retrying before those rows are updated again will cause another failure. Retry starts the migration for the failed table over again. Tables in the same deploy that already finished copying are left as they are.

Need help?

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