Co-evolve your code and schema.

retrofit is a CLI that tracks schema changes as discrete operations, reports their risks before any SQL exists, and derives the forward and reverse migration scripts. Plain text, in git, reviewed like code.

Retrofit has not shipped yet. No list, no noise, one message when it does.

Getting started

Start from the database you already have. This run begins with the 11-table, 3,503-track Chinook sample database.

32 sec space to pause f for fullscreen

  1. Start with 11 related tables, 24 data inserts, and no migration history to replay.

  2. Turn the schema into 138 schema operations and preserve its rows in a reviewable sidecar.

  3. Rebuild all 3,503 tracks and 412 invoices from the log and preserved seed data.

Retrofit imports Chinook into a text operation log, generates SQL for each change, and reconciles a directly-added column and index from pg_dump. PostgreSQL executes the generated changes; Git keeps their source reviewable alongside application code.

Next: Chapter 02, Refactor a live table