SQL Schema Diff
Paste an old and a new set of CREATE TABLE statements and get the list of differences and the ALTER statements that turn the old schema into the new one.
- Free
- No sign-up
- Works on any device
About SQL Schema Diff
When a database changes, you need the statements that move the old schema to the new one. Paste both sets of CREATE TABLE and CREATE INDEX statements. The tool lists new and removed tables, added, removed and changed columns (type, NOT NULL, default), primary key, unique and foreign key changes, and indexes, then writes ALTER statements for MySQL, PostgreSQL, SQL Server, SQLite or Oracle. Example: VARCHAR(50) becoming VARCHAR(100) gives ALTER COLUMN name TYPE VARCHAR(100) in PostgreSQL and MODIFY COLUMN in MySQL.
How to use SQL Schema Diff
- Choose the database whose ALTER syntax you need.
- Paste the old schema and the new schema as CREATE TABLE statements, optionally with CREATE INDEX lines.
- Review the table of changes, then copy the script. Check the order and take a backup before you run it.
Why use this tool?
- Private: everything happens in your browser. Nothing you enter is uploaded.
- Free, with no sign-up, no watermark and no limit on how often you use it.
- Works on phones, tablets and computers: Android, iPhone, Windows, Mac and Linux. Nothing to install.
Also known as
Frequently asked questions
Does it detect a renamed column?
No. A renamed column looks like one column dropped and another added, which would lose data if run as written. Replace those two statements with a RENAME COLUMN statement yourself.
Why are some changes only comments in SQLite?
SQLite cannot change or drop most column properties in place. For those changes the tool writes a comment that tells you to create a new table, copy the rows and rename it.
What is left out of the comparison?
Views, triggers, procedures, sequences, table options and column comments are not compared. Only tables, columns, keys, unique constraints, foreign keys and indexes are read.
Is SQL Schema Diff free?
Yes. SQL Schema Diff on Toolipedia is free to use, with no sign-up and no watermark.
Is it safe to use?
Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.
Does it work on my phone?
Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.
Do I need an account?
No. Just open the page and use the tool. There's no sign-up and no email needed.