Replace default values with row-specific values.

highlighted = computed this step

Backfill a column

A backfill replaces defaults with row-specific values.

replace default values\text{replace default values}

Show the backfill

The migration has 2 steps and changes 2 rows.

changed rows=2\text{changed rows}=2

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

Backfill a column: beforeidname1Ada2Bo ordered schema stepsstepop1add_column_default2backfill_column step snapshotsstepopcolumnsrows0start[id, name]21add_column_default[id, name, age]22backfill_column[id, name, age]2 final tableidnameage1Ada372Bo29 changed columnskindcolumnsadded[age]removed[]kept[id, name] changed rowsrowbeforeafter0[1, Ada][1, Ada, 37]1[2, Bo][2, Bo, 29] safety factsfactvaluestepCount2rowCount2columnCount3changedRowCount2

Read changed rows

The changed-rows table shows before and after values for each row.

beforeafter\text{before}\to\text{after}

Summary

Backfill facts are recomputed from the row updates, not described by hand.

row updates\text{row updates}