PlanetScale deploy request failed for a schema change in CI
PlanetScale applies schema changes by opening a deploy request from a branch into a base branch. In CI the request can fail if the branch has no diff, the branch is out of date with the base, or the deploy request cannot be created against a missing branch.
What this error means
A "pscale deploy-request create" or "deploy-request deploy" step fails with "no schema changes to deploy", "branch is out of date", or "deploy request cannot be deployed".
Error: cannot create deploy request: branch "pr-123" has no schema changes
compared to base branch "main"Common causes
No schema diff between branch and base
The migration never actually changed the branch schema, so there is nothing to deploy and the request cannot be created.
The branch is behind the base branch
The base changed after the branch was cut, leaving the deploy request unmergeable until the branch is refreshed.
How to fix it
Apply the migration on the branch, then open the request
- Run your migration tool against the branch connection so the schema actually changes.
- Create the deploy request from the branch into main.
- Deploy it, or gate the workflow on its approval.
pscale deploy-request create app "pr-${{ github.event.number }}" --org "$PLANETSCALE_ORG"Refresh the branch schema from base
If the branch is out of date, refresh it from the base branch so the deploy request becomes deployable.
pscale branch refresh-schema app "pr-${{ github.event.number }}" --org "$PLANETSCALE_ORG"How to prevent it
- Run the migration against the branch before creating the deploy request.
- Refresh the branch from base when the base has moved on.
- Gate deploys on deploy-request approval rather than auto-deploying.