Package co.kuali.coeus.data.migration
Class FlywayMigrator
- java.lang.Object
-
- co.kuali.coeus.data.migration.FlywayMigrator
-
public class FlywayMigrator extends Object
Needs to be injected and migrated *before* OJB/JPA or any other database framework. This only depends on a working DataSource, usually a JDBC connection pool.
-
-
Field Summary
Fields Modifier and Type Field Description protected BooleanapplyDemoprotected BooleanapplyStagingprotected BooleanapplyTestingprotected StringbootstrapPathprotected StringchecksumUpdatesFilenameprotected CoeusMigrationResolvercoeusMigrationResolverprotected DataSourcedataSourceprotected StringdemoDataPathprotected StringembeddedClientScriptsprotected BooleanembeddedModeprotected Booleanenabledprotected List<String>extraMigrationPathsprotected Booleangrmprotected StringgrmDataPathprotected StringinitVersionprotected StringjavaMigrationPathprotected StringkcPathprotected BooleanmanageRiceprotected BooleanoutOfOrderprotected StringriceDataOnlyprotected DataSourcericeDataSourceprotected StringricePathprotected StringriceServerprotected StringsqlMigrationPathprotected StringstagingDataPathprotected StringtargetVersionprotected StringtestingPath
-
Constructor Summary
Constructors Constructor Description FlywayMigrator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<String>buildLocations(String rootPath)protected String[]filterForExistence(List<String> locations)BooleangetApplyDemo()BooleangetApplyStaging()BooleangetApplyTesting()StringgetBootstrapPath()CoeusMigrationResolvergetCoeusMigrationResolver()DataSourcegetDataSource()protected BooleangetDefinedOption(String option, Boolean defaultValue)protected StringgetDefinedOption(String option, String defaultValue)StringgetDemoDataPath()BooleangetEmbeddedMode()BooleangetEnabled()List<String>getExtraMigrationPaths()BooleangetGrm()StringgetGrmDataPath()StringgetInitVersion()StringgetJavaMigrationPath()BooleangetManageRice()BooleangetOutOfOrder()DataSourcegetRiceDataSource()StringgetSqlMigrationPath()StringgetStagingDataPath()StringgetTargetVersion()StringgetTestingPath()voidmigrate()protected voidperformMigration(DataSource dataSource, List<String> locations, org.flywaydb.core.api.resolver.MigrationResolver... migrationResolvers)protected List<String>prefixLocationsWithDb(String dbPath, List<String> locations)protected voidrunChecksumPreMigrationFromLocation(String checksumUpdateStatement, String location, Connection conn)protected voidrunPreMigrationSql(DataSource dataSource)voidsetApplyDemo(boolean applyDemo)Sets whether to apply demo data scripts or notvoidsetApplyStaging(boolean applyStaging)Sets whether to apply staging data scripts or notvoidsetApplyTesting(boolean applyTesting)Sets whether to apply testing data scripts or notvoidsetBootstrapPath(String bootstrapPath)Sets the path for the bootstrap data scriptsvoidsetCoeusMigrationResolver(CoeusMigrationResolver coeusMigrationResolver)voidsetDataSource(DataSource dataSource)Sets the KC datasourcevoidsetDemoDataPath(String demoDataPath)Sets the path for the demo data scriptsvoidsetEmbeddedMode(Boolean embeddedMode)voidsetEnabled(Boolean enabled)voidsetExtraMigrationPaths(List<String> extraMigrationPaths)voidsetGrm(Boolean grm)voidsetGrmDataPath(String grmDataPath)Sets the path for the grm data scriptsvoidsetInitVersion(String initVersion)voidsetJavaMigrationPath(String javaMigrationPath)voidsetManageRice(Boolean manageRice)voidsetOutOfOrder(Boolean outOfOrder)voidsetRiceDataSource(DataSource riceDataSource)Sets the Rice server datasourcevoidsetSqlMigrationPath(String migrationPath)voidsetStagingDataPath(String stagingDataPath)Sets the path for staging data scriptsvoidsetTargetVersion(String targetVersion)voidsetTestingPath(String testingPath)Sets the path for the testing data scripts
-
-
-
Field Detail
-
initVersion
protected String initVersion
-
targetVersion
protected String targetVersion
-
dataSource
protected DataSource dataSource
-
riceDataSource
protected DataSource riceDataSource
-
coeusMigrationResolver
protected CoeusMigrationResolver coeusMigrationResolver
-
sqlMigrationPath
protected String sqlMigrationPath
-
javaMigrationPath
protected String javaMigrationPath
-
kcPath
protected String kcPath
-
ricePath
protected String ricePath
-
riceServer
protected String riceServer
-
riceDataOnly
protected String riceDataOnly
-
embeddedClientScripts
protected String embeddedClientScripts
-
bootstrapPath
protected String bootstrapPath
-
testingPath
protected String testingPath
-
stagingDataPath
protected String stagingDataPath
-
demoDataPath
protected String demoDataPath
-
grmDataPath
protected String grmDataPath
-
checksumUpdatesFilename
protected String checksumUpdatesFilename
-
enabled
protected Boolean enabled
-
applyTesting
protected Boolean applyTesting
-
applyStaging
protected Boolean applyStaging
-
applyDemo
protected Boolean applyDemo
-
outOfOrder
protected Boolean outOfOrder
-
grm
protected Boolean grm
-
manageRice
protected Boolean manageRice
-
embeddedMode
protected Boolean embeddedMode
-
-
Method Detail
-
migrate
public void migrate()
-
performMigration
protected void performMigration(DataSource dataSource, List<String> locations, org.flywaydb.core.api.resolver.MigrationResolver... migrationResolvers)
-
prefixLocationsWithDb
protected List<String> prefixLocationsWithDb(String dbPath, List<String> locations)
-
runPreMigrationSql
protected void runPreMigrationSql(DataSource dataSource)
-
runChecksumPreMigrationFromLocation
protected void runChecksumPreMigrationFromLocation(String checksumUpdateStatement, String location, Connection conn)
-
setInitVersion
public void setInitVersion(String initVersion)
-
setTargetVersion
public void setTargetVersion(String targetVersion)
-
setDataSource
public void setDataSource(DataSource dataSource)
Sets the KC datasource
-
getRiceDataSource
public DataSource getRiceDataSource()
-
setRiceDataSource
public void setRiceDataSource(DataSource riceDataSource)
Sets the Rice server datasource
-
getBootstrapPath
public String getBootstrapPath()
-
setBootstrapPath
public void setBootstrapPath(String bootstrapPath)
Sets the path for the bootstrap data scripts- Parameters:
bootstrapPath- (default : bootstrap)
-
getTestingPath
public String getTestingPath()
-
setTestingPath
public void setTestingPath(String testingPath)
Sets the path for the testing data scripts- Parameters:
testingPath- (default : testing)
-
getStagingDataPath
public String getStagingDataPath()
-
setStagingDataPath
public void setStagingDataPath(String stagingDataPath)
Sets the path for staging data scripts- Parameters:
stagingDataPath- (default : staging)
-
getDemoDataPath
public String getDemoDataPath()
-
setDemoDataPath
public void setDemoDataPath(String demoDataPath)
Sets the path for the demo data scripts- Parameters:
demoDataPath- (default : demo)
-
getGrmDataPath
public String getGrmDataPath()
-
setGrmDataPath
public void setGrmDataPath(String grmDataPath)
Sets the path for the grm data scripts- Parameters:
grmDataPath- (default : grm)
-
getApplyTesting
public Boolean getApplyTesting()
-
setApplyTesting
public void setApplyTesting(boolean applyTesting)
Sets whether to apply testing data scripts or not- Parameters:
applyTesting- (default : Configuration parameter flyway.migrations.apply_testing or false if not set)
-
getApplyStaging
public Boolean getApplyStaging()
-
setApplyStaging
public void setApplyStaging(boolean applyStaging)
Sets whether to apply staging data scripts or not- Parameters:
applyStaging- (default : Configuration parameter flyway.migrations.apply_staging or false if not set)
-
getApplyDemo
public Boolean getApplyDemo()
-
setApplyDemo
public void setApplyDemo(boolean applyDemo)
Sets whether to apply demo data scripts or not- Parameters:
applyDemo- (default : Configuration parameter flyway.migrations.apply_demo or false if not set)
-
getInitVersion
public String getInitVersion()
-
getTargetVersion
public String getTargetVersion()
-
getDataSource
public DataSource getDataSource()
-
getManageRice
public Boolean getManageRice()
-
setManageRice
public void setManageRice(Boolean manageRice)
-
getEmbeddedMode
public Boolean getEmbeddedMode()
-
setEmbeddedMode
public void setEmbeddedMode(Boolean embeddedMode)
-
getGrm
public Boolean getGrm()
-
setGrm
public void setGrm(Boolean grm)
-
getCoeusMigrationResolver
public CoeusMigrationResolver getCoeusMigrationResolver()
-
setCoeusMigrationResolver
public void setCoeusMigrationResolver(CoeusMigrationResolver coeusMigrationResolver)
-
getEnabled
public Boolean getEnabled()
-
setEnabled
public void setEnabled(Boolean enabled)
-
getSqlMigrationPath
public String getSqlMigrationPath()
-
setSqlMigrationPath
public void setSqlMigrationPath(String migrationPath)
-
getJavaMigrationPath
public String getJavaMigrationPath()
-
setJavaMigrationPath
public void setJavaMigrationPath(String javaMigrationPath)
-
getOutOfOrder
public Boolean getOutOfOrder()
-
setOutOfOrder
public void setOutOfOrder(Boolean outOfOrder)
-
-