The build was failing. The error was clear: the query needed a new column.
Adding a new column sounds simple, but the details matter. Schema changes can break code, slow queries, and trigger downtime if done wrong. The fastest way to add a column safely is to plan the change, run it in a migration, and roll it out without blocking production traffic.
First, define the new column with the correct data type and constraints. Avoid nullable columns unless there's a reason. If the column has a default value that must apply to all existing rows, set it in the migration to keep data consistent.
Second, stage the migration to avoid locking the whole table. For large datasets, add the new column without the default first. Then backfill in batches. Apply the default and constraints after the data is loaded. This prevents long locks and service interruptions.