> branches
PlanetScale's signature feature: database branches that work like git branches. Spin up an isolated copy of your schema (optionally with data), develop against it, diff it, lint it, and promote it — all without touching production. These commands drive the daily loop: create a branch per feature, iterate, then hand it to a deploy request.
// branches
14 commands$ pscale branch create mydb add-users-table$ pscale branch create mydb add-users-index --from add-users-table$ pscale branch create mydb test-migration --seed-data$ pscale branch create mydb ci-check-$GITHUB_RUN_ID --wait$ pscale branch list mydb$ pscale branch show mydb add-users-table$ pscale branch schema mydb add-users-table$ pscale branch diff mydb add-users-table$ pscale branch lint mydb add-users-table$ pscale branch promote mydb main$ pscale branch demote mydb old-prod$ pscale branch safe-migrations enable mydb main$ pscale branch delete mydb add-users-table$ pscale branch switch add-users-table --database mydb// faq
Does a new branch copy my production data?
No — by default a branch copies only the schema of its parent, starting with empty tables. Pass --seed-data at creation to use Data Branching, which clones the parent's data into the branch (billed at the parent's cluster size), or --restore <backup-id> to hydrate a branch from a specific backup.
What's the difference between a development and a production branch?
A production branch is highly available, backed up daily, and (on Vitess) protected from direct DDL when safe migrations are on — schema changes must arrive via deploy requests. Development branches are cheap, disposable copies for iterating. `pscale branch promote` upgrades a branch to production; `demote` reverses it.
Why can't I run ALTER TABLE directly on main?
Safe migrations. When enabled on a production branch (`pscale branch safe-migrations enable`), direct DDL is rejected so every schema change flows through a deploy request — which gives you linting, review, non-blocking rollout, and a revert window. Disable it only on throwaway databases.