Compare & Diff
Processed locally
Database Schema Diff + Migration Helper
Compare two sets of CREATE TABLE DDL and get a classified change report plus ALTER migration hints — in your browser.
Auto-runs as you type. Ctrl+Enter to re-run.
How to use the Database Schema Diff + Migration Helper
Paste two versions of your schema as CREATE TABLE DDL — the old baseline and the new target — and instantly see which tables and columns were added, dropped, or changed, classified by severity. The tool also drafts ALTER migration statements so you can move from one schema to the other. Both scripts are parsed and compared entirely in your browser; nothing is uploaded.
What it does
- Parses table names, columns, types, NOT NULL, DEFAULT, and primary keys.
- Detects dropped tables/columns (breaking), type and nullability changes (risky), and additions (safe).
- Generates ADD COLUMN, DROP COLUMN, ALTER COLUMN TYPE, and SET/DROP NOT NULL statements.
- Handles quoted/backtick identifiers and parenthesised types like
NUMERIC(10,2).
When to use it
- Reviewing a schema change in a pull request.
- Drafting a migration between two database versions.
- Checking what changed between a dev and prod schema dump.
- Auditing a vendor or ORM-generated schema change.
How to use it
- Paste the old schema DDL on the left and the new schema DDL on the right.
- Read the severity summary and the grouped change report.
- Copy the migration hints and adapt them to your database dialect.
Tips & pitfalls
- Adding a NOT NULL column without a default needs a backfill — the tool flags it as risky.
- Type changes may require an explicit cast; the generated
ALTER ... TYPEis a starting point. - Foreign keys, indexes, and check constraints are not yet diffed.
FAQ
- What DDL does the schema diff understand? Paste one or more CREATE TABLE statements per side. The tool parses table names, columns, types (including sizes), NOT NULL, DEFAULT, and primary keys, then diffs the two schemas. Foreign keys and indexes are not yet compared.
- Are the generated migrations safe to run directly? Treat them as a starting point. The ALTER statements are dialect-neutral hints; type changes and adding a NOT NULL column usually need a data cast or a backfill, so review and test them against your database before running.
- Is my schema uploaded anywhere? No. Both DDL scripts are parsed and compared entirely in your browser. Nothing is sent to any server.