Aller au contenu
#0780
Sqlite

The nine-statement migration that can't half-apply

The migration is nine statements: three ALTERs, a backfill, two index builds, three data fixes. You send them as one transaction array to POST /api/v1/sqlite/db. They run in order inside a single ACID transaction: if statement six fails, everything rolls back and the response carries reqIdx: 5, pointing at the exact item that broke. Nothing half-applied, nothing to reconcile. Idempotent steps like CREATE TABLE IF NOT EXISTS get noFail: true, so a rerun sails past them.

There's no migration framework in this story: no version table, no CLI, no deploy-request workflow to click through. A schema change is a request body; a failed schema change is a 400 with an index into it.

The migration either happened or it didn't.