Remove the old column only after the new column is present.

highlighted = computed this step

Drop after copy

After the copied-and-renamed column exists, the old column can be removed in this toy transform.

drop after copy\text{drop after copy}

Show the final shape

After 5 steps, the final table has 3 columns.

columns=3\text{columns}=3

Schema-change examples are tiny finite table transforms; SQL dialects, online migration algorithms, locks, performance, ORMs, compliance, and operational runbooks are out of scope.

Drop after copy: beforeidname1Ada2Bo ordered schema stepsstepop1add_column_default2backfill_column3copy_column4rename_column5drop_column step snapshotsstepopcolumnsrows0start[id, name]21add_column_default[id, name, age]22backfill_column[id, name, age]23copy_column[id, name, age, label]24rename_column[id, name, age, display_name]25drop_column[id, age, display_name]2 final tableidagedisplay_name137Ada229Bo changed columnskindcolumnsadded[age, display_name]removed[name]kept[id] changed rowsrowbeforeafter0[1, Ada][1, 37, Ada]1[2, Bo][2, 29, Bo] safety factsfactvaluestepCount5rowCount2columnCount3changedRowCount2

Compare rows

The changed-rows table shows that values were preserved under the new column name.

compare old and new rows\text{compare old and new rows}

Summary

The order matters because later steps can only use columns that still exist.

ordered steps\text{ordered steps}