The migration ran clean until the database stopped cold. The log showed one line: add column failed.
A new column is the simplest change in theory but one that can wreck a production system if done wrong. A database schema is the spine of your application. Touch it without care and you invite downtime, lock contention, or corrupted data. Adding a new column the right way is about precision, not speed.
First, decide if the column is nullable. If it’s not, plan a safe backfill strategy. Large tables require incremental updates to avoid locking reads and writes. Use ALTER TABLE with care—some engines lock the entire table during the operation. In PostgreSQL, adding a nullable column with no default is instant, but adding a column with a default can rewrite the table. With MySQL, the behavior depends on the storage engine and version. Read the release notes before running migrations.