public class MigrationService extends Object
DatabaseConnection
s 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) |
protected org.flywaydb.core.Flyway |
getFlyway(DatabaseConnection connection,
String locations) |
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"DatabaseConnection
public 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 DatabaseConnection
connection
- a DatabaseConnection
MigrationInfo
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 DatabaseConnection
MigrationInfoService
for the given connection (may be null
).MigrationInfoService
public org.flywaydb.core.api.MigrationInfoService statusComplete(DatabaseConnection connection, boolean testConnection)
MigrationInfoService
for the given DatabaseConnection
(the appNG root
connection).connection
- a DatabaseConnection
testConnection
- if the connection needs to be testedMigrationInfoService
for the given connection (may be null
).MigrationInfoService
public 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 SiteApplication
sqlFolder
- the path to migration scriptsMigrationInfoService
for the given connection (may be null
).MigrationInfoService
protected org.flywaydb.core.Flyway getFlyway(DatabaseConnection connection, String locations)
protected 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–2020 aiticon GmbH. All rights reserved.