The migration broke in the last push. Logs showed null values where none should exist. The cause was simple: a new column had been added, but the deployment missed critical steps.
Adding a new column in production is never trivial. Schema changes shift the ground under your application. A single misstep can trigger downtime, lock tables, or cause data loss. Whether you are altering a PostgreSQL table, extending MySQL schema, or introducing a new field in a NoSQL collection, the process must be deliberate.
The first step is planning. Define the column name, type, constraints, and default values. Decide if the column can be nullable or must be backfilled. For large datasets, a default value on creation can cause table rewrites and block queries. Use lightweight operations first, then populate data in batches.
In relational databases, adding a new column without locking requires staged deployment: