The query hit the database like a hammer, but the schema could not answer. A new column was the missing piece.
Adding a new column is one of the most common schema changes, yet it’s also one of the most dangerous if you ignore performance and consistency. In production, every second counts. Schema migrations that seem harmless in local tests can lock tables, block writes, and bring down critical services.
Plan the change. Start by defining the exact column name, type, default value, and nullability. Use migration tools that generate idempotent scripts. In relational databases like PostgreSQL or MySQL, adding a nullable column without defaults is fast. Adding with a default over millions of rows is not. For large datasets, split the change: create the new column first, then backfill in small batches, then add constraints.
Check application code. Remove hardcoded assumptions about column order. Explicitly select fields to avoid silent bugs when the new column appears. Update APIs, serializers, and schema contracts together with the migration. Deploy the code that can work with both old and new schemas before running the change in production.