ReportLog
Documentation menu

Rolling back

sudo reportlog rollback          # to `previous`
sudo reportlog releases          # what there is
sudo reportlog rollback <id>     # to a named one

A rollback switches current and restarts. It installs the units and Caddyfile that release shipped with. It does not touch the database. Rolling back twice returns you to where you started. (The Updates screen's ordinary Roll back goes once only; after the eight presses it can name any kept release, as rollback <id> does.)

Why rolling back is safe#

Migrations in this repository are additive. They add tables, columns, triggers and constraints; they never rename, drop or change how an existing column is read (CLAUDE.md, "Migrations are new files only"). So the release before a migration does not know about what the migration added, and does not need to: every table and column it uses is still there, unchanged. The older code runs on the newer schema.

That is also why a deploy can migrate first and switch afterwards: for a few seconds the old release serves on the new schema, which is exactly the situation a rollback leaves you in.

After a rollback the doctor says the database has migrations the running release does not know, as a warning, not a failure. Deploying an older commit is refused for the same reason: the deploy checks before it unpacks anything ("Not installed: … is older than this site's database"), and the migration runner would refuse it too ("This database has migrations this code does not"). Neither will run code older than the database. To go back, use rollback, which never migrates. To go forward, deploy a commit that includes every applied migration.

If a migration ever had to be undone, that would be a new, additive migration deployed forward, written by a person. There is no "down" migration and no tool here runs one.

See this page's source