public class FlywayCleanTask
extends org.gradle.api.DefaultTask
| Modifier and Type | Field and Description |
|---|---|
Boolean |
allowMixedMigrations
Whether to allow mixing transactional and non-transactional statements within the same migration.
|
String |
baselineDescription
The description to tag an existing schema with when executing baseline.
|
Boolean |
baselineOnMigrate
Whether to automatically call baseline when migrate is executed against a non-empty schema with no metadata table.
|
String |
baselineVersion
The version to tag an existing schema with when executing baseline.
|
String[] |
callbacks
An array of fully qualified FlywayCallback class implementations
|
Boolean |
cleanDisabled
Whether to disable clean.
|
Boolean |
cleanOnValidationError
Whether to automatically call clean or not when a validation error occurs
|
String |
driver
The fully qualified classname of the jdbc driver to use to connect to the database
|
String |
encoding
The encoding of Sql migrations
|
protected FlywayExtension |
extension
The flyway {} block in the build script.
|
Boolean |
ignoreFutureMigrations
Ignore future migrations when reading the metadata table.
|
Boolean |
ignoreMissingMigrations
Ignore missing migrations when reading the metadata table.
|
String |
installedBy
The username that will be recorded in the metadata table as having applied the migration.
|
String[] |
locations
Locations to scan recursively for migrations.
|
Boolean |
outOfOrder
Allows migrations to be run "out of order"
|
String |
password
The password to use to connect to the database
|
String |
placeholderPrefix
The prefix of every placeholder
|
Boolean |
placeholderReplacement
Whether placeholders should be replaced.
|
Map<Object,Object> |
placeholders
Placeholders to replace in Sql migrations
|
String |
placeholderSuffix
The suffix of every placeholder
|
String |
repeatableSqlMigrationPrefix
The file name prefix for repeatable sql migrations (default: R).
|
String[] |
resolvers
The fully qualified class names of the custom MigrationResolvers to be used in addition (default)
or as a replacement (using skipDefaultResolvers) to the built-in ones for resolving Migrations to
apply.
|
String[] |
schemas
The case-sensitive list of schemas managed by Flyway
|
Boolean |
skipDefaultCallbacks
If set to true, default built-in callbacks will be skipped, only custom migration callbacks will be used.
|
Boolean |
skipDefaultResolvers
If set to true, default built-in resolvers will be skipped, only custom migration resolvers will be used.
|
String |
sqlMigrationPrefix
The file name prefix for Sql migrations
|
String |
sqlMigrationSeparator
The file name prefix for Sql migrations
|
String |
sqlMigrationSuffix
The file name suffix for Sql migrations
|
String |
table
The name of Flyway's metadata table
|
String |
target
The target version up to which Flyway should consider migrations.
|
String |
url
The jdbc url to use to connect to the database
|
String |
user
The user to use to connect to the database
|
Boolean |
validateOnMigrate
Whether to automatically call validate or not when running migrate.
|
| Constructor and Description |
|---|
FlywayCleanTask() |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
run(Flyway flyway)
Executes the task's custom behavior.
|
Object |
runTask() |
addValidator, appendParallelSafeAction, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, doFirst, doFirst, doLast, doLast, execute, executeWithoutThrowingTaskFailure, finalizedBy, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDidWork, getEnabled, getExecuter, getExtensions, getFinalizedBy, getGroup, getImpliesSubProjects, getInputs, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTemporaryDir, getTemporaryDirFactory, getValidators, hasProperty, injectIntoNewInstance, isEnabled, isHasCustomActions, leftShift, mustRunAfter, onlyIf, onlyIf, prependParallelSafeAction, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setExecuter, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setName, setOnlyIf, setOnlyIf, setProject, setProperty, setShouldRunAfter, shouldRunAfter, toStringprotected FlywayExtension extension
public String driver
public String url
public String user
public String password
public String table
public String[] schemas
public String baselineVersion
public String baselineDescription
public String[] locations
Unprefixed locations or locations starting with classpath: point to a package on the classpath and may contain both sql and java-based migrations.
Locations starting with filesystem: point to a directory on the filesystem and may only contain sql migrations.
public String[] resolvers
(default: none)
public Boolean skipDefaultResolvers
(default: false)
public String sqlMigrationPrefix
Sql migrations have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix , which using the defaults translates to V1_1__My_description.sql
public String repeatableSqlMigrationPrefix
Repeatable sql migrations have the following file name structure: prefixSeparatorDESCRIPTIONsuffix , which using the defaults translates to R__My_description.sql
public String sqlMigrationSeparator
Sql migrations have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix , which using the defaults translates to V1_1__My_description.sql
public String sqlMigrationSuffix
Sql migrations have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix , which using the defaults translates to V1_1__My_description.sql
public String encoding
public Boolean placeholderReplacement
public String placeholderPrefix
public String placeholderSuffix
public String target
current designates the current version of the schema.public String[] callbacks
public Boolean skipDefaultCallbacks
(default: false)
public Boolean outOfOrder
public Boolean validateOnMigrate
public Boolean cleanOnValidationError
public Boolean ignoreMissingMigrations
true to continue normally and log a warning, false to fail fast with an exception.
(default: false)public Boolean ignoreFutureMigrations
true)public Boolean cleanDisabled
false)
This is especially useful for production environments where running clean can be quite a career limiting move.
public Boolean baselineOnMigrate
Whether to automatically call baseline when migrate is executed against a non-empty schema with no metadata table.
This schema will then be baselined with the baselineVersion before executing the migrations.
Only migrations above baselineVersion 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!
true if baseline should be called on migrate for non-empty schemas, false if not. (default: false)
public Boolean allowMixedMigrations
true if mixed migrations should be allowed. false if an error should be thrown instead. (default: false)
public String installedBy
null for the current database user of the connection. (default: null).
Copyright © 2017. All rights reserved.