Apply the saved migration files to a database
database_migrateApply the migration files at commit_sha to the project's selected Dev or Prod database, provisioning it if needed. Dev requires active Paid access. Prod and Dev with shared data require publication permission. Shared Dev and Prod use the same database. The job skips applied files, rejects edits to applied files and changes the database without building, deploying or publishing. Missing migrations, noncanonical filenames and missing database configuration are rejected before queuing. Returns an operation that starts within about a minute. A failed file is identified in error.migration. A job ending in database_migrate_unavailable leaves no partially applied file. Requires confirm: true.
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": {
"project_id": "<project_id>",
"idempotency_key": "<idempotency_key>",
"environment": "<environment>",
"commit_sha": "<commit_sha>",
"confirm": "<confirm>"
},
"name": "database_migrate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | Yes | ||
| commit_sha | Yes | The saved version whose migration files are applied. | |
| project_id | Yes | Project identifier. | |
| environment | Yes | ||
| idempotency_key | Yes | Identifies one mutation and its canonical request payload. |