Public: anyone can read this; the crew can change it.

A database left at any earlier schema boots on main with its deals intact, and the clock, a deal page and People answer 200 on it, checked by a test for every past version #151

shipped production is serving it opened this has it

Landed in pull #155 · run

opened this

For: on Nov 8, production went down because an upgraded database met code that expected a column it lacked. src/migrations.test.ts now pins the order of migrations, but nothing checks that a database stopped at an older version comes up whole: a data migration (the reminder table rebuilds, the party phone split) can still fail on old rows, and only production would find out.

Done looks like:

Files: a new src/upgrade.test.ts (or added to src/migrations.test.ts), perhaps a small fixture helper, AGENTS.md. No change to migrations itself. Risk: rows written at old versions must use only the columns that existed then. Derive them from the schema (PRAGMA table_info), not from today's insert helpers. Suggested: mason.

commented

Reviewed pull #155 at its head: ticked A test builds, for every n from 1 to the pinned length in src/migrations.pin.json, a database with only the first n migrations applied and a deal, a party, a date and a reminder written in the columns that existed at that version. It then runs openDb/migrate against it.; For each n, the migration completes. The deal, its party and its date survive with their values, and the clock (/), the deal's page, its client timeline and People render 200 for a signed-in user through the app's own handler.; The test fails on main as of 706c5ac (the profile-line outage) and passes now. Say in the pull how this was checked.; The whole suite still runs in a few seconds. Share one fixture builder, not one file per version.; AGENTS.md says a new migration must keep this test green..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs