Pre-Installation Tasks - Database
Configuring Flyway Command-line Tool
The following section helps you configure placeholders and properties in the flyway.conf
file and execute SQL scripts for your database. The details that are required to configure flyway properties for a component’s database are available in the database sections of an app server in the document.
Note: Before configuring flyway properties for your database, download the Flyway Command-line Tool from https://flywaydb.org/getstarted/download.html to your local system, and unzip the
flyway-commandline-<x.x.x>-<Operating_Platform>
. You can download the Flyway Command-line Tool specific to your Operating System. The supported version is Flyway 4.0.3.
- Go to the
\flyway\conf
folder and open theflyway.conf
file. -
Configure your database properties for the current module with relevant data in the
flyway.conf
file.The following is a sample for configuring properties in the
flyway.conf
file.
- Save the
flyway.conf
file. -
Add your database driver into the Flyway drivers folder. For example,
flyway-4.0.3\drivers
.The following jars are required for your database.
Click here for more details.
| Database | JARs |
| --- | --- |
| MySQL | mysql-connector-java-8.0.12.jar |
| Oracle | ojdbc6\_g.jar |
| MS SQL | mssql-jdbc-7.0.0.jre8 |
- To execute your database SQL scripts, copy all required database SQL files from Volt MX Foundry_Plugins folder and paste them to the
Flyway SQL
(For example,C:\flyway\sql or /opt/flyway/sql
depending on Windows or Linux) folder of the Flyway Command-line Tool. - For only identity services, to execute your database SQL scripts, do the following:
- Copy the migrations.jar from the
VoltMXFoundry_Plugins\scripts\javamigrations-auth\
folder. - Paste the migrations.jar to the
C:\flyway\jars\
, for example,C:\flyway\jars\migrations.jar
. - Go to the
\flyway\conf
folder and open theflyway.conf
file. - Add the following database class path:
flyway.locations=com.voltmx.auth.migrations.<<db_name>>
- Copy the migrations.jar from the
-
From the command line, execute the SQL scripts for your database:
-
For Oracle, execute the SQL scripts with the following Flyway migrate command along with the following placeholder parameters:
<Product_Prefix>_DATA_TABLESPACE, <Product_Prefix>_INDEX_TABLESPACE
, and<Product_Prefix>_LOB_TABLESPACE
Note: While creating databases in Oracle, you can provide one name or separate names for tablespace, index space and lob space. If the same name is given, that name will need to be passed for all these parameters.
For example, the following is the flyway command to execute SQL scripts for AUTH (identity services) with separate tablespace names:
<commandprompt> flyway migrate -placeholders.AUTH_DATA_TABLESPACE="TS32K" -placeholders.AUTH_INDEX_TABLESPACE="IDX32K" -placeholders.AUTH_LOB_TABLESPACE="LOB32K"
-
For MySQL and SQL Server, execute the following Flyway migrate command:
<commandprompt> flyway migrate
The SQL files will be executed in the
Flyway SQL
folder. For example,C:\flyway\sql or /opt/flyway/sql
depending on Windows or Linux, or specific to your storage file path. -