The migration finished, but the reports were wrong. The root cause was simple: the database needed a new column.
Adding a new column is one of the most common schema changes in production systems. It sounds small, but it can create downtime, lock tables, or break consumers if done carelessly. In high-traffic environments, you cannot afford a blocking alter. You have to understand both the database engine behavior and the application’s expectations before you deploy.
A new column changes the contract between your storage layer and every service that queries it. Before adding it, audit how the table is used. Check ORM models, raw SQL queries, ETL jobs, and cache layers. Even if the column is nullable and has no default, you may still trigger load spikes when the schema updates.
For relational databases like PostgreSQL or MySQL, adding a column without a default value can often be fast because the engine only updates the metadata. Adding with a default or NOT NULL constraint can rewrite the entire table, causing locks and large transactions. Use online schema change tools or background backfill jobs to avoid application freezes. Always measure on a staging replica with production-size data.