The database groaned under the weight of another migration. You needed a new column, and time was not on your side.
Adding a new column seems simple, but it can break production if done without care. Schema changes can lock tables, block writes, and cause downtime. The goal is zero-downtime migrations that scale with live traffic.
First, define the new column with a default value that does not require rewriting the entire table. Avoid non-null constraints at creation; enforce them later after backfilling data. This prevents full table locks on large datasets.
For relational databases like PostgreSQL and MySQL, use ALTER TABLE with operations known to be O(1) when possible. For example, adding a nullable column without a default is fast. Adding a new column with a default can be instant in newer versions of PostgreSQL, but still dangerous in older versions. Test in a staging environment that mirrors production load.