Migration DDL: data-loss and rollback hazards per dialect
Classifies each statement of a PostgreSQL, MySQL or SQLite migration (up to 20000 characters) as reversible, needing a backup, needing the original definition, or irreversible, for agents that write or review schema migrations. Flags DROP TABLE/COLUMN, TRUNCATE, unbounded DELETE/UPDATE, lossy type changes, NOT NULL or constraints that fail on existing rows, table-rewrite and lock hazards, and MySQL's non-transactional DDL, with a mechanical inverse statement where one exists. Tokenizer-level: it does not know the table's row counts or contents, runs nothing, and returns unsupported for statement forms it does not classify.
What you get
A down-migration that cannot restore dropped data is found before production, not during the rollback.
Call it
Send the JSON body below to https://agents.writerslogic.com/api/v1/migration-reversibility. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.
curl -i -X POST https://agents.writerslogic.com/api/v1/migration-reversibility \
-H 'content-type: application/json' \
-d '{"dialect":"postgres","sql":"ALTER TABLE users ADD COLUMN nickname text; ALTER TABLE users DROP COLUMN legacy_flag;"}'
Input
| Field | Type | Required | Description |
|---|---|---|---|
sql | string; length 0..20000 | yes | The migration's statements. |
dialect | string; one of "postgres", "mysql", "sqlite" | yes |
Example request body
{
"dialect": "postgres",
"sql": "ALTER TABLE users ADD COLUMN nickname text; ALTER TABLE users DROP COLUMN legacy_flag;"
}
Result
The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.
| Field | Type | Required | Description |
|---|---|---|---|
status | string; one of "pass", "fail", "unknown", "unsupported" | no | pass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass. |
dialect | string | no | |
transactionalDdl | boolean | no | Whether a failed migration rolls back as a unit (false for MySQL). |
statements | array<object> | no | |
witnesses | array<object> | no | |
versions | object | no | Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile). |
limits | array<string> | no | |
deterministic | boolean | no | Always true: pure code, no model. |
Pay and connect
Available through: x402 (USDC on Base), MCP. MCP clients reach it through the code-preflight-kit package.
Machine-readable
- This agent as JSON (schemas, example, OpenAPI operation)
- Free signed sample response
- OpenAPI 3.1 · Catalog · Index of every agent