You stared at the table and knew what was missing: a new column.
Adding a new column should be simple. In practice, it can break production if you get it wrong. Schema changes touch live systems. They affect queries, indexes, and downstream services. A careless migration can lock tables, stall writes, or trigger cascading failures.
A safe workflow starts with clarity: define the column name, type, default value, and whether it allows nulls. Then review its impact on existing queries. If the column will be indexed, consider write performance and reindexing load.
In code, migrations must be atomic or staged. Use ALTER TABLE with care. Test the migration script on a copy of production data. Measure runtime and lock duration. If the database supports it, add the column without a default, backfill rows in batches, and finally enforce constraints. This reduces impact on availability.