public class MigrationService extends Object
DatabaseConnections using
Flyway.| Modifier and Type | Class and Description |
|---|---|
static class |
MigrationService.MigrationStatus
Enum type defining the different states of a database migration.
|
| Modifier and Type | Field and Description |
|---|---|
protected static String |
APP_NG_ROOT_DATABASE |
static String |
DATABASE_MAX_CONNECTIONS |
static String |
DATABASE_MIN_CONNECTIONS |
static String |
DATABASE_NAME |
protected static String |
DATABASE_NAME_PREFIX |
static String |
DATABASE_REPAIR |
static String |
DATABASE_TYPE |
protected static String |
DATABASE_VALIDATION_PERIOD |
protected static String |
DATABASE_VALIDATION_QUERY |
protected static String |
HIBERNATE_CONNECTION_DRIVER_CLASS |
protected static String |
HIBERNATE_CONNECTION_PASSWORD |
protected static String |
HIBERNATE_CONNECTION_URL |
protected static String |
HIBERNATE_CONNECTION_USERNAME |
| Constructor and Description |
|---|
MigrationService() |
| Modifier and Type | Method and Description |
|---|---|
protected DataSource |
getDataSource(DatabaseConnection databaseConnection) |
protected DataSource |
getDataSource(String url,
String username,
String password) |
DatabaseConnection |
getPlatformConnection(Properties properties) |
protected MigrationService.MigrationStatus |
initDatabase(DatabaseConnection rootConnection,
Boolean doRepair) |
DatabaseConnection |
initDatabase(Properties config)
Configures and (optionally) migrates the appNG root
DatabaseConnection from the given
Properties. |
protected MigrationService.MigrationStatus |
migrate(org.flywaydb.core.Flyway flyway,
DatabaseConnection databaseConnection) |
org.flywaydb.core.api.MigrationInfo |
status(DatabaseConnection connection)
Returns the current
MigrationInfo for the given DatabaseConnection |
org.flywaydb.core.api.MigrationInfo |
status(Properties config)
Returns the current
MigrationInfo for the connection |
org.flywaydb.core.api.MigrationInfoService |
statusComplete(DatabaseConnection connection)
Returns the current
MigrationInfoService for the given DatabaseConnection (the appNG root
connection). |
org.flywaydb.core.api.MigrationInfoService |
statusComplete(DatabaseConnection connection,
boolean testConnection)
Returns the current
MigrationInfoService for the given DatabaseConnection (the appNG root
connection). |
org.flywaydb.core.api.MigrationInfoService |
statusComplete(DatabaseConnection connection,
File sqlFolder)
Returns the current
MigrationInfoService for the given DatabaseConnection, which must be owned by
a SiteApplication. |
public static final String DATABASE_MIN_CONNECTIONS
public static final String DATABASE_MAX_CONNECTIONS
public static final String DATABASE_NAME
public static final String DATABASE_REPAIR
public static final String DATABASE_TYPE
protected static final String DATABASE_VALIDATION_QUERY
protected static final String DATABASE_VALIDATION_PERIOD
protected static final String HIBERNATE_CONNECTION_PASSWORD
protected static final String HIBERNATE_CONNECTION_USERNAME
protected static final String HIBERNATE_CONNECTION_DRIVER_CLASS
protected static final String HIBERNATE_CONNECTION_URL
protected static final String APP_NG_ROOT_DATABASE
protected static final String DATABASE_NAME_PREFIX
public DatabaseConnection initDatabase(Properties config)
DatabaseConnection from the given
Properties.config - the properties read from "/conf/appNG.properties"DatabaseConnectionpublic DatabaseConnection getPlatformConnection(Properties properties)
public org.flywaydb.core.api.MigrationInfo status(Properties config)
MigrationInfo for the connectionconfig - the configuration read from "/conf/appNG.properties"MigrationInfo for the given connectionstatus(DatabaseConnection)public org.flywaydb.core.api.MigrationInfo status(DatabaseConnection connection)
MigrationInfo for the given DatabaseConnectionconnection - a DatabaseConnectionMigrationInfo for the given connection (may be null).MigrationInfoService.current()public org.flywaydb.core.api.MigrationInfoService statusComplete(DatabaseConnection connection)
MigrationInfoService for the given DatabaseConnection (the appNG root
connection).connection - a DatabaseConnectionMigrationInfoService for the given connection (may be null).MigrationInfoServicepublic org.flywaydb.core.api.MigrationInfoService statusComplete(DatabaseConnection connection, boolean testConnection)
MigrationInfoService for the given DatabaseConnection (the appNG root
connection).connection - a DatabaseConnectiontestConnection - if the connection needs to be testedMigrationInfoService for the given connection (may be null).MigrationInfoServicepublic org.flywaydb.core.api.MigrationInfoService statusComplete(DatabaseConnection connection, File sqlFolder)
MigrationInfoService for the given DatabaseConnection, which must be owned by
a SiteApplication.connection - a DatabaseConnection owned by a SiteApplicationsqlFolder - the path to migration scriptsMigrationInfoService for the given connection (may be null).MigrationInfoServiceprotected MigrationService.MigrationStatus initDatabase(DatabaseConnection rootConnection, Boolean doRepair)
protected MigrationService.MigrationStatus migrate(org.flywaydb.core.Flyway flyway, DatabaseConnection databaseConnection)
protected DataSource getDataSource(DatabaseConnection databaseConnection)
protected DataSource getDataSource(String url, String username, String password)
Copyright © 2011–2019 aiticon GmbH. All rights reserved.