The migration was running smooth until you saw it — a missing field that could break the system. You need a new column. Now.
Adding a new column sounds simple. It isn’t. Schema changes are one of the fastest ways to cause downtime or data loss if you get them wrong. Production databases hold the truth of your system, and any change is surgery on a beating heart.
When you add a column, the first decision is default values. Storing NULL avoids a costly rewrite of all rows, but your application must handle it. Setting a non-null default forces an update across the table. This can lock rows, block writes, and trigger slow queries.
Next is migration timing. For small tables, a single ALTER TABLE with the new column works. For large tables or high-traffic systems, you need an online migration method. Many engineers use tools like pt-online-schema-change or gh-ost to add columns without blocking. These tools create a shadow table, copy data, and then swap it in. The process reduces downtime but adds complexity.