The query hit production traffic before the migration was finished. You open the logs and see the failure: a new column was added, but half the code still assumes the old schema.
Adding a new column in a live database is simple to type but dangerous to deploy. Schema changes can break queries, overload replicas, and lock tables. The steps you take to add that column determine whether your rollout is smooth or brutal.
First, decide the exact purpose and type of the new column. In relational databases like PostgreSQL or MySQL, define the correct data type, default values, and nullability. Changing these later costs more than doing it right the first time.
Second, plan the deployment. For large tables, adding a column can block writes. Use non-blocking migrations or tools like pt-online-schema-change, gh-ost, or native PostgreSQL concurrent operations. Test performance impact in a staging environment with realistic data.