The migration finished, but the table still looked the same. The data was intact. The queries ran. Yet the feature needed one more thing: a new column.
Adding a new column to a production database sounds simple. It isn’t. The wrong change at the wrong time can block writes, lock tables, or trigger unexpected downtime. Speed and safety depend on how you design, deploy, and verify the change.
First, define the exact name, type, and default value. Avoid vague column names; they force future developers to guess at purpose. Choose data types that match the smallest viable range — smaller types reduce memory and index size. If you need nullability, decide up front how queries will handle nulls.
Second, plan the migration path. On PostgreSQL or MySQL, adding a column without a default can often be instant. Adding with a default may rewrite the table. In production, that difference matters. When you must backfill, do it in batches to avoid long locks.