The migration failed at 02:13. The logs showed one reason: the table needed a new column.
Adding a new column sounds simple. It is not. Whether the database is Postgres, MySQL, or a cloud-managed engine, the risks are the same—locking, downtime, and inconsistent data. In fast-moving deployments, a single schema change can bottleneck the entire release pipeline.
The first step is to define the column with precision. Decide the data type, nullability, and default values before touching production. Skipping this leads to expensive rewrites. For large tables, adding a column with a default value often rewrites each row. Avoid this if you need zero downtime; instead, add the column nullable, backfill data in small batches, then set constraints.
Use database-native tools to control migration behavior. In Postgres, ALTER TABLE ADD COLUMN is standard, but watch how it interacts with locks. In MySQL, ALTER TABLE can be blocking unless you use tools like pt-online-schema-change or gh-ost. For distributed databases, schema change propagation can be slower, so time your deployments.