-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate a Connection to the database using the configured driver, url, username etc.Return the base platform that was set.Return the ClassLoader to use to load resources.Return the DB password.Return the DB connection Schema.getDbUrl()Return the DB connection URL.Return the DB username.Return the jdbcMigrationFactory.Return the name of the migration table.Return the path for containing init migration scripts.Return the root path used to find migrations.Return the minVersion.Return the optional minVersionFailMessage.Return the migrations that should not be run but inserted into history as if they have run.Return the migrations that should have their checksum reset.Return the platform that was set.Deprecated.Return a map of name/value pairs that can be expressions replaced in migration scripts.Return a Comma and equals delimited key/value placeholders to replace in DDL scripts.booleanReturn true if we continue running the migration when a repeatable migration fails.booleanReturn true if migration should create the schema if it does not exist.booleanReturn true if using the earlyChecksumMode which means checksums are computed before any expressions in the scripts are translated.booleanReturn true if fastMode is turned on.booleanReturn true if the dbSchema should be set as current schema.booleanReturn true if checksum check should be skipped (during development).booleanReturn true if the migration should NOT execute the migrations but update the migration table.voidload(Properties props) Load configuration from standard properties.voidsetAllowErrorInRepeatable(boolean allowErrorInRepeatable) Set to true to continue running the migration when a repeatable migration fails.voidsetBasePlatform(String basePlatform) Set the base platform.voidsetClassLoader(ClassLoader classLoader) Set the ClassLoader to use when loading resources.voidsetCreateSchemaIfNotExists(boolean createSchemaIfNotExists) Set to create Schema if it does not exist.voidsetDbDriver(String dbDriver) Deprecated.voidsetDbPassword(String dbPassword) Set the DB password.voidsetDbSchema(String dbSchema) Set the DB connection Schema.voidSet the DB connection URL.voidsetDbUsername(String dbUsername) Set the DB username.voidsetEarlyChecksumMode(boolean earlyChecksumMode) Set to true to turn on earlyChecksumMode.voidsetFastMode(boolean fastMode) Set true to enable fastMode.voidsetJdbcMigrationFactory(JdbcMigrationFactory jdbcMigrationFactory) Set the jdbcMigrationFactory.voidsetMetaTable(String metaTable) Set the name of the migration table.voidsetMigrationInitPath(String migrationInitPath) Set the path containing init migration scripts.voidsetMigrationPath(String migrationPath) Set the root path used to find migrations.voidsetMinVersion(String minVersion) Set the minVersion.voidsetMinVersionFailMessage(String minVersionFailMessage) Set the minVersionFailMessagevoidSet the name of the database to run the migration for.voidsetPatchInsertOn(String versionsCommaDelimited) Set the migrations that should not be run but inserted into history as if they have run.voidsetPatchInsertOn(Set<String> patchInsertOn) Set the migrations that should not be run but inserted into history as if they have run.voidsetPatchResetChecksumOn(String versionsCommaDelimited) Set the migrations that should have their checksum reset as a comma delimited list.voidsetPatchResetChecksumOn(Set<String> patchResetChecksumOn) Set the migrations that should have their checksum reset.voidsetPlatform(String platform) Set the platform that is running the migration.voidsetPlatformName(String platformName) Deprecated.voidsetRunPlaceholderMap(Map<String, String> runPlaceholderMap) Set a map of name/value pairs that can be expressions replaced in migration scripts.voidsetRunPlaceholders(String runPlaceholders) Set a Comma and equals delimited key/value placeholders to replace in DDL scripts.voidsetSetCurrentSchema(boolean setCurrentSchema) Set if the dbSchema should be set as current schema.voidsetSkipChecksum(boolean skipChecksum) Set to true to skip the checksum check.voidsetSkipMigrationRun(boolean skipMigrationRun) Set to true if the migration should NOT execute the migrations but update the migration table only.
-
Constructor Details
-
MigrationConfig
public MigrationConfig()
-
-
Method Details
-
getMetaTable
Return the name of the migration table. -
setMetaTable
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
Set the migrations that should have their checksum reset as a comma delimited list. -
setPatchResetChecksumOn
Set the migrations that should have their checksum reset. -
getPatchResetChecksumOn
Return the migrations that should have their checksum reset. -
setPatchInsertOn
Set the migrations that should not be run but inserted into history as if they have run. -
setPatchInsertOn
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
Return the migrations that should not be run but inserted into history as if they have run. -
isSkipMigrationRun
public boolean isSkipMigrationRun()Return true if the migration should NOT execute the migrations but update the migration table.This can be used to migrate from Flyway where all existing migrations are treated as being executed.
-
setSkipMigrationRun
public void setSkipMigrationRun(boolean skipMigrationRun) Set to true if the migration should NOT execute the migrations but update the migration table only.This can be used to migrate from Flyway where all existing migrations are treated as being executed.
-
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
Return a Comma and equals delimited key/value placeholders to replace in DDL scripts. -
setRunPlaceholders
Set a Comma and equals delimited key/value placeholders to replace in DDL scripts. -
getRunPlaceholderMap
Return a map of name/value pairs that can be expressions replaced in migration scripts. -
setRunPlaceholderMap
Set a map of name/value pairs that can be expressions replaced in migration scripts. -
getMigrationPath
Return the root path used to find migrations. -
setMigrationPath
Set the root path used to find migrations. -
getMigrationInitPath
Return the path for containing init migration scripts. -
setMigrationInitPath
Set the path containing init migration scripts. -
getDbUsername
Return the DB username.Used when a Connection to run the migration is not supplied.
-
setDbUsername
Set the DB username.Used when a Connection to run the migration is not supplied.
-
getDbPassword
Return the DB password.Used when creating a Connection to run the migration.
-
setDbPassword
Set the DB password.Used when creating a Connection to run the migration.
-
setDbDriver
Deprecated.Deprecated - not required.Used when creating a Connection to run the migration.
-
getDbUrl
Return the DB connection URL.Used when creating a Connection to run the migration.
-
setDbUrl
Set the DB connection URL.Used when creating a Connection to run the migration.
-
getDbSchema
Return the DB connection Schema.Used when creating a Connection to run the migration.
-
setDbSchema
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
Deprecated.Deprecated migrate togetPlatform() -
setPlatformName
Deprecated.Deprecated migrate tosetPlatform(String). -
getClassLoader
Return the ClassLoader to use to load resources. -
setClassLoader
Set the ClassLoader to use when loading resources. -
getJdbcMigrationFactory
Return the jdbcMigrationFactory. -
setJdbcMigrationFactory
Set the jdbcMigrationFactory. -
getMinVersion
Return the minVersion. -
setMinVersion
Set the minVersion. -
getMinVersionFailMessage
Return the optional minVersionFailMessage. -
setMinVersionFailMessage
Set the minVersionFailMessage -
load
Load configuration from standard properties. -
createConnection
Create a Connection to the database using the configured driver, url, username etc.Used when an existing DataSource or Connection is not supplied.
-
setName
Set the name of the database to run the migration for.This name is used when loading properties like:
ebean.${name}.migration.migrationPath -
getBasePlatform
Return the base platform that was set. -
setBasePlatform
Set the base platform. -
getPlatform
Return the platform that was set. -
setPlatform
Set the platform that is running the migration.This helps for platform specific create table and select for update syntax.
-
isEarlyChecksumMode
public boolean isEarlyChecksumMode()Return true if using the earlyChecksumMode which means checksums are computed before any expressions in the scripts are translated. -
setEarlyChecksumMode
public void setEarlyChecksumMode(boolean earlyChecksumMode) Set to true to turn on earlyChecksumMode. -
isFastMode
public boolean isFastMode()Return true if fastMode is turned on. -
setFastMode
public void setFastMode(boolean fastMode) Set true to enable fastMode. This will perform an initial check for the exact same number of migrations and matching checksums without any locking. If anything does not match then the normal migration is performed with appropriate locking etc.
-