Real schema changes from open-source projects. Can you spot the breaking change, estimate the risk, and choose the safe migration path? New challenge drops every week.
A growing SaaS needs to support user account recovery. The team decides to replace the hard-delete pattern with a deleted_at timestamp. Here's the schema change:
Correct answer: C Medium Risk
This is a classic semantic breaking change. The schema migration itself is safe (nullable column addition, index creation), but existing application queries like SELECT * FROM users WHERE active = true will return "deleted" users because the active column is gone and nothing enforces the old logic. Safe migration: Keep active as a generated column based on deleted_at, or update all queries before deploying the schema change.
A social platform is approaching 2.1 billion rows and hitting the INT limit. The team migrates all primary keys and foreign keys to BIGINT:
Correct answer: B High Risk
In PostgreSQL, ALTER COLUMN ... TYPE BIGINT on a primary key requires a table rewrite and reindexes. But the bigger risk is referential integrity: if posts.id becomes BIGINT but comments.post_id stays INT, the foreign key constraint will fail. Additionally, application code (especially in languages like Java or C#) may use int types that overflow. Safe migration: Use the expand/contract pattern β add new BIGINT columns β dual-write β backfill β switch reads β drop old columns.
A content platform wants to track when posts are published. They add a published_at column and make it NOT NULL in the same migration:
Correct answer: C High Risk
MySQL (and most databases) will reject ALTER TABLE ... ADD COLUMN ... NOT NULL on a non-empty table unless you also provide a DEFAULT value. Even if you add a default, MySQL 8.0 may rewrite the table to populate it. Safe migration: (1) Add published_at TIMESTAMP NULL β instant in MySQL 8.0. (2) Backfill existing rows in batches. (3) Change to NOT NULL in a follow-up migration after verifying no NULLs remain.
New schema diff challenges drop every week. Follow along to sharpen your migration safety instincts.
Try SchemaLens Free Explore 60+ Tools