Skip to content
Latchkey

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".

pscale
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

  1. Run your migration tool against the branch connection so the schema actually changes.
  2. Create the deploy request from the branch into main.
  3. Deploy it, or gate the workflow on its approval.
Terminal
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.

Terminal
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.

Frequently asked questions

What causes "pscale deploy request failed"?
The migration never actually changed the branch schema, so there is nothing to deploy and the request cannot be created.
How do I fix pscale deploy request failed?
Apply the migration on the branch, then open the request

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card