Chelabase
ManagementMerges

Start a schema merge between a branch and its parent

POST
/v1/databases/{id}/branches/{branch_id}/merges

into_parent merges the branch's schema changes into its parent; from_parent brings the parent's changes into the branch. Both branches must be ready and normal; main has no parent. The merge starts as computing: the worker reads both schemas and the branch point and fills in the analysis and the plan (poll getMerge until it is a draft). database is the Postgres database to merge (the branch's main one when omitted). One merge per pair and Postgres database can be open at a time.

Authorization

bearer
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Database id

Formatuuid
branch_id*string

The branch that merges with its parent

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

database?|

The Postgres database to merge; the branch's main one when omitted.

direction*Direction

Which way a merge goes.

Value in

  • "into_parent"
  • "from_parent"

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/databases/497f6eca-6276-4993-bfeb-53cbbbba6f08/branches/497f6eca-6276-4993-bfeb-53cbbbba6f08/merges" \  -H "Content-Type: application/json" \  -d '{    "direction": "into_parent"  }'
{  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "database": "string",  "direction": "into_parent",  "error": "string",  "failed_phase": "string",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "rebaselined": true,  "source_branch_id": "345f76de-8f9d-4a8f-b08e-a28a3db17483",  "status": "computing",  "target_branch_id": "2a8880d3-8c08-4fef-81e0-ec9d6c6def29",  "updated_at": "2019-08-24T14:15:22Z",  "version": 0}