|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
com.googlecode.flyway.ant.AbstractFlywayTask
com.googlecode.flyway.ant.AbstractMigrationLoadingTask
public abstract class AbstractMigrationLoadingTask
Base class for tasks that rely on loading migrations from the classpath.
| Nested Class Summary | |
|---|---|
static class |
AbstractMigrationLoadingTask.LocationElement
One <location> sub-element within the <locations> element. |
static class |
AbstractMigrationLoadingTask.Locations
The nested <locations> element of the task. |
static class |
AbstractMigrationLoadingTask.PlaceholderElement
Nested <placeholder> element inside the <placeholders> element of the migrate Ant task. |
static class |
AbstractMigrationLoadingTask.PlaceholdersElement
Nested <placeholders> element of the migrate Ant task. |
| Field Summary |
|---|
| Fields inherited from class com.googlecode.flyway.ant.AbstractFlywayTask |
|---|
log |
| Fields inherited from class org.apache.tools.ant.Task |
|---|
taskName, taskType, wrapper |
| Fields inherited from class org.apache.tools.ant.ProjectComponent |
|---|
description, location, project |
| Constructor Summary | |
|---|---|
AbstractMigrationLoadingTask()
|
|
| Method Summary | |
|---|---|
void |
addConfiguredLocations(AbstractMigrationLoadingTask.Locations locations)
Do not use. |
void |
addConfiguredPlaceholder(AbstractMigrationLoadingTask.PlaceholderElement placeholder)
Deprecated. Use the <placeholders> element instead of adding individual <placeholder> elements directly. Will be removed in Flyway 3.0. |
void |
addConfiguredPlaceholders(AbstractMigrationLoadingTask.PlaceholdersElement placeholders)
Adds placeholders from a nested <placeholders> element. |
protected void |
doExecute(Flyway flyway)
Executes this task. |
protected abstract void |
doExecuteWithMigrationConfig(Flyway flyway)
Executes Flyway fully configured for loading migrations. |
void |
setBaseDir(String baseDir)
Deprecated. Use locations instead. Will be removed in Flyway 3.0. |
void |
setBasePackage(String basePackage)
Deprecated. Use locations instead. Will be removed in Flyway 3.0. |
void |
setCleanOnValidationError(boolean cleanOnValidationError)
|
void |
setEncoding(String encoding)
|
void |
setOutOfOrder(boolean outOfOrder)
|
void |
setPlaceholderPrefix(String placeholderPrefix)
|
void |
setPlaceholderSuffix(String placeholderSuffix)
|
void |
setSqlMigrationPrefix(String sqlMigrationPrefix)
|
void |
setSqlMigrationSuffix(String sqlMigrationSuffix)
|
void |
setTarget(String target)
|
void |
setValidationErrorMode(String validationErrorMode)
Deprecated. Use cleanOnValidationError instead. Will be removed in Flyway 3.0. |
| Methods inherited from class com.googlecode.flyway.ant.AbstractFlywayTask |
|---|
execute, setClasspath, setClasspathref, setDriver, setPassword, setSchemas, setTable, setUrl, setUser, useValueIfPropertyNotSet, useValueIfPropertyNotSet |
| Methods inherited from class org.apache.tools.ant.Task |
|---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
| Methods inherited from class org.apache.tools.ant.ProjectComponent |
|---|
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractMigrationLoadingTask()
| Method Detail |
|---|
public void addConfiguredLocations(AbstractMigrationLoadingTask.Locations locations)
locations - The locations on the classpath.@Deprecated public void setBasePackage(String basePackage)
basePackage - The base package where the Java migrations are located. (default: db.migration)@Deprecated public void setBaseDir(String baseDir)
baseDir - The base directory on the classpath where the Sql migrations are located. (default: db/migration)public void setEncoding(String encoding)
encoding - The encoding of Sql migrations. (default: UTF-8)public void setSqlMigrationPrefix(String sqlMigrationPrefix)
sqlMigrationPrefix - The file name prefix for Sql migrations (default: V)public void setSqlMigrationSuffix(String sqlMigrationSuffix)
sqlMigrationSuffix - The file name suffix for Sql migrations (default: .sql)public void setTarget(String target)
target - The target version up to which Flyway should run migrations. Migrations with a higher version number will not be
applied. (default: the latest version)@Deprecated public void setValidationErrorMode(String validationErrorMode)
validationErrorMode - The action to take when validation fails.public void setCleanOnValidationError(boolean cleanOnValidationError)
cleanOnValidationError - Whether to automatically call clean or not when a validation error occurs. (default: false)This is exclusively intended as a convenience for development. Even tough we strongly recommend not to change migration scripts once they have been checked into SCM and run, this provides a way of dealing with this case in a smooth manner. The database will be wiped clean automatically, ensuring that the next migration will bring you back to the state checked into SCM.
Warning ! Do not enable in production !
public void setOutOfOrder(boolean outOfOrder)
outOfOrder - Allows migrations to be run "out of order" (default: false).
If you already have versions 1 and 3 applied, and now a version 2 is found, it will be applied too instead of being ignored.
Also configurable with Ant Property: ${flyway.outOfOrder}public void setPlaceholderPrefix(String placeholderPrefix)
placeholderPrefix - The prefix of every placeholder. (default: ${ )public void setPlaceholderSuffix(String placeholderSuffix)
placeholderSuffix - The suffix of every placeholder. (default: } )@Deprecated public void addConfiguredPlaceholder(AbstractMigrationLoadingTask.PlaceholderElement placeholder)
placeholder - The fully configured placeholder element.public void addConfiguredPlaceholders(AbstractMigrationLoadingTask.PlaceholdersElement placeholders)
placeholders - The fully configured placeholders element.
protected final void doExecute(Flyway flyway)
throws Exception
AbstractFlywayTask
doExecute in class AbstractFlywayTaskflyway - The flyway instance to operate on.
Exception - any exception
protected abstract void doExecuteWithMigrationConfig(Flyway flyway)
throws Exception
flyway - The instance of Flyway to launch.
Exception - when the execution failed.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||