The build had failed, and the logs pointed to a single missing field. A new column. That was all it needed, but it meant touching production data.
Adding a new column to a database table sounds simple. It is not. The wrong approach blocks writes, locks rows, or corrupts data. The right approach makes the change online, preserving uptime and consistency.
Start by defining the schema change with explicit type, constraints, and default values. Avoid implicit conversions. If adding the column to a large table, use tools or native database features that support non-blocking migrations. In MySQL, ALTER TABLE ... ADD COLUMN with ALGORITHM=INPLACE and LOCK=NONE can prevent table-wide locks. In PostgreSQL, adding a column with a default value can rewrite the entire table unless done in two steps: first add the column without a default, then update existing rows in batches, and finally set the default for new inserts.