The table was wrong, and everyone knew it. The data model had shifted, the schema was stale, and a new column was the only fix worth shipping. You open the migration file. The name matters. The type matters more. Every bad choice here will live forever in history tables, logs, and broken queries.
Adding a new column is not just syntax. It’s a change to contracts between services, to read and write patterns, to how APIs shape responses. Before running ALTER TABLE, you check the cost. On large datasets, a blocking migration can lock the table, stall writes, and cascade into downtime.
Plan the migration in steps. First, add the new column as nullable. This avoids rewriting all rows in a single transaction. Then backfill with a script or job that runs in controlled batches. Watch CPU, I/O, and replication lag. When the column is ready, add constraints, defaults, or indexes in separate operations.