The logs showed one line that mattered: missing column.
A new column is not just a data change. It is a shift in the shape of your system. When you add a column to a table, you alter queries, indexes, constraints, and schemas. You risk downtime if the migration locks rows. You risk bugs if the code assumes a different schema than the database.
The safest way to add a new column starts with your schema migration script. Use ALTER TABLE with care. On large datasets, test the statement in a staging environment with production-sized data. Modern databases like PostgreSQL allow adding new columns with defaults without a full table rewrite, if done the right way. Knowing these nuances can cut deploy time and reduce lock contention.
Backfill strategies matter. Avoid long transactions that block writes. Break updates into batches. Use background jobs to populate the new column. Keep the column nullable until the backfill is complete and the application reads from it. Only then enforce NOT NULL to lock in the schema integrity.