Skip to content

Migrations

The server schema evolves through versioned SQL migrations applied with sqlx-cli. A migration is one timestamped file in server/migrations; sqlx migrate run applies every pending migration in filename order inside a transaction.

Terminal window
sqlx migrate run # apply pending migrations
sqlx migrate revert # undo the last applied migration
sqlx migrate add <name> # create a new empty migration file

The test suite resets the database first (make reset_db runs scripts/reset_test_db.sh), so tests always run against a schema built from scratch.

For the resulting storage layout, see Database architecture.