A table stretches across your screen. Now you need a new column.
Adding a new column seems simple. It can also break production if done wrong. Schema changes touch core parts of the system. In high‑traffic environments, a careless migration can lock tables, spike CPU, and slow queries. Precision matters.
First, decide the column name and type. Use consistent naming conventions to reduce future confusion. Align types with their real world constraints. If the column will store IDs, use integers. For monetary values, use DECIMAL with exact scale. Avoid generic types like TEXT unless necessary.
Second, plan the migration path. A direct ALTER TABLE can cause downtime on large datasets. Use online schema change tools or phased rollouts. Add the new column as nullable, backfill in small batches, and then set constraints. This reduces lock time and system load.