The migration had stalled. The schema was ready, the data clean, but the new column wasn’t there.
Adding a new column sounds simple, but in production systems it is often risky. You have to consider locks, replication lag, backfills, and the impact on query performance. A careless change can block writes, trigger downtime, or break integrations.
In PostgreSQL, ALTER TABLE ADD COLUMN works fast for small datasets, but large tables require more planning. If the column has a default value and is set as NOT NULL, the system will rewrite the entire table, increasing migration time. One approach is to add the new column as nullable with no default. Then backfill in controlled batches to avoid heavy locks. Finally, set constraints and defaults once the data matches your rules.
In MySQL, adding a new column can trigger a table copy unless using ALGORITHM=INPLACE where supported. Even then, storage engines differ. For massive datasets, run the alter during low-traffic windows or use an online schema change tool like pt-online-schema-change or gh-ost to minimize blocking.