The logs pointed to a missing field. You need a new column.
Adding a new column should be simple. It isn’t always. Schema changes touch live data, production workloads, and critical paths. A poorly-timed ALTER TABLE can lock hundreds of connections, spike CPU, and trigger long rollbacks. The right approach depends on table size, traffic patterns, and your database engine.
In PostgreSQL, adding a nullable column with no default is fast. Metadata changes apply instantly. Add a default value, and the database rewrites the table. That’s where downtime risk begins. In MySQL, the execution plan may require a full table copy unless you use ALGORITHM=INPLACE or INSTANT. Even then, certain column types or order changes revert to a blocking operation.
Plan the migration. Measure table size. Benchmark on a staging environment with production-like load. On large datasets, prefer additive, non-blocking changes first: create the new column without default, backfill in controlled batches, then apply constraints. This isolates risk and keeps locks short.