Adding a new column is simple when you plan it well and lethal when you don’t. The schema defines the shape of your data. Change the shape, and you change the rules. Before you alter a table, decide if the column is nullable, if it needs defaults, and how it will affect reads and writes under load.
Start with the migration file. Name it with intent. Use ALTER TABLE for direct changes or a phased approach when uptime matters. For massive datasets, add the new column without constraints first, backfill in controlled batches, and then enforce constraints. This reduces lock time and the risk of blocking queries.
Think about indexes before you add them. A new index can speed lookups but can also slow writes. For boolean or low-cardinality columns, indexes often waste storage and CPU. Use them only when query patterns demand it.
Run the migration in staging with production-like data. Measure timings. Check logs for slow queries. A new column might trigger implicit casting or force full table scans in unexpected places.