The table was in production, but the data needed room to grow. You open the migration file and add one thing: a new column.
Adding a new column sounds simple. In practice, it can break queries, slow deployments, and lock writes. The key is to do it without disrupting active traffic. Databases don’t care about your release schedule. If the schema change blocks, users feel it.
The safest path is online schema changes. In PostgreSQL, use ADD COLUMN with default NULL first, then backfill in small batches. Avoid setting a non-null default in the initial DDL—this forces a table rewrite and can cause downtime. MySQL is similar: use tools like pt-online-schema-change or native ALGORITHM=INPLACE when possible. Monitor locks and long-running transactions during the migration.