The schema was broken. A single missing field stopped the build, and the deadline was minutes away. You needed a new column, fast.
Adding a new column is one of the most common yet high‑impact changes in relational databases. It can alter queries, change joins, and force index updates. Done right, it’s seamless. Done wrong, it can lock tables, break APIs, or corrupt data.
First, define the exact type. Use the smallest data type that fits the need. If it’s an integer, pick the minimal range. If it’s text, define length limits from the start. These choices affect storage, speed, and maintainability.
Second, decide on the null behavior. Setting NOT NULL without a default can block inserts until the code is updated. Setting a default can hide logical issues. Always backfill data before enforcing constraints.
Third, deploy in stages.