Cosmovex Tools

Changed your schema? Paste both versions and get an ALTER migration that has been run against a real Postgres.

What Schema Diff Studio does

Paste two versions of your Postgres or SQLite schema and get the ALTER migration, checked in a real database running in your browser.

Hand-written migrations miss things: an index that existed on staging but never made it into a migration, a default that changed, a column that quietly became nullable, a foreign key whose ON DELETE rule is different in production. Schema Diff Studio compares the schema you have with the schema you want and writes the ALTER script for you.

Paste both versions as plain DDL. pg_dump --schema-only output works as it comes: SET lines, OWNER TO, GRANT and REVOKE, psql meta-commands and sequence values are set aside and listed, so nothing is silently dropped. For SQLite, paste the output of sqlite3 .schema or open the .sqlite or .db file directly; only the schema is read, never the rows.

Instead of guessing at SQL with a parser, the tool runs each schema in a real database inside your tab: Postgres 18 compiled to WebAssembly (PGlite) or SQLite (sql.js). It then reads the catalog, so what you compare is exactly what Postgres or SQLite understood, including defaults, identity and serial columns, generated columns, partial indexes and check constraints.

The migration is ordered so it runs: new enum values first, then new tables, column changes, constraints and indexes, foreign keys, views and triggers, with drops last. Risky steps are flagged rather than guessed. A type change is marked 'review manually', and a column that disappeared next to a similar new one is offered as a RENAME you can switch on, because the default DROP plus ADD would lose the data.

Every migration is checked before you see the word Verified. The tool applies your Before schema and then the generated script to a fresh database, reads the catalog again and compares it with After. If anything still differs, you get the exact list. The rollback script is checked the same way in the other direction.

Every comparison is saved as a project in this browser's storage, as many as you like, with the ER diagram layout you arranged. Pro ($29 once) adds a version timeline with one-click next migrations, diffs between any two versions, a numbered migration file bundle, read-only share links, schema groups on the diagram and a printable change report.

Database postgres schema diff compare two postgres schemas onlinegenerate alter table from schema diffsql schema compare tool onlineer diagram from postgres ddlsqlite schema diagram online
Open Schema Diff Studio

Free vs Pro

Feature Free $0 · no account Pro $29 one-time · 3 browsers
Paste or open Postgres DDL (pg_dump --schema-only works: SET, OWNER TO, GRANT and psql lines are set aside with a visible list) or SQLite DDL, or open a .sqlite/.db file Included Included
Each schema is executed in a real in-browser database (PGlite or sql.js) and read back from its catalog, so there is no hand-written parser to get things wrong Included Included
Changes grouped per table: tables, columns, types, defaults, NULLs, primary keys, foreign keys, unique and check constraints, indexes, enums, views, functions, triggers, sequences, partitions, row-level security and policies Included Included
Ordered ALTER migration plus a rollback script; type changes and probable renames are flagged 'review manually' with a ready RENAME line you can switch on Included Included
Verified: the migration is applied to Before in a fresh database and compared with After, so you see 'Verified' or exactly what still differs Included Included
SQLite: ADD COLUMN where SQLite allows it, the documented table rebuild where it does not Included Included
ER diagram with auto-layout and drag to arrange (positions saved); export PNG, SVG, Mermaid or a Markdown data dictionary Included Included
Download the migration and the rollback as .sql; unlimited saved projects in this browser (one saved version each), no login Included Included
Version timeline per project: every new dump becomes v2, v3… with a note, and the next migration is generated and verified in one click — Pro
Diff and migration between any two saved versions — Pro
Migration file bundle (.zip): numbered, timestamped up and down .sql files for every version step, with a verification README — Pro
Read-only share link to a project's diagram and version history (opt-in upload of the schema text only, never data; turn it off any time) — Pro
Diagram groups: a labelled, coloured frame per schema namespace — Pro
Printable change report: summary, flagged items, verification result, migration and rollback — Pro

Pro is $29, paid once. Checkout and the licence key are handled by Dodo Payments (merchant of record). By buying you agree to the Terms and Privacy Policy.

Questions

Is Schema Diff Studio free?

Yes, with no account and no install. The free plan includes: Paste or open Postgres DDL (pg_dump --schema-only works: SET, OWNER TO, GRANT and psql lines are set aside with a visible list) or SQLite DDL, or open a .sqlite/.db file; Each schema is executed in a real in-browser database (PGlite or sql.js) and read back from its catalog, so there is no hand-written parser to get things wrong; Changes grouped per table: tables, columns, types, defaults, NULLs, primary keys, foreign keys, unique and check constraints, indexes, enums, views, functions, triggers, sequences, partitions, row-level security and policies; Ordered ALTER migration plus a rollback script; type changes and probable renames are flagged 'review manually' with a ready RENAME line you can switch on; and 4 more. Pro ($29, paid once) adds: Version timeline per project: every new dump becomes v2, v3… with a note, and the next migration is generated and verified in one click; Diff and migration between any two saved versions; Migration file bundle (.zip): numbered, timestamped up and down .sql files for every version step, with a verification README; Read-only share link to a project's diagram and version history (opt-in upload of the schema text only, never data; turn it off any time); and 2 more.

Does Schema Diff Studio upload my data?

Only if you create a share link. Comparing, verifying and diagrams run in your browser and projects stay in this browser's storage. A read-only share link (Pro) uploads the schema text of the project's versions and its diagram layout, never table data, to Google Firebase in the United States; anyone with the link can read it until you turn it off. See the Privacy Policy for retention and deletion.

Do I need to install anything?

No. Open the page and start working. It works on desktop and mobile browsers.

How does the Pro licence work?

You pay once and receive a licence key by email from Dodo Payments (our merchant of record). Paste it under "Have a key?" inside the tool. One key works on up to 3 browsers; you can release a browser at any time to use the key elsewhere.

Is my schema uploaded?

No. Postgres DDL runs inside PGlite (Postgres compiled to WebAssembly) in your tab, and SQLite inside sql.js. Parsing, diffing, verification, diagrams and exports all happen on your device, and projects are kept in this browser's IndexedDB. The only exception is a read-only share link (Pro), which you create on purpose: it uploads the schema text of that project's versions and its diagram layout, never data, and you can turn it off at any time.

Which dialects are supported?

PostgreSQL (pg_dump --schema-only output or hand-written DDL) and SQLite (.schema output, DDL, or a .sqlite/.db file). MySQL is not supported yet; the tool tells you when a paste looks like MySQL instead of failing on it.

Does it handle renames?

It never guesses. When a column disappears and a similar one with a compatible type appears in the same table, the default script uses DROP plus ADD and flags a probable rename with a ready RENAME COLUMN line. Tick 'Use RENAME' and the migration is regenerated and verified again.

What does Verified mean?

Your Before schema is executed in a fresh in-browser database, the generated migration is applied, and the resulting catalog is compared with your After schema: tables, columns, types, defaults, nullability, constraints, indexes, enums, views, functions, triggers, sequences, partitions, row-level security and policies. Verified means they match exactly; otherwise the remaining differences are listed.

How are SQLite changes handled?

SQLite can only add or rename columns in place. Where a change needs more (a new NOT NULL rule, a changed foreign key, a dropped column), the script uses SQLite's documented rebuild: create the new table, copy the rows, drop the old one, rename, and recreate its indexes, triggers and views, with foreign keys switched off for the duration.

What is not compared?

Domains, composite and range types and aggregates are detected and listed as not compared rather than ignored silently. Column order is not treated as a difference, because Postgres cannot reorder columns without rebuilding the table. Extensions the in-browser Postgres cannot load, such as PostGIS, are named in the error when a statement needs them.

Is Pro a subscription?

No. Pro is $29 once and works in up to 3 browsers. The free tier keeps full diffs, migrations, verification, diagrams, exports and unlimited saved projects, with no limit on how many comparisons you run.