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

NameTypeDescription
database
Query
StringThe name of the database
Allowed values: main, ci, sec
Default: main

Responses

CodeDescriptionSchema
200200 OK—
400Bad Request—
401401 Unauthorized—
403403 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

NameTypeDescription
timestamp
Path, required
IntegerThe migration version timestamp

Request body (application/json)

PropertyTypeDescription
databaseStringThe name of the database
Allowed values: main, ci, sec
Default: main

Responses

CodeDescriptionSchema
201201 Created—
400Bad Request—
401401 Unauthorized—
403403 Forbidden—
404404 Not found—
422You can mark only pending migrations—