Adding a new column should be simple. It is also one of the most common schema changes in production databases. Whether you work with PostgreSQL, MySQL, or a distributed SQL store, the process must be planned. A careless migration can lock tables, block writes, and cause downtime.
First, define the new column in a way that avoids full-table rewrites. In PostgreSQL, adding a nullable column with no default is instant. Adding one with a default value on a large table can cause locks—so use a two-step migration: add it as nullable, then backfill data in smaller batches.
Second, ensure your code can handle the column before it exists in production. Release application changes that make all reads and writes compatible with both the old and new schema. This guards against race conditions during rollout.