The migration finished at 02:14, but the schema was wrong. One table was missing a new column you thought had been deployed.
Adding a new column sounds trivial until it breaks production or locks writes for minutes. Whether in PostgreSQL, MySQL, or a cloud data warehouse, the right approach depends on your data size, nullability, default values, and transaction limits.
In PostgreSQL, ALTER TABLE ADD COLUMN is fast if the column is nullable with no default. Add a default and the database rewrites the table, which can block queries. The safer pattern is:
ALTER TABLE users ADD COLUMN bio TEXT;
UPDATE users SET bio = 'n/a' WHERE bio IS NULL;
ALTER TABLE users ALTER COLUMN bio SET DEFAULT 'n/a';
This sequence avoids heavy locks while keeping semantics intact. In MySQL, adding a column may trigger a table copy depending on engine and version. With InnoDB on recent releases, ALGORITHM=INSTANT can prevent downtime: