The migration failed halfway. A missing migration step left the database in an inconsistent state. You open the schema diff, and there it is: a new column added in one branch, merged without its default, null constraint, or supporting code.
Adding a new column sounds simple. It isn’t. In production, every schema change has consequences. A new column can impact query performance, break ORM models, invalidate API contracts, and create silent data corruption if not deployed with care. The right process prevents hours of incident response and rollback scripts.
First, define the column’s name and type exactly. Avoid ambiguous names; they become technical debt. Choose types that match both current and expected future values. Changing a column type later is harder than doing it right at creation.
Second, set nullability and defaults from day one. Adding a non-null column to a large table without a default will lock writes during migration on many databases. For PostgreSQL, ALTER TABLE ... ADD COLUMN with a constant default rewrites the entire table; use an online migration strategy instead.