Class 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 Detail

      • initVersion

        protected String initVersion
      • targetVersion

        protected String targetVersion
      • sqlMigrationPath

        protected String sqlMigrationPath
      • javaMigrationPath

        protected String javaMigrationPath
      • kcPath

        protected String kcPath
      • ricePath

        protected String ricePath
      • riceServer

        protected String riceServer
      • 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
      • ignoreMissingMigrations

        protected Boolean ignoreMissingMigrations
    • Constructor Detail

      • FlywayMigrator

        public FlywayMigrator()
    • Method Detail

      • migrate

        public void migrate()
      • performMigration

        protected void performMigration​(DataSource dataSource,
                                        List<String> locations)
      • filterForExistence

        protected String[] filterForExistence​(List<String> locations)
      • runPreMigrationSql

        protected void runPreMigrationSql​(DataSource dataSource)
      • runChecksumPreMigrationFromLocation

        protected void runChecksumPreMigrationFromLocation​(String checksumUpdateStatement,
                                                           String location,
                                                           Connection conn)
      • getDefinedOption

        protected String getDefinedOption​(String option,
                                          String defaultValue)
      • setInitVersion

        public void setInitVersion​(String initVersion)
      • setTargetVersion

        public void setTargetVersion​(String targetVersion)
      • setDataSource

        public void setDataSource​(DataSource dataSource)
        Sets the KC 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()
      • setGrm

        public void setGrm​(Boolean grm)
      • 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)
      • getIgnoreMissingMigrations

        public Boolean getIgnoreMissingMigrations()
      • setIgnoreMissingMigrations

        public void setIgnoreMissingMigrations​(Boolean ignoreMissingMigrations)