SchemaDrift

Paste two versions of a database schema. See what changed and which changes will break running code.

SQL DDL (CREATE TABLE, CREATE INDEX, ALTER TABLE ... ADD) or JSON. The example above is loaded so you can just press the button.

BREAKING 6 breaking 2 review 7 safe
breaking
Table legacy_audit was dropped. Code reading or writing it will fail.
table_removed
breaking
orders.notes is now NOT NULL. Existing NULLs and old writes will fail.
nullability_tightened · NULL → NOT NULL
breaking
orders.total type decimal(10,2) -> decimal(8,2) (precision or scale reduced).
type_changed · decimal(10,2) → decimal(8,2)
breaking
Column users.tenant_id is NOT NULL with no default. Existing rows and old INSERTs will fail.
column_added_required · - → int
breaking
Column users.name was dropped. Possible rename to full_name; a rename is still breaking for old code.
column_removed · varchar(80) → -
breaking
Unique constraint uq_users_email on users(email) added. Existing duplicate rows will block the migration.
unique_added
warning
orders.status lost its default ('new'). Inserts that omit it may fail.
default_removed · 'new' → -
warning
Index idx_orders_user on orders(user_id) removed. Queries may slow down.
index_removed
safe
New table invoices added.
table_added
safe
Column orders.currency (char(3)) added.
column_added · - → char(3)
safe
orders.id type int -> bigint (integer widened).
type_changed · int → bigint
safe
Column users.full_name (varchar(80)) added.
column_added · - → varchar(80)
safe
Column users.phone (varchar(20)) added.
column_added · - → varchar(20)
safe
users.age type smallint -> int (integer widened).
type_changed · smallint → int
safe
users.email type varchar(100) -> varchar(255) (length increased).
type_changed · varchar(100) → varchar(255)