The query ran. The data was wrong. A missing field burned through the logs like a red flare. You need a new column.
Adding a new column to a database is not just a schema change. It is an operation that can block writes, break migrations, and ripple through APIs. A misstep can halt production. Doing it right means planning the migration path, understanding the constraints, and testing every read and write that touches the table.
First, define the new column with explicit types. Ambiguity in type definitions will backfire. Choose NOT NULL only if you can populate every row from day zero. If not, default values and null handling must be clear and documented.
Second, avoid locking the table during peak traffic. Use online schema changes if your database supports them. In PostgreSQL, ADD COLUMN is fast but may require careful indexing later. In MySQL, consider tools like pt-online-schema-change.