Compare two database schemas

Compare two database schemas and classify object additions, removals, and changes.

freeworks offlinenothing uploaded
ToolSchema Diff
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

Schema models are normalized into tables, columns, constraints, indexes, and types, then object-keyed differences are classified. Formatting and declaration order are ignored where possible.

  • Stable keys reduce noisy diffs.
  • Renames require an explicit mapping because names identify most objects.

Worked example

Schema Evolution
Compare two table schemas and generate migration SQL
Input
											Input1: CREATE TABLE users (id INT PRIMARY KEY, name VARCHAR(100));
Input2: CREATE TABLE users (id INT PRIMARY KEY, name VARCHAR(100), email VARCHAR(255));
										
Output
												Type: column_added
Table: users
Column: email
Detail: Column 'email' (VARCHAR(255)) was added to 'users'
											

When to use this

Migration review, CI drift detection, and production audits compare schemas.

Edge cases

  • A rename can look like drop plus add.
  • Type narrowing can truncate data while widening may be safe.
  • Index options can differ even when indexed columns match.

References