The migration failed. Logs showed a cascade of errors, but the trigger was simple: adding a new column.
Creating a new column in a live database sounds small. It can take seconds in development, but production realities complicate everything. Table size, locking behavior, indexing, replication lag, and downstream dependencies all turn a quick DDL change into a potential outage.
The safest way to add a new column is to minimize lock time. On PostgreSQL, ALTER TABLE ADD COLUMN is fast if no default value is set. Defaults on large tables rewrite the entire table, blocking writes until completed. In MySQL, ALTER TABLE often rebuilds data unless you use ALGORITHM=INPLACE or ALGORITHM=INSTANT when supported.
Plan the migration. Start by adding the column as nullable with no default. Backfill in controlled batches to avoid replication delays. Only after data is populated should you set defaults or NOT NULL constraints. This sequence keeps production APIs responsive and prevents downtime.