The migration halted. A new column was needed, and the database would not wait.
Adding a new column is one of the most common schema changes in software. It sounds simple. It isn’t. Every misstep risks downtime, data loss, or failed deployments. To do it right, you need a process that works at scale.
The first step is planning the schema change. Define the column name, data type, nullability, and default values. Avoid implicit conversions that trigger locks. Use explicit definitions. Test the change in a staging environment with realistic data size and query patterns.
In production, use a migration tool that supports non-blocking operations. For PostgreSQL, ALTER TABLE ... ADD COLUMN is fast if the column allows nulls and has no default. For MySQL, online DDL can reduce lock times. In high-traffic systems, deploy the new column in two steps: add it empty, then backfill asynchronously to avoid performance hits.