The fix was simple: add a new column.
Adding a new column seems trivial, but done wrong it can freeze a production database. Done right, it becomes a zero-downtime operation. The difference lies in understanding how your database engine handles schema changes, locks, and concurrent writes.
In PostgreSQL, the fastest safe approach is to add the column with a default of NULL. This avoids rewriting the table. If a default value is needed, set it in a separate update statement, and then apply the default for future inserts. Each step runs without blocking long-running transactions. In MySQL, the strategy depends on the storage engine. With InnoDB, some column types can be added instantly; others still require a table copy. Always check the ALTER TABLE algorithm details before running the change.