The build had failed again. The logs were clean until one line: “Unknown column.” The fix was simple, but the cause told a bigger story. Adding a new column is the most common schema change in modern databases, but it is also the most dangerous when done without control.
A new column expands the structure of a table. In SQL, it means modifying the schema with ALTER TABLE ... ADD COLUMN. The command is fast to type but costly in production if the table is large, or if the migration is unplanned. Poorly executed, it locks writes, blocks reads, or breaks queries when code and schema drift from each other.
Best practice starts with designing the column deliberately. Define the name, type, nullability, and default value. Avoid defaults that add hidden load by rewriting the entire table. For critical systems, test the migration on a clone of production data. Measure the execution time. Look for indexes that might need creation or updates.