public class MigrateTask extends AbstractMigrationLoadingTask
AbstractMigrationLoadingTask.LocationElement, AbstractMigrationLoadingTask.Locations, AbstractMigrationLoadingTask.PlaceholderElement, AbstractMigrationLoadingTask.PlaceholdersElementlog| Constructor and Description |
|---|
MigrateTask() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doExecuteWithMigrationConfig(Flyway flyway)
Executes Flyway fully configured for loading migrations.
|
void |
setDisableInitCheck(boolean disableInitCheck)
Deprecated.
Use initOnMigrate instead. Will be removed in Flyway 3.0.
|
void |
setIgnoreFailedFutureMigration(boolean ignoreFailedFutureMigration) |
void |
setInitOnMigrate(boolean initOnMigrate)
Whether to automatically call init when migrate is executed against a non-empty schema with no metadata table.
|
void |
setValidateOnMigrate(boolean validateOnMigrate) |
void |
setValidationMode(String validationMode)
Deprecated.
Use validateOnMigrate instead. Will be removed in Flyway 3.0.
|
addConfiguredLocations, addConfiguredPlaceholder, addConfiguredPlaceholders, doExecute, setCleanOnValidationError, setEncoding, setOutOfOrder, setPlaceholderPrefix, setPlaceholderSuffix, setSqlMigrationPrefix, setSqlMigrationSuffix, setTarget, setValidationErrorModeexecute, setClasspath, setClasspathref, setDriver, setInitDescription, setInitialDescription, setInitialVersion, setInitVersion, setPassword, setSchemas, setTable, setUrl, setUser, useValueIfPropertyNotSet, useValueIfPropertyNotSetbindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypepublic void setIgnoreFailedFutureMigration(boolean ignoreFailedFutureMigration)
ignoreFailedFutureMigration - Ignores failed future migrations when reading the metadata table. These are migrations that we performed by a
newer deployment of the application that are not yet available in this version. For example: we have migrations
available on the classpath up to version 3.0. The metadata table indicates that a migration to version 4.0
(unknown to us) has already been attempted and failed. Instead of bombing out (fail fast) with an exception, a
warning is logged and Flyway terminates normally. This is useful for situations where a database rollback is not
an option. An older version of the application can then be redeployed, even though a newer one failed due to a
bad migration. (default: false)@Deprecated public void setValidationMode(String validationMode)
validationMode - The type of validation to be performed before migrating.public void setValidateOnMigrate(boolean validateOnMigrate)
validateOnMigrate - Whether to automatically call validate or not when running migrate. (default: false)@Deprecated public void setDisableInitCheck(boolean disableInitCheck)
disableInitCheck - Flag to disable the check that a non-empty schema has been properly initialized with init. This check ensures
Flyway does not migrate or clean the wrong database in case of a configuration mistake. Be careful when disabling
this! (default: false)public void setInitOnMigrate(boolean initOnMigrate)
Whether to automatically call init when migrate is executed against a non-empty schema with no metadata table.
This schema will then be initialized with the initialVersion before executing the migrations.
Only migrations above initialVersion will then be applied.
This is useful for initial Flyway production deployments on projects with an existing DB.
Be careful when enabling this as it removes the safety net that ensures Flyway does not migrate the wrong database in case of a configuration mistake!
Also configurable with Ant Property: ${flyway.initOnMigrate}initOnMigrate - true if init should be called on migrate for non-empty schemas, false if not. (default: false)protected void doExecuteWithMigrationConfig(Flyway flyway) throws Exception
AbstractMigrationLoadingTaskdoExecuteWithMigrationConfig in class AbstractMigrationLoadingTaskflyway - The instance of Flyway to launch.Exception - when the execution failed.Copyright © 2013. All rights reserved.