Flywaypublic interface FlywayConfiguration
| Modifier and Type | Method | Description |
|---|---|---|
String |
getBaselineDescription() |
Retrieves the description to tag an existing schema with when executing baseline.
|
MigrationVersion |
getBaselineVersion() |
Retrieves the version to tag an existing schema with when executing baseline.
|
FlywayCallback[] |
getCallbacks() |
Gets the callbacks for lifecycle notifications.
|
ClassLoader |
getClassLoader() |
Retrieves the ClassLoader to use for loading migrations, resolvers, etc from the classpath.
|
DataSource |
getDataSource() |
Retrieves the dataSource to use to access the database.
|
OutputStream |
getDryRunOutput() |
The stream where to output the SQL statements of a migration dry run.
|
String |
getEncoding() |
Retrieves the encoding of Sql migrations.
|
ErrorHandler[] |
getErrorHandlers() |
Handlers for errors and warnings that occur during a migration.
|
String |
getInstalledBy() |
The username that will be recorded in the schema history table as having applied the migration.
|
String[] |
getLocations() |
Retrieves the locations to scan recursively for migrations.
|
String |
getPlaceholderPrefix() |
Retrieves the prefix of every placeholder.
|
Map<String,String> |
getPlaceholders() |
Retrieves the map of <placeholder, replacementValue> to apply to sql migration scripts.
|
String |
getPlaceholderSuffix() |
Retrieves the suffix of every placeholder.
|
String |
getRepeatableSqlMigrationPrefix() |
Retrieves the file name prefix for repeatable SQL migrations.
|
MigrationResolver[] |
getResolvers() |
Retrieves the The custom MigrationResolvers to be used in addition to the built-in ones for resolving Migrations to apply.
|
String[] |
getSchemas() |
Retrieves the schemas managed by Flyway.
|
String |
getSqlMigrationPrefix() |
The file name prefix for versioned SQL migrations.
|
String |
getSqlMigrationSeparator() |
Retrieves the file name separator for sql migrations.
|
String |
getSqlMigrationSuffix() |
Deprecated.
Use
getSqlMigrationSuffixes() instead. Will be removed in Flyway 6.0.0. |
String[] |
getSqlMigrationSuffixes() |
The file name suffixes for SQL migrations.
|
String |
getTable() |
Retrieves the name of the schema schema history table that will be used by Flyway.
|
MigrationVersion |
getTarget() |
Retrieves the target version up to which Flyway should consider migrations.
|
String |
getUndoSqlMigrationPrefix() |
The file name prefix for undo SQL migrations.
|
boolean |
isBaselineOnMigrate() |
Whether to automatically call baseline when migrate is executed against a non-empty schema with no schema history table.
|
boolean |
isCleanDisabled() |
Whether to disable clean.
|
boolean |
isCleanOnValidationError() |
Whether to automatically call clean or not when a validation error occurs.
|
boolean |
isGroup() |
Whether to group all pending migrations together in the same transaction when applying them (only recommended for databases with support for DDL transactions).
|
boolean |
isIgnoreFutureMigrations() |
Ignore future migrations when reading the schema history table.
|
boolean |
isIgnoreMissingMigrations() |
Ignore missing migrations when reading the schema history table.
|
boolean |
isMixed() |
Whether to allow mixing transactional and non-transactional statements within the same migration.
|
boolean |
isOutOfOrder() |
Allows migrations to be run "out of order".
|
boolean |
isPlaceholderReplacement() |
Checks whether placeholders should be replaced.
|
boolean |
isSkipDefaultCallbacks() |
Whether Flyway should skip the default callbacks.
|
boolean |
isSkipDefaultResolvers() |
Whether Flyway should skip the default resolvers.
|
boolean |
isValidateOnMigrate() |
Whether to automatically call validate or not when running migrate.
|
ClassLoader getClassLoader()
DataSource getDataSource()
MigrationVersion getBaselineVersion()
String getBaselineDescription()
MigrationResolver[] getResolvers()
boolean isSkipDefaultResolvers()
FlywayCallback[] getCallbacks()
boolean isSkipDefaultCallbacks()
String getSqlMigrationPrefix()
Versioned SQL migrations have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix , which using the defaults translates to V1.1__My_description.sql
String getUndoSqlMigrationPrefix()
Undo SQL migrations are responsible for undoing the effects of the versioned migration with the same version.
They have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix , which using the defaults translates to U1.1__My_description.sql
Flyway Pro and Flyway Enterprise only
String getRepeatableSqlMigrationPrefix()
Repeatable SQL migrations have the following file name structure: prefixSeparatorDESCRIPTIONsuffix , which using the defaults translates to R__My_description.sql
String getSqlMigrationSeparator()
Sql migrations have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix , which using the defaults translates to V1_1__My_description.sql
@Deprecated String getSqlMigrationSuffix()
getSqlMigrationSuffixes() instead. Will be removed in Flyway 6.0.0.Sql migrations have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix , which using the defaults translates to V1_1__My_description.sql
String[] getSqlMigrationSuffixes()
SQL migrations have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix , which using the defaults translates to V1_1__My_description.sql
Multiple suffixes (like .sql,.pkg,.pkb) can be specified for easier compatibility with other tools such as editors with specific file associations.
boolean isPlaceholderReplacement()
String getPlaceholderSuffix()
String getPlaceholderPrefix()
Map<String,String> getPlaceholders()
MigrationVersion getTarget()
current designates the current version of the schema.String getTable()
Retrieves the name of the schema schema history table that will be used by Flyway.
By default (single-schema mode) the schema history table is placed in the default schema for the connection provided by the datasource.
When the flyway.schemas property is set (multi-schema mode), the schema history table is placed in the first schema of the list.
String[] getSchemas()
Consequences:
String getEncoding()
String[] getLocations()
The location type is determined by its prefix.
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.
boolean isBaselineOnMigrate()
Whether to automatically call baseline when migrate is executed against a non-empty schema with no schema history table.
This schema will then be initialized 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)boolean isOutOfOrder()
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.
true if outOfOrder migrations should be applied, false if not. (default: false)boolean isIgnoreMissingMigrations()
true to continue normally and log a warning, false to fail fast with an exception.
(default: false)boolean isIgnoreFutureMigrations()
true to continue normally and log a warning, false to fail fast with an exception.
(default: true)boolean isValidateOnMigrate()
true if validate should be called. false if not. (default: true)boolean isCleanOnValidationError()
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 !
true if clean should be called. false if not. (default: false)boolean isCleanDisabled()
This is especially useful for production environments where running clean can be quite a career limiting move.
true to disabled clean. false to leave it enabled. (default: false)boolean isMixed()
true if mixed migrations should be allowed. false if an error should be thrown instead. (default: false)boolean isGroup()
true if migrations should be grouped. false if they should be applied individually instead. (default: false)String getInstalledBy()
null for the current database user of the connection. (default: null).ErrorHandler[] getErrorHandlers()
Flyway Pro and Flyway Enterprise only
OutputStream getDryRunOutput()
null if the SQL statements
are executed against the database directly.
Flyway Pro and Flyway Enterprise only
null if the SQL statements are executed against the database directly.Copyright © 2018. All rights reserved.