Skip to main content
Deletion protection blocks anyone from deleting a database or branch until an administrator turns protection off. Use it to add an explicit step before a destructive delete. For an additional safeguard that requires two administrators to approve a delete, see Require multiple administrators for deletion.

Protect a database

Organization Administrators and Database Administrators can enable protection from the database Settings page.
1
From the PlanetScale organization dashboard, select the database
2
Open Settings
3
Turn on Prevent database deletion
While protection is on, delete attempts are blocked until you disable protection. Turning protection off does not delete the database. You can also set database deletion protection with the Update database settings API (deletion_protected).

Protect a branch

Individual branches can be protected separately from the database. Enable Prevent branch deletion when you create a branch, or later from the branch page. From the PlanetScale CLI:
You can also set branch deletion protection with the Update a branch API (deletion_protected). Terraform can enforce the same safeguard with deletion_protected on Neki branches, or with lifecycle { prevent_destroy = true } on other branch resources. See Deletion protection in the Terraform documentation.

Need help?

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