Retrofit in real developer workflows.

Each demo runs schema changes against a real database and verifies the result. Retrofit records each change as a schema operation: one intent, such as RenameColumn or DecomposeTable, rendered to whatever DDL and DML it needs. Retrofit reports an operation’s risks as it is declared, before any SQL exists.

Retrofit imports a schema dump into its operation log, writes the migrations that add and then validate a foreign key between existing tables, then backs the change out and reapplies it. Every script is generated, none is written by hand.

Exercised
import
Seal
AddForeignKey
ValidateConstraint
Stack
Flyway + PostgreSQL
Chapters
4

Retrofit imports a populated database, preserves its rows through column and table refactors, and pulls changes made directly in PostgreSQL back into the log. Retrofit starts from a database dump, a set of migration scripts, or zero; this demo starts from the dump.

Exercised
import
op add
drift
DecomposeTable
Seal
Stack
PostgreSQL
Chapters
4