The migration was almost done when the breaking error hit. The table needed a new column, but the downtime budget was zero.
Adding a new column sounds simple. In production, it can be dangerous. Large datasets, strict SLAs, and high concurrency make schema changes a risk. Poorly planned column additions can lock tables, block writes, or force costly rollbacks.
Choosing the right strategy depends on the database engine, size of the table, and tolerance for risk. In PostgreSQL, adding a nullable column without a default is instant. Adding a column with a default value rewrites the entire table. MySQL and MariaDB face similar trade-offs. For large tables, use tools like pt-online-schema-change or native ALTER TABLE ... ALGORITHM=INPLACE when supported.
Name the column with care. Avoid reserved keywords and choose types that fit both current and future data needs. Enforce constraints only when necessary; defaults, uniqueness, and foreign keys can add operational cost. If using an ORM, generate migrations explicitly and review them before deployment. Implicit schema changes can surprise production.