The migration failed at midnight. Logs scrolled by. Every line pointed to the same culprit: a missing new column.
Adding a new column sounds simple. In practice, it can decide whether your deployment ships tonight or waits for the next sprint. Schema changes are one of the most sensitive parts of database management. A single blocking ALTER can lock tables, stall writes, or cause downtime.
The right approach starts with understanding the database engine. In PostgreSQL, adding a nullable new column without a default is fast and metadata-only. Adding a column with a default rewrites the table. In MySQL, even a basic ALTER might require a full table copy depending on the table engine and version.
Version control for schema is non-negotiable. Use migration files. Commit every new column change alongside the application code that depends on it. This keeps deployments atomic and reproducible.