Plan a migration (no apply)
litescope_migrate_planPlan a migration between two SQLite or D1 databases, preview the SQL, and get a blast-radius analysis classifying each operation as safe, risky, or destructive with estimated write-lock duration. Read-only.
Instructions
Plan a migration between two SQLite or D1 databases WITHOUT applying it. Returns the migration SQL plus a blast-radius analysis: each operation classified safe / risky / destructive, with an estimated write-lock duration for table rebuilds. Use this before applying any migration to a D1 database. Read-only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| new | Yes | Target ('after') source with the desired schema — Database source: a local file path (./app.db), a Cloudflare D1 DSN (d1://DB_ID when CLOUDFLARE_API_TOKEN+CLOUDFLARE_ACCOUNT_ID are set, or d1://TOKEN@ACCOUNT_ID/DB_ID), or a Turso DSN (turso://TOKEN@ORG/DB). | |
| old | Yes | Current ('before') source — Database source: a local file path (./app.db), a Cloudflare D1 DSN (d1://DB_ID when CLOUDFLARE_API_TOKEN+CLOUDFLARE_ACCOUNT_ID are set, or d1://TOKEN@ACCOUNT_ID/DB_ID), or a Turso DSN (turso://TOKEN@ORG/DB). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The migration SQL. | |
| operations | Yes | Each operation classified safe/risky/destructive with lock estimate. | |
| statements | Yes | Number of SQL statements in the plan. | |
| destructive | Yes | True if any operation drops or rewrites data. |