Adding a new column is simple. Doing it right is not. In relational databases, the schema defines truth. When truth changes, the structure must change with it. A new column can store fresh data, enable new queries, or align models with evolving requirements. But the wrong approach can cause downtime, data loss, or index corruption.
Plan every new column change. Start with the type. Choose the smallest data type that meets the need to conserve space and speed lookups. Decide on nullability—nullable columns make schema changes easier but may require null checks in every query. If the column will have a default value, set it explicitly in the migration script instead of relying on application logic.
For large tables, avoid full-table locks. Use online DDL operations when supported. Split the change into multiple steps: first add the new column without constraints, then backfill in small batches, then add indexes and constraints. Monitor performance during each phase.