SQL Table Diff
Compare two CREATE TABLE definitions — see added, removed, and changed columns, indexes, and constraints.
About SQL Table Diff
Comparing two versions of a CREATE TABLE definition is essential during database migrations, schema reviews, and DevOps deployments. This tool parses both CREATE TABLE statements, extracts the column definitions and their properties, then produces a diff showing exactly which columns were added, removed, or had their type/constraints changed.
It also generates the corresponding ALTER TABLE statements needed to migrate from Schema A to Schema B — ready to use in your database migration scripts. This saves significant time when reviewing database migration PRs and ensures no column changes are missed during deployment.
FAQ
Can I diff indexes and constraints too?
Yes. The tool compares column definitions including types, NULL constraints, defaults, and AUTO_INCREMENT/SERIAL. Index and foreign key differences appear in the diff when they are defined inline in the CREATE TABLE statement.
Does SQLite support ALTER TABLE?
SQLite has very limited ALTER TABLE support — only ADD COLUMN and RENAME TABLE/COLUMN are supported. It does not support DROP COLUMN, MODIFY COLUMN, or ADD CONSTRAINT. For complex migrations in SQLite, the standard approach is to create a new table, copy data, drop the old table, and rename the new one.