POST
/
organizations
/
{organization}
/
databases
/
{database}
/
branches
/
{name}
/
safe-migrations
Enable safe migrations for a branch
curl --request POST \
  --url https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/branches/{name}/safe-migrations \
  --header 'Authorization: <api-key>'
{
  "id": "<string>",
  "name": "<string>",
  "created_at": "<string>",
  "updated_at": "<string>",
  "deleted_at": "<string>",
  "restore_checklist_completed_at": "<string>",
  "schema_last_updated_at": "<string>",
  "kind": "mysql",
  "mysql_address": "<string>",
  "mysql_edge_address": "<string>",
  "state": "pending",
  "vtgate_size": "<string>",
  "vtgate_count": 123,
  "cluster_name": "<string>",
  "cluster_iops": 123,
  "ready": true,
  "schema_ready": true,
  "metal": true,
  "production": true,
  "safe_migrations": true,
  "sharded": true,
  "shard_count": 123,
  "stale_schema": true,
  "actor": {
    "id": "<string>",
    "display_name": "<string>",
    "avatar_url": "<string>"
  },
  "restored_from_branch": {
    "id": "<string>",
    "name": "<string>",
    "created_at": "<string>",
    "updated_at": "<string>",
    "deleted_at": "<string>"
  },
  "private_edge_connectivity": true,
  "has_replicas": true,
  "has_read_only_replicas": true,
  "html_url": "<string>",
  "url": "<string>",
  "region": {
    "id": "<string>",
    "provider": "<string>",
    "enabled": true,
    "public_ip_addresses": [
      "<string>"
    ],
    "display_name": "<string>",
    "location": "<string>",
    "slug": "<string>",
    "current_default": true
  },
  "parent_branch": "<string>"
}

Authorizations

Authorization
string
header
required

Path Parameters

organization
string
required

The name of the organization the branch belongs to

database
string
required

The name of the database the branch belongs to

name
string
required

The name of the branch

Response

Returns the branch with safe migrations enabled

id
string
required

The ID of the branch

name
string
required

The name of the branch

created_at
string
required

When the branch was created

updated_at
string
required

When the branch was last updated

deleted_at
string
required

When the branch was deleted

restore_checklist_completed_at
string
required

When a user last marked a backup restore checklist as completed

schema_last_updated_at
string
required

When the schema for the branch was last updated

kind
enum<string>
required

The kind of branch

Available options:
mysql,
postgresql
mysql_address
string
required

The MySQL address for the branch

mysql_edge_address
string
required

The address of the MySQL provider for the branch

state
enum<string>
required

The current state of the branch

Available options:
pending,
sleep_in_progress,
sleeping,
awakening,
ready
vtgate_size
string
required

The size of the vtgate cluster for the branch

vtgate_count
number
required

The number of vtgate instances in the branch

cluster_name
string
required

The SKU representing the branch's cluster size

cluster_iops
number
required

IOPS for the cluster

ready
boolean
required

Whether or not the branch is ready to serve queries

schema_ready
boolean
required

Whether or not the schema is ready for queries

metal
boolean
required

Whether or not this is a metal database

production
boolean
required

Whether or not the branch is a production branch

safe_migrations
boolean
required

Whether or not the branch has safe migrations enabled

sharded
boolean
required

Whether or not the branch is sharded

shard_count
number
required

The number of shards in the branch

stale_schema
boolean
required

Whether or not the branch has a stale schema

actor
object
required
restored_from_branch
object
required
private_edge_connectivity
boolean
required

True if private connections are enabled

has_replicas
boolean
required

True if the branch has replica servers

has_read_only_replicas
boolean
required

True if the branch has read-only replica servers

html_url
string
required

Planetscale app URL for the branch

url
string
required

Planetscale API URL for the branch

region
object
required
parent_branch
string
required

The name of the parent branch from which the branch was created