The logs lit up with warnings. One simple change had triggered it: adding a new column.
A new column sounds harmless. It isn’t. In a live system, schema changes can ripple through queries, indexes, migrations, and application logic. Ignore that and you risk corrupted data, blocked writes, or downtime.
When you add a new column, you have to consider type, nullability, default values, and indexing strategy. A column with a default can lock a table during the migration if the dataset is large. A NOT NULL constraint without a default will fail on existing rows. A poorly chosen data type can add storage overhead or prevent scaling.
The safest approach is to make changes in small, reversible steps. First, create the new column as nullable and without a default. Backfill data in batches, using jobs that won’t overload your database. Once populated, add constraints and indexes in separate migrations. This keeps transactions short and avoids holding locks for long periods.