Skip to content

Database Migrations

Autentico uses explicit, versioned schema migrations. Migrations are applied automatically on startup by default — in most cases, you don’t need to do anything.

Autentico uses SQLite’s built-in PRAGMA user_version to track the current schema version. Each release that changes the schema increments this version. On startup, the binary compares the database version against the version it expects and applies any pending migrations.

Fresh databases are automatically stamped with the current version on first start — no action needed.

By default, autentico start applies pending migrations automatically. Just deploy the new binary or image and restart:

Terminal window
# Binary
autentico start
# Docker Compose
docker compose pull
docker compose up -d

If you prefer to review and apply migrations manually, start with --no-auto-migrate:

Terminal window
autentico start --no-auto-migrate

The server will refuse to start if the database is behind, showing:

database is at version 1, this binary requires version 2 — run: autentico migrate

Then run the interactive migration command:

Terminal window
autentico migrate

This shows the current and target versions, warns about irreversibility, and asks you to type the target version number to confirm. Type anything else to cancel.

If you run autentico migrate and the database is already at the latest version:

Already up to date.

No changes are made.