Adding a new column is one of the most common, and most critical, changes in any data model. Done right, it extends capability without breaking existing queries. Done wrong, it stalls deployments, corrupts data, or forces painful rollbacks.
Start with clarity on intent. Define the column name, data type, and default values before touching the migration script. Use consistent naming conventions. Avoid nullable fields unless they are essential; every null is a potential bug hiding in plain sight.
Plan for backward compatibility. Adding a non-nullable column to a table with millions of rows can lock writes during migration. Consider an additive rollout: create the new column as nullable, populate values in batches, then enforce constraints after the table is ready.
Watch indexes. A poorly chosen index on the new column can slow down inserts and updates across the table. Profile workloads to confirm performance gains outweigh costs.