ath migrate
Preview and apply a SQL schema migration after a verified backup.
Usage
$ath migrateWhat it does
Previews upgrading the database SQL schema when it is behind the installed CLI. Migration never runs silently. A verified SQLite backup is created before the first schema write.
Non-interactive commands refuse an outdated database and point here. Until it is migrated, ath check reports "database metadata schema version is 1, expected 2" for a database created by v1.0.0. Requires the sqlite3 command-line tool on PATH for verified backups (same as ath repair when repair candidates exist).
The backup is saved beside the database, with .migration-backup in its name. ATH v1.0.0 cannot open a database migrated to SQL schema 2, but it can still open that backup, without later changes.
Examples
Review the preview, then apply with --yes and repeat the database ID exactly for non-interactive use.
$ath migrate --json$ath migrate -y --confirm-migration <database-id>