Use this API to mark GitLab database migrations as successful, so that a deployment can proceed without re-running them.
These endpoints are available for GitLab Self-Managed and require administrator access to the instance.
List all pending migrations
GET /api/v4/admin/migrations/pending
Lists all pending migrations for the instance.
Parameters
| Name | Type | Description |
|---|---|---|
databaseQuery | String | The name of the database Allowed values: main,ci,secDefault: main |
Responses
| Code | Description | Schema |
|---|---|---|
200 | 200 OK | — |
400 | Bad Request | — |
401 | 401 Unauthorized | — |
403 | 403 Forbidden | — |
Update status of a migration
POST /api/v4/admin/migrations/{timestamp}/mark
Updates the status of a migration to indicate a successful execution. This prevent them from being executed by the db:migrate tasks. Use this API to skip failing migrations after you determine they are safe to skip.
Parameters
| Name | Type | Description |
|---|---|---|
timestampPath, | Integer | The migration version timestamp |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
database | String | The name of the database Allowed values: main,ci,secDefault: main |
Responses
| Code | Description | Schema |
|---|---|---|
201 | 201 Created | — |
400 | Bad Request | — |
401 | 401 Unauthorized | — |
403 | 403 Forbidden | — |
404 | 404 Not found | — |
422 | You can mark only pending migrations | — |