Enable safe migrations on a production branch

branches

// what it does

Turns on safe migrations for a Vitess production branch: direct DDL (ALTER/CREATE/DROP) is rejected, forcing every schema change through a deploy request with its linting, review, online rollout, and revert window. This is the guard rail that makes the whole PlanetScale workflow safe.

// shell

$ pscale branch safe-migrations enable mydb main
$ pscale branch safe-migrations disable mydb main

// gotcha

With safe migrations on, your ORM's auto-migrate (drizzle-kit push, prisma db push, Rails migrate against prod) will fail by design — point those tools at a dev branch and let a deploy request carry the change to production.

// resources