Apply a Project Database migration
apply_project_database_migrationApply an additive migration as its owner in one transaction. Destructive changes return migration_requires_admin_approval with the UI review URL; this tool cannot approve them. Retry the same additive migration ID after an uncertain outcome to reconcile without repeating committed SQL. Retry destructive migrations from their UI approval screen. Migration responses include request_review: adding unrelated tables preserves existing approvals; changes to referenced schema objects can interrupt affected Requests. Some changes still invalidate every Request on the datasource: a removed or changed function, a sequence no table owns, a new function whose name already resolves or is named by existing function code, or a stored schema fingerprint the Engine cannot recognize. After apply or an uncertain response, list migration history for recorded affected Requests, current policy states, and review URLs. If request_review.state is unavailable, the recorded migration outcome remains valid but its affected_requests is null; refresh history before resuming applications. Review stale approvals through existing Request review/update flows; do not automatically reapprove or retry application writes.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"datasource_id": "<datasource_id>",
"migration_id": "<migration_id>"
},
"name": "apply_project_database_migration"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| migration_id | Yes | ID returned by propose_project_database_migration | |
| datasource_id | Yes | Project Database datasource UUID | |
| application_id | No | Optional Application UUID whose build this call serves (Administrator only). Setup steps this call opens record it, so they show on that Application's build screen; the resources themselves stay shared by the Project. A shared step it reuses keeps the Application it was opened for, so a step it returns may be watchable with get_setup_journal only without application_id. Use the build's application_id, the one you call describe_application with. |