Apply the live capsule's migration plan - Spacefast Docs

Apply the live capsule's migration plan

Queues the live capsule’s declared migration plan against the Space’s database and returns the plan with an operation to poll. Use it to retry a plan that did not apply during publish; the plan is pinned to the version live at the time of the call, so a later publish cannot redirect the retry. An empty plan queues nothing and answers queued: false. Requires versions:promote, and only a Zero capsule declares a plan: a worker returns runtime_kind_mismatch and a Space with no database returns db_not_available.

POST /v1/spaces/{spaceId}/db/migrate

Authorization

Authorization Bearer token · header required

Authorization: Bearer <key> with the Space key (sfc_ prefix) of an unclaimed Space. The same key is the fragment of the claim URL and the token in the Space's /__/ <key> sign-in URL.

or

Authorization Bearer token · header required

Authorization: Bearer <token> with an API key (sfa_ prefix), an OAuth access token, a session token, or a Space machine credential (sfm_ prefix).

Path parameters

spaceId string required

Responses

200 Response for status 200

$schema string

Canonical JSON Schema URL for this response body. The server also sends it in the Link: rel="describedby" response header.

data object required

200default

{
  "$schema": "http://example.com",
  "data": {
    "versionId": "string",
    "runtimeKind": "zero",
    "schemaHash": "string",
    "operations": [
      {  
        "op": "create_table",
        "table": "string"  
      }
    ],
    "queued": true
  },
  "operation": {
    "id": "string",
    "kind": "string",
    "status": "queued",
    "resources": [
      {  
        "type": "string",
        "id": "string"
      }
    ],
    "progress": {
      "total": 9007199254740991,
      "completed": 9007199254740991,
      "failed": 9007199254740991
    },
    "diagnostics": [
      {
        "code": "string",
        "severity": "info",
        "message": "string",
        "path": "string",
        "provider": "infra",
        "details": {
          "property1": null,
          "property2": null
        },
        "fix": "string",
        "retryable": true
      }
    ],
    "createdAt": "2019-08-24T14:15:22Z",
    "finishedAt": "2019-08-24T14:15:22Z"
  }
}
{
  "$schema": "http://example.com",
  "type": "string",
  "title": "string",
  "status": -9007199254740991,
  "detail": "string",
  "code": "string",
  "pointer": "string",
  "details": {
    "property1": null,
    "property2": null
  },
  "suggestions": [
    "string"
  ],
  "next": [
    "string"
  ],
  "requestId": "string"
}