The migration was done, but the table wasn’t ready. The data needed space for something new. A new column.
Adding a new column sounds simple. It isn’t. In production, every schema change carries risk: downtime, locks, and corrupted writes. At scale, even a single ALTER TABLE can stall an entire service. The strategy matters.
First, choose the right type. Once deployed, schema changes can be expensive to roll back. Think about data distribution, nullability, and default values. Avoid NOT NULL without defaults unless certain every row can populate it immediately.
Second, deploy in steps. For large datasets, add the new column without constraints. Use migrations that run online when possible. Backfill data in small batches to keep locks short. Validate before enforcing constraints.