The migration script failed mid-deploy, and the production database is locked. You need a new column, and you need it without taking the system down.
Adding a new column in modern databases is no longer just an ALTER TABLE problem. At scale, schema changes can block queries, cause write latency spikes, or break ORM mappings if not coordinated. The safest approach depends on storage engine, locking behavior, and replication lag.
In PostgreSQL, adding a new column with a default value can rewrite the entire table, which is expensive. Adding it without a default and backfilling in batches avoids locks and keeps indexes fast. In MySQL, ALTER TABLE with ALGORITHM=INPLACE or ONLINE can help, but not for every column type. Always verify with SHOW CREATE TABLE and test the exact mutation path on staging data of production size.
When planning a new column in a distributed system, keep forward-compatibility in mind. First, deploy code that can handle the column being absent. Then roll out the schema change. Only after the change is complete should the code start writing to and reading from it. This avoids downtime in rolling deploys and keeps old clients working.