Adding a new column sounds simple, but in production, it can be a trap. Schema changes can lock tables, block queries, and slow down writes. If you ship it wrong, you risk downtime. If you ship it right, your system keeps running without a hiccup.
A new column can support new features, store computed values, or enable faster queries. The fastest way to get there is to be deliberate: choose the right data type, set defaults carefully, and run the migration in a way that won’t interrupt live traffic.
When adding a column in Postgres, avoid operations that rewrite the table unless required. Adding a nullable column is cheap. Adding a column with a default will cause a full table rewrite unless you set the default in a second step. MySQL and MariaDB behave differently—check your engine before running the migration. For large datasets, break changes into multiple deploys: