The migration broke at 3:07 a.m. The log file showed why: a missing column.
Adding a new column sounds simple, but production never forgives careless changes. The schema defines the shape of your data. Alter it the wrong way and you risk downtime, locked tables, or corrupted rows. When you add a new column in SQL, the right approach depends on the database engine, the size of your tables, and how you deploy code.
In PostgreSQL, ALTER TABLE ADD COLUMN is straightforward for small datasets. Large tables require caution, because the operation can lock writes. For MySQL, adding a new column may rebuild the entire table. That can take minutes or hours. Engineers avoid blocking traffic by using ALGORITHM=INPLACE or running the change in multiple steps. For distributed databases like CockroachDB, schema changes happen online, but you still need to verify backward compatibility before pushing updates.