The table needed a new column, and the clock was already ticking.
Adding a new column sounds simple, but in production it can break queries, crash services, or lock a table for longer than expected. Schema changes are dangerous when downtime is not an option. The right approach depends on your database engine, table size, and traffic pattern.
In PostgreSQL, ALTER TABLE ADD COLUMN executes fast if you give the column a default of NULL. Setting a non-null default forces a table rewrite. That rewrite will block writes and blow up on big datasets. Avoid defaults in the migration. Instead, add the column, backfill it in controlled batches, then set constraints after the data is ready.
In MySQL, the cost depends on engine type and version. Newer releases with instant DDL can add a column in constant time for many cases. But older versions may copy the whole table. Profile your environment before running the change.