The migration failed on the third deploy because no one added the new column.
A new column changes the shape of your data. It can break queries, cascade errors through services, and slow everything if not handled with precision. Adding it is simple in theory: define the schema change, run the migration, and verify the data integrity. In practice, it demands a controlled process with zero downtime.
Start by declaring the new column in your schema definition. Align the data type with the storage requirements and indexing strategy. Avoid default values that trigger full table rewrites on large datasets. Use nullable columns for phased rollouts, then backfill asynchronously before enforcing constraints.
Run migrations in a safe, reversible way. Prefer online schema changes where supported. Batch updates to reduce lock contention. Monitor query plans after deployment to ensure indexes are used efficiently with the new column in place.