Class MigrationConfig

    • Method Detail

      • setMetaTable

        public void setMetaTable​(String metaTable)
        Set the name of the migration table.
      • isAllowErrorInRepeatable

        public boolean isAllowErrorInRepeatable()
        Return true if we continue running the migration when a repeatable migration fails.
      • setAllowErrorInRepeatable

        public void setAllowErrorInRepeatable​(boolean allowErrorInRepeatable)
        Set to true to continue running the migration when a repeatable migration fails.
      • setPatchResetChecksumOn

        public void setPatchResetChecksumOn​(String versionsCommaDelimited)
        Set the migrations that should have their checksum reset as a comma delimited list.
      • setPatchInsertOn

        public void setPatchInsertOn​(String versionsCommaDelimited)
        Set the migrations that should not be run but inserted into history as if they have run.
      • setPatchInsertOn

        public void setPatchInsertOn​(Set<String> patchInsertOn)
        Set the migrations that should not be run but inserted into history as if they have run.

        This can be useful when we need to pull out DDL from a repeatable migration that should really only run once. We can pull out that DDL as a new migration and add it to history as if it had been run (we can only do this when we know it exists in all environments including production).

      • getPatchInsertOn

        public Set<StringgetPatchInsertOn()
        Return the migrations that should not be run but inserted into history as if they have run.
      • isSkipChecksum

        public boolean isSkipChecksum()
        Return true if checksum check should be skipped (during development).
      • setSkipChecksum

        public void setSkipChecksum​(boolean skipChecksum)
        Set to true to skip the checksum check.

        This is intended for use during development only.

      • getRunPlaceholders

        public String getRunPlaceholders()
        Return a Comma and equals delimited key/value placeholders to replace in DDL scripts.
      • setRunPlaceholders

        public void setRunPlaceholders​(String runPlaceholders)
        Set a Comma and equals delimited key/value placeholders to replace in DDL scripts.
      • setRunPlaceholderMap

        public void setRunPlaceholderMap​(Map<String,​String> runPlaceholderMap)
        Set a map of name/value pairs that can be expressions replaced in migration scripts.
      • setMigrationPath

        public void setMigrationPath​(String migrationPath)
        Set the root path used to find migrations.
      • setMigrationInitPath

        public void setMigrationInitPath​(String migrationInitPath)
        Set the path containing init migration scripts.
      • getApplySuffix

        public String getApplySuffix()
        Return the suffix for migration resources (defaults to .sql).
      • setApplySuffix

        public void setApplySuffix​(String applySuffix)
        Set the suffix for migration resources.
      • getDbUsername

        public String getDbUsername()
        Return the DB username.

        Used when a Connection to run the migration is not supplied.

      • setDbUsername

        public void setDbUsername​(String dbUsername)
        Set the DB username.

        Used when a Connection to run the migration is not supplied.

      • getDbPassword

        public String getDbPassword()
        Return the DB password.

        Used when creating a Connection to run the migration.

      • setDbPassword

        public void setDbPassword​(String dbPassword)
        Set the DB password.

        Used when creating a Connection to run the migration.

      • getDbDriver

        public String getDbDriver()
        Return the DB Driver.

        Used when creating a Connection to run the migration.

      • setDbDriver

        public void setDbDriver​(String dbDriver)
        Set the DB Driver.

        Used when creating a Connection to run the migration.

      • getDbUrl

        public String getDbUrl()
        Return the DB connection URL.

        Used when creating a Connection to run the migration.

      • setDbUrl

        public void setDbUrl​(String dbUrl)
        Set the DB connection URL.

        Used when creating a Connection to run the migration.

      • getDbSchema

        public String getDbSchema()
        Return the DB connection Schema.

        Used when creating a Connection to run the migration.

      • setDbSchema

        public void setDbSchema​(String dbSchema)
        Set the DB connection Schema.

        Used when creating a Connection to run the migration.

      • isCreateSchemaIfNotExists

        public boolean isCreateSchemaIfNotExists()
        Return true if migration should create the schema if it does not exist.
      • setCreateSchemaIfNotExists

        public void setCreateSchemaIfNotExists​(boolean createSchemaIfNotExists)
        Set to create Schema if it does not exist.
      • isSetCurrentSchema

        public boolean isSetCurrentSchema()
        Return true if the dbSchema should be set as current schema.
      • setSetCurrentSchema

        public void setSetCurrentSchema​(boolean setCurrentSchema)
        Set if the dbSchema should be set as current schema.

        We want to set this to false for the case of Postgres where the dbSchema matches the DB username. If we set the dbSchema that can mess up the Postgres search path so we turn this off in that case.

      • getPlatformName

        public String getPlatformName()
        Return the DB platform name (used for platform create table and select for update syntax).
      • setPlatformName

        public void setPlatformName​(String platformName)
        Set a DB platform name (to load specific create table and select for update syntax).
      • setClassLoader

        public void setClassLoader​(ClassLoader classLoader)
        Set the ClassLoader to use when loading resources.
      • setMinVersionFailMessage

        public void setMinVersionFailMessage​(String minVersionFailMessage)
        Parameters:
        minVersionFailMessage - the minVersionFailMessage to set
      • load

        public void load​(Properties props)
        Load configuration from standard properties.
      • createConnection

        public Connection createConnection()
        Create a Connection to the database using the configured driver, url, username etc.

        Used when an existing DataSource or Connection is not supplied.