Then someone noticed the missing new column.
Adding a new column to a database table is simple in theory and dangerous in practice. It can block writes, lock rows, and stall an application if done carelessly. The method you choose depends on your database engine, data size, and uptime needs.
In PostgreSQL, ALTER TABLE ADD COLUMN runs fast when the column has no default and is nullable. The command updates the schema instantly and defers writes until data is inserted or updated. Adding a column with a default value in older versions rewrites the whole table. Newer versions optimize this, but testing on staging is still essential.
For MySQL, ALTER TABLE often copies the table unless you use algorithms like INSTANT or INPLACE where supported. Partitioned tables and older storage engines may behave differently. Check the execution plan before running on production.