Database
The following diagram shows the Scrumlr database layout.

The diagram was created with ChartDB
Migrations
Section titled “Migrations”On startup of the Scrumlr backend, migrations for the database are automatically applied to the configured database using migrate. The migration step applies all migrations in the migrations folder.
Note: The automatic migrations cannot apply down migrations. These need to be executed manually.
The logs of the server will show you the current migration and if a migration happend.
Manual migrations
Section titled “Manual migrations”To perform manual migrations to your database, you can use the sub command database migrate from the scrumlr backend.
This command the supports the three sub commands up, down and version.
Note: Before running any database commands either set the env variables to connect to the database or use the flags to pass the database parameters.
Migrate version
Section titled “Migrate version”The version command will show you the current version of the migration your database has.
To get the version run
scrumlr database migrate versionMigrate up
Section titled “Migrate up”To apply the up migrations manual, you can use the command
scrumlr database migrate upThis will apply all available migrations to the database.
You can also pass the --version flag to upgrade to a specific database version.
scrumlr database migrate up --version 26This will apply all migrations until the 26th migration.
Note: The scrumlr backend will apply all migrations to the database if you are not on the current migration.
Migrate down
Section titled “Migrate down”To apply the down migrations manual, you can use the command
scrumlr database migrate down --version 26For the down command you must specify a version.
Note: The scrumlr backend will apply all migrations to the database if you are not on the current migration.
Inspect the database
Section titled “Inspect the database”To inspect the database you can either use the commandline tool psql or a tool like pgadmin.
To connect to the database with psql you can either use the database connection string
psql postgresql://<user>:<password>@<host>:<port>/<database>?sslmode=disableor the command
psql -h <host> -p <port> -d <database> -U <user>after you successfully logge into your database, you can the execute your sql commands and inspect the database.