Skip to content

Database setup

The Onegini Extension Engine requires a database connection to store and load configuration and custom extension scripts.

Setup the database schema

The database schema can be created at the application startup or manually. Flyway is used to do it automatically at startup. This feature is enabled by default. The database user used by the application requires the rights to manipulate the database schema for this feature.

To create the database schema manually via a DBA, Flyway should be disabled by setting the property DATABASE_MIGRATIONS_ENABLED to false. All DB schema files mentioned in the upgrade instructions should be executed.

Configure the database

The Onegini Extension Engine supports three different types of database, including Oracle, MySQL, and SQL Server.

Configuring the database type

The database type can be selected by setting the DATABASE_TYPE environment variable. If no type specified, MySQL will be used by default.

Oracle example:

- DATABASE_TYPE=oracle

SQL Server example:

- DATABASE_TYPE=mssql

MySQL example:

- DATABASE_TYPE=mysql

Configuring the database connection

Several environment variables must be set in the docker compose file to allow the application to access the database. Properties with a specified default value can be omitted.

Property Default Description
DATABASE_TYPE mysql The type of the database.
DATABASE_URL The URL of the database. Example: jdbc:mysql://localhost/test.
DATABASE_USERNAME The username the application will use to access the database.
DATABASE_PASSWORD The password for the username above.
DATABASE_ENCRYPTION_PASSWORD The password used to encrypt sensitive configuration properties. For security purposes, this password should not match that of the database.
DATABASE_ENCRYPTION_POOLSIZE 4 The poolsize of the Jasypt string encryptor used to encrypt config properties.
DATABASE_MIGRATIONS_ENABLED true Whether Flyway migrations are enabled or not.