When you add a new column to a database table, it’s more than a schema change. It’s a decision point. Get it wrong, and you risk downtime, data corruption, or unreadable migrations. Get it right, and the system keeps moving without a hitch.
Start by deciding if the new column is nullable. If it’s not, you need defaults. In production, adding a non-null column with a default value can lock the table. This is critical for large datasets. Use online migrations or phased rollouts to avoid blocking writes.
Choose the correct data type from the start. Changing it later will force another migration and possible reprocessing of historical data. Align your choice with current and future queries to prevent costly refactors.
Backfill in small batches. Instead of a single ALTER TABLE with a massive update, split it into transactions that load safely. Monitor query performance through the process.