The query finished running, and the schema was wrong. You need a new column.
Adding a new column to a production database is simple only in theory. In practice, it can trigger downtime, lock tables, or break integrations. The safest approach depends on the size of your data, your database engine, and whether you can tolerate blocking writes.
For relational databases like PostgreSQL and MySQL, ALTER TABLE ... ADD COLUMN modifies the table definition instantly on small datasets. On large datasets, that same command can lock the table while it rewrites storage pages. In high-traffic environments, a direct alter could stall every write for minutes or hours.
To avoid locking, many teams use online schema change tools. For MySQL, gh-ost or pt-online-schema-change create a shadow table with the new column, sync rows in the background, then swap seamlessly. PostgreSQL offers ALTER TABLE ... ADD COLUMN with a default of NULL as a fast metadata-only change. Adding a column with a non-null default requires a rewrite, so avoid defaults until after the column exists.