OriginChainDB
Database endpoints

Start a schema migration

Start a background migration that changes an existing table's schema.

POST /v1/tenants/{tenant}/migrations

Begin a change to an existing tableAccepted changes still need progress checks and cutover.
  1. Describe the schema changeSupply the table and ordered changes.
  2. Submit the migrationKeep the returned migration ID.
  3. Follow progress to cutoverPending does not mean the table has switched.

Before you start

Use your database bearer token.

Connection setup

Register the table first. Only one schema migration can be active on a table; keep the returned ID to check its progress.

Path parameters

FieldTypeRequired
tenantstringRequired

Headers

FieldTypeRequiredDescription
x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key.
x-oc-db-keystringOptionalAPI key of the x-oc-db-user user.

Request body

application/json

Limits and accepted values
  • schema is the table id;
  • diff is applied in order.
  • A second migration on a table that already has one in flight answers 400.
FieldTypeRequired
diffobject[]Required
Fields in diff
FieldTypeRequired
AddColumnobjectOptional
Fields in AddColumn
FieldTypeRequired
defaultany JSONOptional
namestringRequired
tystringRequired
FieldTypeRequired
ChangeColumnTypeobjectOptional
Fields in ChangeColumnType
FieldTypeRequired
namestringRequired
new_tystringRequired
FieldTypeRequired
ChangeExtractionPathobjectOptional
Fields in ChangeExtractionPath
FieldTypeRequired
namestringRequired
new_pathstringRequired
FieldTypeRequired
DropColumnobjectOptional
Fields in DropColumn
FieldTypeRequired
namestringRequired
FieldTypeRequired
RenameColumnobjectOptional
Fields in RenameColumn
FieldTypeRequired
fromstringRequired
tostringRequired
FieldTypeRequired
SetColumnDefaultobjectOptional
Fields in SetColumnDefault
FieldTypeRequired
defaultany JSONOptional
namestringRequired
FieldTypeRequired
SetColumnNullabilityobjectOptional
Fields in SetColumnNullability
FieldTypeRequired
namestringRequired
requiredbooleanRequired
FieldTypeRequired
schemastringRequired

Read the result

Save the returned migration id. Pending means the migration was accepted, not that the table has switched to its new shape. Check progress and perform cutover when ready.

Response statuses

HTTP status reference
StatusWhat to do
200OK
400Correct the request before retrying.
401Check the credential and Authorization header.
402Check feature access or available credits.
403Check tenant access, roles and permissions.
404Check the resource ID and API route.
409Resolve the conflict before retrying.
413Split or reduce the request body.
415Send the required Content-Type.
422Correct the values or unsupported combination.
429Honor Retry-After when present; back off.
500Check the outcome before retrying a write.
501Check deployment support for this operation.
503Honor Retry-After when present; check write outcomes.
© 2026 Silicoyn Technologies Pvt Ltd