Schema Diff
The schema diff tool compares two ER diagram versions — old and new — and produces a structured list of changes. Use it to review schema evolution between diagram versions, catch destructive changes before deployment, or generate a checklist for a migration script.
How to Use
- Go to the Diff page.
- Paste your old diagram in the left panel and your new diagram in the right panel.
- Select the diagram type for each (Mermaid or PlantUML). You can diff across formats.
- Click Compare to see the change list.
Change Operations
| Op | Description | Destructive? |
|---|---|---|
CREATE_TABLE | New table added | No |
DROP_TABLE | Table removed | Yes |
ADD_COLUMN | Column added to existing table | No |
DROP_COLUMN | Column removed from existing table | Yes |
ALTER_COLUMN | Column type or nullability changed | Yes |
ADD_FK | Foreign key relationship added | No |
DROP_FK | Foreign key relationship removed | No |
Response Format
The diff result contains a summary and a changes array.
erDiagram
USER {
int id PK
string name
string email
}erDiagram
USER {
int id PK
string name
string phone
}
PRODUCT {
int id PK
string sku UK
}{
"changes": [
{
"op": "DROP_COLUMN",
"table": "USER",
"column": "email",
"destructive": true,
"description": "Drop column email from table USER"
},
{
"op": "ADD_COLUMN",
"table": "USER",
"column": "phone",
"destructive": false,
"description": "Add column phone to table USER"
},
{
"op": "CREATE_TABLE",
"table": "PRODUCT",
"destructive": false,
"description": "Create table PRODUCT"
}
],
"summary": {
"total": 3,
"additions": 2,
"deletions": 1,
"modifications": 0,
"destructiveCount": 1
}
}Destructive Changes
Any change that would cause data loss in a live database is flagged as destructive:
DROP_TABLE— all data in the table is lostDROP_COLUMN— all data in the column is lostALTER_COLUMN— type change may lose data or require a conversion
The web UI highlights destructive changes in red. The summary.destructiveCount field in the API response lets you fail CI builds that contain destructive changes.
Cross-Format Diff
You can compare a Mermaid diagram against a PlantUML diagram. Both parsers produce the same intermediate Schema model, so the diff is format-agnostic.
API Endpoint
See the API Reference for the full POST /v1/diff spec.