The schema is breaking. The query fails. You need a new column.
Adding a new column is one of the most common database changes, but done wrong, it can halt production and corrupt data. Done right, it’s a simple, zero-downtime update that expands capability instantly.
Before creating a new column, define its role. Decide on name, type, nullability, default, and indexing. Avoid vague names and over-wide data types. Precision here keeps storage lean and queries fast.
In relational databases like PostgreSQL, ALTER TABLE ... ADD COLUMN is the direct method. For massive tables, this may lock writes. Strategies to avoid blocking include adding nullable columns without defaults, then updating data in batches, and only later enforcing constraints. This reduces transaction time and keeps systems online.
For MySQL or MariaDB, consider ALGORITHM=INPLACE where supported to minimize locks. With column addition, watch replication lag, as schema changes propagate to replicas.