Copy old values before changing the visible column name.

highlighted = computed this step

Copy before rename

Before changing a visible name, copy the old values into a new column.

copy first\text{copy first}

Show the copy

After 3 steps, the table has 4 columns.

steps=3\text{steps}=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.

Copy before rename: beforeidname1Ada2Bo ordered schema stepsstepop1add_column_default2backfill_column3copy_column step snapshotsstepopcolumnsrows0start[id, name]21add_column_default[id, name, age]22backfill_column[id, name, age]23copy_column[id, name, age, label]2 final tableidnameagelabel1Ada37Ada2Bo29Bo changed columnskindcolumnsadded[age, label]removed[]kept[id, name] changed rowsrowbeforeafter0[1, Ada][1, Ada, 37, Ada]1[2, Bo][2, Bo, 29, Bo] safety factsfactvaluestepCount3rowCount2columnCount4changedRowCount2

See both columns

The original column and copied column are both visible before the rename.

old and copy visible\text{old and copy visible}

Summary

The book shows the value movement only; it does not claim an online migration method.

finite copy\text{finite copy}