---
raw: true
search:
  tags:
    - Database
    - POST
seo:
  description: >-
    Re-runs the live capsule's stored migration plan against the space's…
    Reference for the POST /v1/spaces/{spaceId}/db/migrate endpoint in the
    Spacefast API.
sidebar:
  label: Apply the live capsule's schema migrations
  badge: POST
title: Apply the live capsule's schema migrations
type: openapi-operation
---
Re-runs the live capsule's stored migration plan against the space's MySQL. Use this route to retry a plan that failed during publish. This route is Zero-kind only. A worker declares no schema, and a static version has no database. An empty plan queues nothing.

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

**Responses**

- `200` — Response for status 200
- `default` — Problem details (RFC 9457). Any 4xx/5xx response is one \`application/problem+json\` document.

Response example, 200:

```json
{
  "$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": 0,
      "completed": 0,
      "failed": 0
    },
    "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"
  }
}
```
