The query failed. The log pointed to one thing: a new column had been added without a migration.
Adding a new column sounds simple. It isn’t. Schema changes touch live data, running services, and code that may not know the column exists. Treat it as a change to the heart of your system. If you get it wrong, you break more than the table.
A new column in SQL requires planning: define the column name, type, nullability, default value, and constraints. Consider how it interacts with existing indexes and whether it needs its own. Test the migration against realistic datasets. Large tables may need zero-downtime techniques like online schema changes or batching updates.
In PostgreSQL, ALTER TABLE ADD COLUMN is straightforward, but defaults on large tables can lock writes. For MySQL, ALTER TABLE can rebuild the table, risking long locks unless you use tools like gh-ost or pt-online-schema-change. On distributed systems, align schema changes with deployment schedules to avoid version conflicts between services.