Class ClassicConfiguration
- java.lang.Object
-
- org.flywaydb.core.api.configuration.ClassicConfiguration
-
- All Implemented Interfaces:
Configuration
public class ClassicConfiguration extends java.lang.Object implements Configuration
JavaBean-style configuration for Flyway. This is primarily meant for compatibility with scenarios where the new FluentConfiguration isn't an easy fit, such as Spring XML bean configuration.This configuration can then be passed to Flyway using the
new Flyway(Configuration)constructor.
-
-
Constructor Summary
Constructors Constructor Description ClassicConfiguration()ClassicConfiguration(java.lang.ClassLoader classLoader)ClassicConfiguration(Configuration configuration)Creates a new configuration with the same values as this existing one.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidconfigure(java.util.Map<java.lang.String,java.lang.String> props)Configures Flyway with these properties.voidconfigure(java.util.Properties properties)Configures Flyway with these properties.voidconfigure(Configuration configuration)Configure with the same values as this existing configuration.voidconfigureUsingEnvVars()Configures Flyway using FLYWAY_* environment variables.java.util.List<org.flywaydb.core.extensibility.ApiExtension>getApiExtensions()Retrieves the API extensionsjava.lang.StringgetBaselineDescription()Retrieves the description to tag an existing schema with when executing baseline.java.lang.StringgetBaselineMigrationPrefix()The file name prefix for baseline migrations.MigrationVersiongetBaselineVersion()Retrieves the version to tag an existing schema with when executing baseline.Callback[]getCallbacks()Gets the callbacks for lifecycle notifications.MigrationPattern[]getCherryPick()Gets the migrations that Flyway should consider when migrating or undoing.java.lang.ClassLoadergetClassLoader()Retrieves the ClassLoader to use for loading migrations, resolvers, etc.intgetConnectRetries()The maximum number of retries when attempting to connect to the database.intgetConnectRetriesInterval()The maximum time between retries when attempting to connect to the database in seconds.javax.sql.DataSourcegetDataSource()Retrieves the dataSource to use to access the database.java.lang.StringgetDefaultSchema()The default schema managed by Flyway.java.io.OutputStreamgetDryRunOutput()The stream where to output the SQL statements of a migration dry run.java.nio.charset.CharsetgetEncoding()Retrieves the encoding of Sql migrations.java.lang.String[]getErrorOverrides()Rules for the built-in error handler that let you override specific SQL states and errors codes in order to force specific errors or warnings to be treated as debug messages, info messages, warnings or errors.<T extends org.flywaydb.core.extensibility.ApiExtension>
TgetExtensionConfiguration(java.lang.Class<T> clazz)Retrieves the API extension configurator of the requested classValidatePattern[]getIgnoreMigrationPatterns()Ignore migrations that match this comma-separated list of patterns when validating migrations.java.lang.StringgetInitSql()The SQL statements to run to initialize a new database connection immediately after opening it.java.lang.StringgetInstalledBy()The username that will be recorded in the schema history table as having applied the migration.ClassProvider<JavaMigration>getJavaMigrationClassProvider()Retrieves the custom ClassProvider to be used to look upJavaMigrationclasses.JavaMigration[]getJavaMigrations()The manually added Java-based migrations.java.util.Map<java.lang.String,java.lang.String>getJdbcProperties()Properties to pass to the JDBC driver object Flyway Teams onlyjava.lang.StringgetKerberosConfigFile()The path to the Kerberos config file.java.lang.StringgetLicenseKey()Your Flyway license key (FL01...).Location[]getLocations()Retrieves the locations to scan recursively for migrations.intgetLockRetryCount()The maximum number of retries when trying to obtain a lock.java.lang.String[]getLoggers()The loggers Flyway should use.java.lang.StringgetOracleKerberosCacheFile()java.lang.StringgetOracleKerberosConfigFile()java.lang.StringgetOracleWalletLocation()The location of your Oracle wallet, used to automatically sign in to your databases.java.lang.StringgetPassword()Retrieves the password used to construct the dataSource.java.lang.StringgetPlaceholderPrefix()Retrieves the prefix of every placeholder.java.util.Map<java.lang.String,java.lang.String>getPlaceholders()Retrieves the map of <placeholder, replacementValue> to apply to sql migration scripts.java.lang.StringgetPlaceholderSuffix()Retrieves the suffix of every placeholder.java.lang.StringgetRepeatableSqlMigrationPrefix()Retrieves the file name prefix for repeatable SQL migrations.MigrationResolver[]getResolvers()Retrieves the custom MigrationResolvers to be used in addition to the built-in ones for resolving Migrations to apply.ResourceProvidergetResourceProvider()Retrieves the custom ResourceProvider to be used to look up resources.java.lang.String[]getSchemas()The schemas managed by Flyway.java.lang.StringgetScriptPlaceholderPrefix()Retrieves the prefix of every script placeholder.java.lang.StringgetScriptPlaceholderSuffix()Retrieves the suffix of every script placeholder.java.lang.StringgetSqlMigrationPrefix()The file name prefix for versioned SQL migrations.java.lang.StringgetSqlMigrationSeparator()Retrieves the file name separator for sql migrations.java.lang.String[]getSqlMigrationSuffixes()The file name suffixes for SQL migrations.java.lang.StringgetSqlServerKerberosLoginFile()The path to the SQL Server Kerberos login file.java.lang.StringgetTable()Retrieves the name of the schema history table that will be used by Flyway.java.lang.StringgetTablespace()The tablespace where to create the schema history table that will be used by Flyway.MigrationVersiongetTarget()Gets the target version up to which Flyway should consider migrations.java.lang.StringgetUndoSqlMigrationPrefix()The file name prefix for undo SQL migrations.java.lang.StringgetUrl()Retrieves the url used to construct the dataSource.java.lang.StringgetUser()Retrieves the user used to construct the dataSource.booleanisBaselineOnMigrate()Whether to automatically call baseline when migrate is executed against a non-empty schema with no schema history table.booleanisBatch()Whether to batch SQL statements when executing them.booleanisCleanDisabled()Whether to disable clean.booleanisCleanOnValidationError()Whether to automatically call clean or not when a validation error occurs.booleanisCreateSchemas()Whether Flyway should attempt to create the schemas specified in the schemas property.booleanisDetectEncoding()Whether Flyway should try to automatically detect SQL migration file encodingbooleanisFailOnMissingLocations()Whether to fail if a location specified in the flyway.locations option doesn't existbooleanisFailOnMissingTarget()Whether to fail if no migration with the configured target version exists (default:true)booleanisGroup()Whether to group all pending migrations together in the same transaction when applying them (only recommended for databases with support for DDL transactions).booleanisIgnoreFutureMigrations()Deprecated.booleanisIgnoreIgnoredMigrations()Deprecated.booleanisIgnoreMissingMigrations()Deprecated.booleanisIgnorePendingMigrations()Deprecated.booleanisMixed()Whether to allow mixing transactional and non-transactional statements within the same migration.booleanisOracleSqlplus()Whether to Flyway's support for Oracle SQL*Plus commands should be activated.booleanisOracleSqlplusWarn()Whether Flyway should issue a warning instead of an error whenever it encounters an Oracle SQL*Plus statement it doesn't yet support.booleanisOutOfOrder()Allows migrations to be run "out of order".booleanisOutputQueryResults()Whether Flyway should output a table with the results of queries when executing migrations.booleanisPlaceholderReplacement()Checks whether placeholders should be replaced.booleanisSkipDefaultCallbacks()Whether Flyway should skip the default callbacks.booleanisSkipDefaultResolvers()Whether Flyway should skip the default resolvers.booleanisSkipExecutingMigrations()Whether Flyway should skip actually executing the contents of the migrations and only update the schema history table.booleanisStream()Whether to stream SQL migrations when executing them.booleanisValidateMigrationNaming()Whether to validate migrations and callbacks whose scripts do not obey the correct naming convention.booleanisValidateOnMigrate()Whether to automatically call validate or not when running migrate.voidloadCallbackLocation(java.lang.String path, boolean errorOnNotFound)Scan this location for classes that implement Callback.voidsetApiExtensions(java.util.List<org.flywaydb.core.extensibility.ApiExtension> apiExtensions)voidsetBaselineDescription(java.lang.String baselineDescription)Sets the description to tag an existing schema with when executing baseline.voidsetBaselineMigrationPrefix(java.lang.String baselineMigrationPrefix)Sets the file name prefix for baseline migrations.voidsetBaselineOnMigrate(boolean baselineOnMigrate)Whether to automatically call baseline when migrate is executed against a non-empty schema with no schema history table.voidsetBaselineVersion(MigrationVersion baselineVersion)Sets the version to tag an existing schema with when executing baseline.voidsetBaselineVersionAsString(java.lang.String baselineVersion)Sets the version to tag an existing schema with when executing baseline.voidsetBatch(boolean batch)Whether to batch SQL statements when executing them.voidsetCallbacks(Callback... callbacks)Set the callbacks for lifecycle notifications.voidsetCallbacksAsClassNames(java.lang.String... callbacks)Set the callbacks for lifecycle notifications.voidsetCherryPick(java.lang.String... cherryPickAsString)Gets the migrations that Flyway should consider when migrating or undoing.voidsetCherryPick(MigrationPattern... cherryPick)Gets the migrations that Flyway should consider when migrating or undoing.voidsetClassLoader(java.lang.ClassLoader classLoader)voidsetCleanDisabled(boolean cleanDisabled)Whether to disable clean.voidsetCleanOnValidationError(boolean cleanOnValidationError)Whether to automatically call clean or not when a validation error occurs.voidsetConnectRetries(int connectRetries)The maximum number of retries when attempting to connect to the database.voidsetConnectRetriesInterval(int connectRetriesInterval)The maximum time between retries when attempting to connect to the database in seconds.voidsetCreateSchemas(boolean createSchemas)voidsetDataSource(java.lang.String url, java.lang.String user, java.lang.String password)Sets the datasource to use.voidsetDataSource(javax.sql.DataSource dataSource)Sets the datasource to use.voidsetDefaultSchema(java.lang.String defaultSchema)Sets the default schema managed by Flyway.voidsetDetectEncoding(boolean detectEncoding)Whether Flyway should try to automatically detect SQL migration file encodingvoidsetDriver(java.lang.String driver)voidsetDryRunOutput(java.io.OutputStream dryRunOutput)Sets the stream where to output the SQL statements of a migration dry run.voidsetDryRunOutputAsFile(java.io.File dryRunOutput)Sets the file where to output the SQL statements of a migration dry run.voidsetDryRunOutputAsFileName(java.lang.String dryRunOutputFileName)Sets the file where to output the SQL statements of a migration dry run.voidsetEncoding(java.nio.charset.Charset encoding)Sets the encoding of SQL migrations.voidsetEncodingAsString(java.lang.String encoding)Sets the encoding of SQL migrations.voidsetErrorOverrides(java.lang.String... errorOverrides)Rules for the built-in error handler that let you override specific SQL states and errors codes in order to force specific errors or warnings to be treated as debug messages, info messages, warnings or errors.voidsetFailOnMissingLocations(boolean failOnMissingLocations)Whether to fail if a location specified in the flyway.locations option doesn't existvoidsetFailOnMissingTarget(boolean failOnMissingTarget)voidsetGroup(boolean group)Whether to group all pending migrations together in the same transaction when applying them (only recommended for databases with support for DDL transactions).voidsetIgnoreFutureMigrations(boolean ignoreFutureMigrations)Deprecated.Will remove in Flyway V9.voidsetIgnoreIgnoredMigrations(boolean ignoreIgnoredMigrations)Deprecated.Will remove in Flyway V9.voidsetIgnoreMigrationPatterns(java.lang.String... ignoreMigrationPatterns)Ignore migrations that match this comma-separated list of patterns when validating migrations.voidsetIgnoreMigrationPatterns(ValidatePattern... ignoreMigrationPatterns)Ignore migrations that match this array of ValidatePatterns when validating migrations.voidsetIgnoreMissingMigrations(boolean ignoreMissingMigrations)Deprecated.Will remove in Flyway V9.voidsetIgnorePendingMigrations(boolean ignorePendingMigrations)Deprecated.Will remove in Flyway V9.voidsetInitSql(java.lang.String initSql)The SQL statements to run to initialize a new database connection immediately after opening it.voidsetInstalledBy(java.lang.String installedBy)The username that will be recorded in the schema history table as having applied the migration.voidsetJavaMigrationClassProvider(ClassProvider<JavaMigration> javaMigrationClassProvider)voidsetJavaMigrations(JavaMigration... javaMigrations)The manually added Java-based migrations.voidsetJdbcProperties(java.util.Map<java.lang.String,java.lang.String> jdbcProperties)Properties to pass to the JDBC driver object.voidsetKerberosConfigFile(java.lang.String kerberosConfigFile)When connecting to a Kerberos service to authenticate, the path to the Kerberos config file.voidsetLicenseKey(java.lang.String licenseKey)Your Flyway license key (FL01...).voidsetLocations(Location... locations)Sets the locations to scan recursively for migrations.voidsetLocationsAsStrings(java.lang.String... locations)Sets the locations to scan recursively for migrations.voidsetLockRetryCount(int lockRetryCount)voidsetLoggers(java.lang.String... loggers)The loggers Flyway should use.voidsetMixed(boolean mixed)Whether to allow mixing transactional and non-transactional statements within the same migration.voidsetOracleKerberosCacheFile(java.lang.String oracleKerberosCacheFile)When Oracle needs to connect to a Kerberos service to authenticate, the location of the Kerberos cache.voidsetOracleKerberosConfigFile(java.lang.String oracleKerberosConfigFile)Deprecated.Will be removed in V9.voidsetOracleSqlplus(boolean oracleSqlplus)Whether Flyway's support for Oracle SQL*Plus commands should be activated.voidsetOracleSqlplusWarn(boolean oracleSqlplusWarn)Whether Flyway should issue a warning instead of an error whenever it encounters an Oracle SQL*Plus statementit doesn't yet support.voidsetOracleWalletLocation(java.lang.String oracleWalletLocation)The location of your Oracle wallet, used to automatically sign in to your databases.voidsetOutOfOrder(boolean outOfOrder)Allows migrations to be run "out of order".voidsetOutputQueryResults(boolean outputQueryResults)Whether Flyway should output a table with the results of queries when executing migrations.voidsetPassword(java.lang.String password)voidsetPlaceholderPrefix(java.lang.String placeholderPrefix)Sets the prefix of every placeholder.voidsetPlaceholderReplacement(boolean placeholderReplacement)Sets whether placeholders should be replaced.voidsetPlaceholders(java.util.Map<java.lang.String,java.lang.String> placeholders)Sets the placeholders to replace in SQL migration scripts.voidsetPlaceholderSuffix(java.lang.String placeholderSuffix)Sets the suffix of every placeholder.voidsetRepeatableSqlMigrationPrefix(java.lang.String repeatableSqlMigrationPrefix)Sets the file name prefix for repeatable sql migrations.voidsetResolvers(MigrationResolver... resolvers)Sets custom MigrationResolvers to be used in addition to the built-in ones for resolving Migrations to apply.voidsetResolversAsClassNames(java.lang.String... resolvers)Sets custom MigrationResolvers to be used in addition to the built-in ones for resolving Migrations to apply.voidsetResourceProvider(ResourceProvider resourceProvider)voidsetSchemas(java.lang.String[] schemas)Sets the schemas managed by Flyway.voidsetScriptPlaceholderPrefix(java.lang.String scriptPlaceholderPrefix)Sets the prefix of every script placeholder.voidsetScriptPlaceholderSuffix(java.lang.String scriptPlaceholderSuffix)Sets the suffix of every placeholder.voidsetShouldCreateSchemas(boolean createSchemas)Whether Flyway should attempt to create the schemas specified in the schemas property.voidsetSkipDefaultCallbacks(boolean skipDefaultCallbacks)Whether Flyway should skip the default callbacks.voidsetSkipDefaultResolvers(boolean skipDefaultResolvers)Whether Flyway should skip the default resolvers.voidsetSkipExecutingMigrations(boolean skipExecutingMigrations)Whether Flyway should skip actually executing the contents of the migrations and only update the schema history table.voidsetSqlMigrationPrefix(java.lang.String sqlMigrationPrefix)Sets the file name prefix for sql migrations.voidsetSqlMigrationSeparator(java.lang.String sqlMigrationSeparator)Sets the file name separator for sql migrations.voidsetSqlMigrationSuffixes(java.lang.String... sqlMigrationSuffixes)The file name suffixes for SQL migrations.voidsetSqlServerKerberosLoginFile(java.lang.String sqlServerKerberosLoginFile)When SQL Server needs to connect to a Kerberos service to authenticate, the path to the Kerberos login file.voidsetStream(boolean stream)Whether to stream SQL migrations when executing them.voidsetTable(java.lang.String table)Sets the name of the schema history table that will be used by Flyway.voidsetTablespace(java.lang.String tablespace)Sets the tablespace where to create the schema history table that will be used by Flyway.voidsetTarget(MigrationVersion target)Sets the target version up to which Flyway should consider migrations.voidsetTargetAsString(java.lang.String target)Sets the target version up to which Flyway should consider migrations.voidsetUndoSqlMigrationPrefix(java.lang.String undoSqlMigrationPrefix)Sets the file name prefix for undo SQL migrations.voidsetUrl(java.lang.String url)voidsetUser(java.lang.String user)voidsetValidateMigrationNaming(boolean validateMigrationNaming)Whether to validate migrations and callbacks whose scripts do not obey the correct naming convention.voidsetValidateOnMigrate(boolean validateOnMigrate)Whether to automatically call validate or not when running migrate.
-
-
-
Constructor Detail
-
ClassicConfiguration
public ClassicConfiguration()
-
ClassicConfiguration
public ClassicConfiguration(java.lang.ClassLoader classLoader)
- Parameters:
classLoader- The ClassLoader to use for loading migrations, resolvers, etc from the classpath. (default: Thread.currentThread().getContextClassLoader())
-
ClassicConfiguration
public ClassicConfiguration(Configuration configuration)
Creates a new configuration with the same values as this existing one.
-
-
Method Detail
-
getLocations
public Location[] getLocations()
Description copied from interface:ConfigurationRetrieves the locations to scan recursively for migrations. The location type is determined by its prefix. Unprefixed locations or locations starting withclasspath:point to a package on the classpath and may contain both SQL and Java-based migrations. Locations starting withfilesystem:point to a directory on the filesystem, may only contain SQL migrations and are only scanned recursively down non-hidden directories.- Specified by:
getLocationsin interfaceConfiguration- Returns:
- Locations to scan recursively for migrations. (default: classpath:db/migration)
-
getDataSource
public javax.sql.DataSource getDataSource()
Description copied from interface:ConfigurationRetrieves the dataSource to use to access the database. Must have the necessary privileges to execute DDL.- Specified by:
getDataSourcein interfaceConfiguration- Returns:
- The dataSource to use to access the database. Must have the necessary privileges to execute DDL.
-
getCallbacks
public Callback[] getCallbacks()
Description copied from interface:ConfigurationGets the callbacks for lifecycle notifications.- Specified by:
getCallbacksin interfaceConfiguration- Returns:
- The callbacks for lifecycle notifications. An empty array if none. (default: none)
-
setDryRunOutput
public void setDryRunOutput(java.io.OutputStream dryRunOutput)
Sets the stream where to output the SQL statements of a migration dry run.nullto execute the SQL statements directly against the database. The stream will be closed when Flyway finishes writing the output. Flyway Teams only- Parameters:
dryRunOutput- The output file ornullto execute the SQL statements directly against the database.
-
setDryRunOutputAsFile
public void setDryRunOutputAsFile(java.io.File dryRunOutput)
Sets the file where to output the SQL statements of a migration dry run.nullto execute the SQL statements directly against the database. If the file specified is in a non-existent directory, Flyway will create all directories and parent directories as needed. Flyway Teams only- Parameters:
dryRunOutput- The output file ornullto execute the SQL statements directly against the database.
-
setDryRunOutputAsFileName
public void setDryRunOutputAsFileName(java.lang.String dryRunOutputFileName)
Sets the file where to output the SQL statements of a migration dry run.nullto execute the SQL statements directly against the database. If the file specified is in a non-existent directory, Flyway will create all directories and parent directories as needed. Paths starting with s3: point to a bucket in AWS S3, which must exist. They are in the format s3:(/optionalfolder/subfolder)/filename.sql Paths starting with gcs: point to a bucket in Google Cloud Storage, which must exist. They are in the format gcs: (/optionalfolder/subfolder)/filename.sql Flyway Teams only - Parameters:
dryRunOutputFileName- The name of the output file ornullto execute the SQL statements directly against the database.
-
setErrorOverrides
public void setErrorOverrides(java.lang.String... errorOverrides)
Rules for the built-in error handler that let you override specific SQL states and errors codes in order to force specific errors or warnings to be treated as debug messages, info messages, warnings or errors.Each error override has the following format:
STATE:12345:W. It is a 5 character SQL state (or * to match all SQL states), a colon, the SQL error code (or * to match all SQL error codes), a colon and finally the desired behavior that should override the initial one.The following behaviors are accepted:
Dto force a debug messageD-to force a debug message, but do not show the original sql state and error codeIto force an info messageI-to force an info message, but do not show the original sql state and error codeWto force a warningW-to force a warning, but do not show the original sql state and error codeEto force an errorE-to force an error, but do not show the original sql state and error code
Example 1: to force Oracle stored procedure compilation issues to produce errors instead of warnings, the following errorOverride can be used:
99999:17110:EExample 2: to force SQL Server PRINT messages to be displayed as info messages (without SQL state and error code details) instead of warnings, the following errorOverride can be used:
S0001:0:I-Example 3: to force all errors with SQL error code 123 to be treated as warnings instead, the following errorOverride can be used:
Flyway Teams only*:123:W- Parameters:
errorOverrides- The ErrorOverrides or an empty array if none are defined. (default: none)
-
setInstalledBy
public void setInstalledBy(java.lang.String installedBy)
The username that will be recorded in the schema history table as having applied the migration.- Parameters:
installedBy- The username ornullfor the current database user of the connection. (default:null).
-
setLoggers
public void setLoggers(java.lang.String... loggers)
The loggers Flyway should use. Valid options are:- auto: Auto detect the logger (default behavior)
- console: Use stdout/stderr (only available when using the CLI)
- slf4j2: Use the slf4j2 logger
- log4j2: Use the log4j2 logger
- apache-commons: Use the Apache Commons logger
-
setIgnoreMigrationPatterns
public void setIgnoreMigrationPatterns(java.lang.String... ignoreMigrationPatterns)
Ignore migrations that match this comma-separated list of patterns when validating migrations. Each pattern is of the form: See https://flywaydb.org/documentation/configuration/parameters/ignoreMigrationPatterns for full details Example: repeatable:missing,versioned:pending,*:failed Flyway Teams only
-
setIgnoreMigrationPatterns
public void setIgnoreMigrationPatterns(ValidatePattern... ignoreMigrationPatterns)
Ignore migrations that match this array of ValidatePatterns when validating migrations. See https://flywaydb.org/documentation/configuration/parameters/ignoreMigrationPatterns for full details Flyway Teams only
-
setLocationsAsStrings
public void setLocationsAsStrings(java.lang.String... locations)
Sets the locations to scan recursively for migrations. The location type is determined by its prefix. Unprefixed locations or locations starting withclasspath:point to a package on the classpath and may contain both SQL and Java-based migrations. Locations starting withfilesystem:point to a directory on the filesystem, may only contain SQL migrations and are only scanned recursively down non-hidden directories.- Parameters:
locations- Locations to scan recursively for migrations. (default: db/migration)
-
setLocations
public void setLocations(Location... locations)
Sets the locations to scan recursively for migrations. The location type is determined by its prefix. Unprefixed locations or locations starting withclasspath:point to a package on the classpath and may contain both SQL and Java-based migrations. Locations starting withfilesystem:point to a directory on the filesystem, may only contain SQL migrations and are only scanned recursively down non-hidden directories.- Parameters:
locations- Locations to scan recursively for migrations. (default: db/migration)
-
setDetectEncoding
public void setDetectEncoding(boolean detectEncoding)
Whether Flyway should try to automatically detect SQL migration file encoding- Parameters:
detectEncoding-trueto enable auto detection,falseotherwise Flyway Teams only
-
setEncodingAsString
public void setEncodingAsString(java.lang.String encoding)
Sets the encoding of SQL migrations.- Parameters:
encoding- The encoding of SQL migrations. (default: UTF-8)
-
setTargetAsString
public void setTargetAsString(java.lang.String target)
Sets the target version up to which Flyway should consider migrations. Migrations with a higher version number will be ignored. Special values:current: Designates the current version of the schemalatest: The latest version of the schema, as defined by the migration with the highest versionnext: The next version of the schema, as defined by the first pending migration- <version>? (end with a '?'): Instructs Flyway not to fail if the target version doesn't exist. In this case, Flyway will go up to but not beyond the specified target (default: fail if the target version doesn't exist) Flyway Teams only
latest.
-
setCherryPick
public void setCherryPick(MigrationPattern... cherryPick)
Gets the migrations that Flyway should consider when migrating or undoing. Leave empty to consider all available migrations. Migrations not in this list will be ignored. Flyway Teams only
-
setCherryPick
public void setCherryPick(java.lang.String... cherryPickAsString)
Gets the migrations that Flyway should consider when migrating or undoing. Leave empty to consider all available migrations. Migrations not in this list will be ignored. Values should be the version for versioned migrations (e.g. 1, 2.4, 6.5.3) or the description for repeatable migrations (e.g. Insert_Data, Create_Table) Flyway Teams only
-
setPlaceholderPrefix
public void setPlaceholderPrefix(java.lang.String placeholderPrefix)
Sets the prefix of every placeholder.- Parameters:
placeholderPrefix- The prefix of every placeholder. (default: ${ )
-
setScriptPlaceholderPrefix
public void setScriptPlaceholderPrefix(java.lang.String scriptPlaceholderPrefix)
Sets the prefix of every script placeholder.- Parameters:
scriptPlaceholderPrefix- The prefix of every placeholder. (default: FP__ )
-
setPlaceholderSuffix
public void setPlaceholderSuffix(java.lang.String placeholderSuffix)
Sets the suffix of every placeholder.- Parameters:
placeholderSuffix- The suffix of every placeholder. (default: } )
-
setScriptPlaceholderSuffix
public void setScriptPlaceholderSuffix(java.lang.String scriptPlaceholderSuffix)
Sets the suffix of every placeholder.- Parameters:
scriptPlaceholderSuffix- The suffix of every placeholder. (default: __ )
-
setSqlMigrationPrefix
public void setSqlMigrationPrefix(java.lang.String sqlMigrationPrefix)
Sets the file name prefix for sql migrations. SQL migrations have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix, which using the defaults translates to V1_1__My_description.sql- Parameters:
sqlMigrationPrefix- The file name prefix for sql migrations (default: V)
-
setBaselineMigrationPrefix
public void setBaselineMigrationPrefix(java.lang.String baselineMigrationPrefix)
Sets the file name prefix for baseline migrations. They have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix, which using the defaults translates to B1.1__My_description.sql Flyway Teams only- Parameters:
baselineMigrationPrefix- The file name prefix for baseline migrations (default: B)
-
setUndoSqlMigrationPrefix
public void setUndoSqlMigrationPrefix(java.lang.String undoSqlMigrationPrefix)
Sets the file name prefix for undo SQL migrations. (default: U) 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 Teams only- Parameters:
undoSqlMigrationPrefix- The file name prefix for undo SQL migrations. (default: U)
-
setJavaMigrations
public void setJavaMigrations(JavaMigration... javaMigrations)
The manually added Java-based migrations. These are not Java-based migrations discovered through classpath scanning and instantiated by Flyway. Instead these are manually added instances of JavaMigration. This is particularly useful when working with a dependency injection container, where you may want the DI container to instantiate the class and wire up its dependencies for you.- Parameters:
javaMigrations- The manually added Java-based migrations. An empty array if none. (default: none)
-
setStream
public void setStream(boolean stream)
Whether to stream SQL migrations when executing them. Streaming doesn't load the entire migration in memory at once. Instead each statement is loaded individually. This is particularly useful for very large SQL migrations composed of multiple MB or even GB of reference data, as this dramatically reduces Flyway's memory consumption. Flyway Teams only- Parameters:
stream-trueto stream SQL migrations.falseto fully loaded them in memory instead. (default:false)
-
setBatch
public void setBatch(boolean batch)
Whether to batch SQL statements when executing them. Batching can save up to 99 percent of network roundtrips by sending up to 100 statements at once over the network to the database, instead of sending each statement individually. This is particularly useful for very large SQL migrations composed of multiple MB or even GB of reference data, as this can dramatically reduce the network overhead. This is supported for INSERT, UPDATE, DELETE, MERGE and UPSERT statements. All other statements are automatically executed without batching. Flyway Teams only- Parameters:
batch-trueto batch SQL statements.falseto execute them individually instead. (default:false)
-
setSqlMigrationSeparator
public void setSqlMigrationSeparator(java.lang.String sqlMigrationSeparator)
Sets the file name separator for sql migrations. SQL migrations have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix, which using the defaults translates to V1_1__My_description.sql- Parameters:
sqlMigrationSeparator- The file name separator for sql migrations (default: __)
-
setSqlMigrationSuffixes
public void setSqlMigrationSuffixes(java.lang.String... sqlMigrationSuffixes)
The file name suffixes for SQL migrations. (default: .sql) 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.- Parameters:
sqlMigrationSuffixes- The file name suffixes for SQL migrations.
-
setDataSource
public void setDataSource(javax.sql.DataSource dataSource)
Sets the datasource to use. Must have the necessary privileges to execute DDL.- Parameters:
dataSource- The datasource to use. Must have the necessary privileges to execute DDL.
-
setDataSource
public void setDataSource(java.lang.String url, java.lang.String user, java.lang.String password)Sets the datasource to use. Must have the necessary privileges to execute DDL. To use a custom ClassLoader, setClassLoader() must be called prior to calling this method.- Parameters:
url- The JDBC URL of the database.user- The user of the database.password- The password of the database.
-
setConnectRetries
public void setConnectRetries(int connectRetries)
The maximum number of retries when attempting to connect to the database. After each failed attempt, Flyway will wait 1 second before attempting to connect again, up to the maximum number of times specified by connectRetries. The interval between retries doubles with each subsequent attempt.- Parameters:
connectRetries- The maximum number of retries (default: 0).
-
setConnectRetriesInterval
public void setConnectRetriesInterval(int connectRetriesInterval)
The maximum time between retries when attempting to connect to the database in seconds. This will cap the interval between connect retry to the value provided.- Parameters:
connectRetriesInterval- The maximum time between retries in seconds (default: 120).
-
setBaselineVersionAsString
public void setBaselineVersionAsString(java.lang.String baselineVersion)
Sets the version to tag an existing schema with when executing baseline.- Parameters:
baselineVersion- The version to tag an existing schema with when executing baseline. (default: 1)
-
setSkipExecutingMigrations
public void setSkipExecutingMigrations(boolean skipExecutingMigrations)
Whether Flyway should skip actually executing the contents of the migrations and only update the schema history table. This should be used when you have applied a migration manually (via executing the sql yourself, or via an IDE), and just want the schema history table to reflect this. Use in conjunction withcherryPickto skip specific migrations instead of all pending ones. Flyway Teams only
-
setCallbacks
public void setCallbacks(Callback... callbacks)
Set the callbacks for lifecycle notifications.- Parameters:
callbacks- The callbacks for lifecycle notifications. (default: none)
-
setCallbacksAsClassNames
public void setCallbacksAsClassNames(java.lang.String... callbacks)
Set the callbacks for lifecycle notifications.- Parameters:
callbacks- The fully qualified class names, or full qualified package to scan, of the callbacks for lifecycle notifications. (default: none)
-
loadCallbackLocation
public void loadCallbackLocation(java.lang.String path, boolean errorOnNotFound)Scan this location for classes that implement Callback.- Parameters:
path- The path to scan.errorOnNotFound- Whether to show an error if the location is not found.
-
setResolvers
public void setResolvers(MigrationResolver... resolvers)
Sets custom MigrationResolvers to be used in addition to the built-in ones for resolving Migrations to apply.- Parameters:
resolvers- The custom MigrationResolvers to be used in addition to the built-in ones for resolving Migrations to apply. (default: empty list)
-
setResolversAsClassNames
public void setResolversAsClassNames(java.lang.String... resolvers)
Sets custom MigrationResolvers to be used in addition to the built-in ones for resolving Migrations to apply.- Parameters:
resolvers- The fully qualified class names of the custom MigrationResolvers to be used in addition to the built-in ones for resolving Migrations to apply. (default: empty list)
-
setOracleSqlplus
public void setOracleSqlplus(boolean oracleSqlplus)
Whether Flyway's support for Oracle SQL*Plus commands should be activated. Flyway Teams only- Parameters:
oracleSqlplus-trueto active SQL*Plus support.falseto fail fast instead. (default:false)
-
setOracleSqlplusWarn
public void setOracleSqlplusWarn(boolean oracleSqlplusWarn)
Whether Flyway should issue a warning instead of an error whenever it encounters an Oracle SQL*Plus statementit doesn't yet support. Flyway Teams only- Parameters:
oracleSqlplusWarn-trueto issue a warning.falseto fail fast instead. (default:false)
-
setOracleKerberosConfigFile
public void setOracleKerberosConfigFile(java.lang.String oracleKerberosConfigFile)
Deprecated.Will be removed in V9. Please usesetKerberosConfigFile(String)When Oracle needs to connect to a Kerberos service to authenticate, the location of the Kerberos configuration. Flyway Teams only
-
setOracleKerberosCacheFile
public void setOracleKerberosCacheFile(java.lang.String oracleKerberosCacheFile)
When Oracle needs to connect to a Kerberos service to authenticate, the location of the Kerberos cache. Flyway Teams only
-
setSqlServerKerberosLoginFile
public void setSqlServerKerberosLoginFile(java.lang.String sqlServerKerberosLoginFile)
When SQL Server needs to connect to a Kerberos service to authenticate, the path to the Kerberos login file. Flyway Teams only
-
setKerberosConfigFile
public void setKerberosConfigFile(java.lang.String kerberosConfigFile)
When connecting to a Kerberos service to authenticate, the path to the Kerberos config file. Flyway Teams only
-
setOracleWalletLocation
public void setOracleWalletLocation(java.lang.String oracleWalletLocation)
The location of your Oracle wallet, used to automatically sign in to your databases. Flyway Teams only- Parameters:
oracleWalletLocation- The path to your Oracle Wallet
-
setShouldCreateSchemas
public void setShouldCreateSchemas(boolean createSchemas)
Whether Flyway should attempt to create the schemas specified in the schemas property.- Parameters:
createSchemas-
-
setLicenseKey
public void setLicenseKey(java.lang.String licenseKey)
Your Flyway license key (FL01...). Not yet a Flyway Teams Edition customer? Request your Flyway trial license key to try out Flyway Teams Edition features free for 30 days. Flyway Teams only
-
setOutputQueryResults
public void setOutputQueryResults(boolean outputQueryResults)
Whether Flyway should output a table with the results of queries when executing migrations. Flyway Teams only
-
setJdbcProperties
public void setJdbcProperties(java.util.Map<java.lang.String,java.lang.String> jdbcProperties)
Properties to pass to the JDBC driver object. Flyway Teams only
-
getExtensionConfiguration
public <T extends org.flywaydb.core.extensibility.ApiExtension> T getExtensionConfiguration(java.lang.Class<T> clazz)
Description copied from interface:ConfigurationRetrieves the API extension configurator of the requested class- Specified by:
getExtensionConfigurationin interfaceConfiguration
-
configure
public void configure(Configuration configuration)
Configure with the same values as this existing configuration.
-
configure
public void configure(java.util.Properties properties)
Configures Flyway with these properties. This overwrites any existing configuration. Properties are documented here: https://flywaydb.org/documentation/configuration/parameters/To use a custom ClassLoader, setClassLoader() must be called prior to calling this method.
- Parameters:
properties- Properties used for configuration.- Throws:
FlywayException- when the configuration failed.
-
configure
public void configure(java.util.Map<java.lang.String,java.lang.String> props)
Configures Flyway with these properties. This overwrites any existing configuration. Properties are documented here: https://flywaydb.org/documentation/configuration/parameters/To use a custom ClassLoader, it must be passed to the Flyway constructor prior to calling this method.
- Parameters:
props- Properties used for configuration.- Throws:
FlywayException- when the configuration failed.
-
configureUsingEnvVars
public void configureUsingEnvVars()
Configures Flyway using FLYWAY_* environment variables.
-
getApiExtensions
public java.util.List<org.flywaydb.core.extensibility.ApiExtension> getApiExtensions()
Description copied from interface:ConfigurationRetrieves the API extensions- Specified by:
getApiExtensionsin interfaceConfiguration
-
getUrl
public java.lang.String getUrl()
Description copied from interface:ConfigurationRetrieves the url used to construct the dataSource. May be null if the dataSource was passed in directly.- Specified by:
getUrlin interfaceConfiguration- Returns:
- The url used to construct the dataSource. May be null if the dataSource was passed in directly.
-
getUser
public java.lang.String getUser()
Description copied from interface:ConfigurationRetrieves the user used to construct the dataSource. May be null if the dataSource was passed in directly, or if dataSource did not need a user.- Specified by:
getUserin interfaceConfiguration- Returns:
- The user used to construct the dataSource. May be null if the dataSource was passed in directly, or if dataSource did not need a user.
-
getPassword
public java.lang.String getPassword()
Description copied from interface:ConfigurationRetrieves the password used to construct the dataSource. May be null if the dataSource was passed in directly, or if dataSource did not need a password.- Specified by:
getPasswordin interfaceConfiguration- Returns:
- The password used to construct the dataSource. May be null if the dataSource was passed in directly, or if dataSource did not need a password.
-
getConnectRetries
public int getConnectRetries()
Description copied from interface:ConfigurationThe maximum number of retries when attempting to connect to the database. After each failed attempt, Flyway will wait 1 second before attempting to connect again, up to the maximum number of times specified by connectRetries. The interval between retries doubles with each subsequent attempt.- Specified by:
getConnectRetriesin interfaceConfiguration- Returns:
- The maximum number of retries when attempting to connect to the database. (default: 0)
-
getConnectRetriesInterval
public int getConnectRetriesInterval()
Description copied from interface:ConfigurationThe maximum time between retries when attempting to connect to the database in seconds. This will cap the interval between connect retry to the value provided.- Specified by:
getConnectRetriesIntervalin interfaceConfiguration- Returns:
- The maximum time between retries in seconds (default: 120)
-
getInitSql
public java.lang.String getInitSql()
Description copied from interface:ConfigurationThe SQL statements to run to initialize a new database connection immediately after opening it.- Specified by:
getInitSqlin interfaceConfiguration- Returns:
- The SQL statements. (default:
null)
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
Description copied from interface:ConfigurationRetrieves the ClassLoader to use for loading migrations, resolvers, etc. from the classpath.- Specified by:
getClassLoaderin interfaceConfiguration- Returns:
- The ClassLoader to use for loading migrations, resolvers, etc. from the classpath. (default: Thread.currentThread().getContextClassLoader() )
-
getEncoding
public java.nio.charset.Charset getEncoding()
Description copied from interface:ConfigurationRetrieves the encoding of Sql migrations.- Specified by:
getEncodingin interfaceConfiguration- Returns:
- The encoding of Sql migrations. (default: UTF-8)
-
isDetectEncoding
public boolean isDetectEncoding()
Description copied from interface:ConfigurationWhether Flyway should try to automatically detect SQL migration file encoding- Specified by:
isDetectEncodingin interfaceConfiguration- Returns:
trueto enable auto detection,falseotherwise Flyway Teams only
-
getDefaultSchema
public java.lang.String getDefaultSchema()
Description copied from interface:ConfigurationThe default schema managed by Flyway. This schema name is case-sensitive. If not specified, but schemas is, Flyway uses the first schema in that list. If that is also not specified, Flyway uses the default schema for the database connection.Consequences:
- This schema will be the one containing the schema history table.
- This schema will be the default for the database connection (provided the database supports this concept).
- Specified by:
getDefaultSchemain interfaceConfiguration- Returns:
- The default schema managed by Flyway, which is where the schema history table will reside. (default: The first schema specified in getSchemas(), and failing that the default schema for the database connection)
-
getSchemas
public java.lang.String[] getSchemas()
Description copied from interface:ConfigurationThe schemas managed by Flyway. These schema names are case-sensitive. If not specified, Flyway uses the default schema for the database connection. If defaultSchema is not specified, then the first of this list also acts as the default schema.Consequences:
- Flyway will automatically attempt to create all these schemas, unless they already exist.
- The schemas will be cleaned in the order of this list.
- If Flyway created them, the schemas themselves will be dropped when cleaning.
- Specified by:
getSchemasin interfaceConfiguration- Returns:
- The schemas managed by Flyway. (default: The default schema for the database connection)
-
getTable
public java.lang.String getTable()
Description copied from interface:ConfigurationRetrieves the name of the 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, or in the schema specified to flyway.defaultSchema.- Specified by:
getTablein interfaceConfiguration- Returns:
- The name of the schema history table that will be used by Flyway. (default: flyway_schema_history)
-
getTablespace
public java.lang.String getTablespace()
Description copied from interface:ConfigurationThe tablespace where to create the schema history table that will be used by Flyway. If not specified, Flyway uses the default tablespace for the database connection. This setting is only relevant for databases that do support the notion of tablespace. Its value is simply ignored for all others.- Specified by:
getTablespacein interfaceConfiguration- Returns:
- The tablespace where to create the schema history table that will be used by Flyway.
-
getTarget
public MigrationVersion getTarget()
Description copied from interface:ConfigurationGets the target version up to which Flyway should consider migrations. Migrations with a higher version number will be ignored. Special values:current: Designates the current version of the schemalatest: The latest version of the schema, as defined by the migration with the highest versionnext: The next version of the schema, as defined by the first pending migration- <version>? (end with a '?'): Instructs Flyway not to fail if the target version doesn't exist. In this case, Flyway will go up to but not beyond the specified target (default: fail if the target version doesn't exist) Flyway Teams only
- Specified by:
getTargetin interfaceConfiguration- Returns:
- The target version up to which Flyway should consider migrations. Defaults to
latest
-
isFailOnMissingTarget
public boolean isFailOnMissingTarget()
Description copied from interface:ConfigurationWhether to fail if no migration with the configured target version exists (default:true)- Specified by:
isFailOnMissingTargetin interfaceConfiguration
-
getCherryPick
public MigrationPattern[] getCherryPick()
Description copied from interface:ConfigurationGets the migrations that Flyway should consider when migrating or undoing. Leave empty to consider all available migrations. Migrations not in this list will be ignored. Flyway Teams only- Specified by:
getCherryPickin interfaceConfiguration- Returns:
- The migrations that Flyway should consider when migrating or undoing.
-
isPlaceholderReplacement
public boolean isPlaceholderReplacement()
Description copied from interface:ConfigurationChecks whether placeholders should be replaced.- Specified by:
isPlaceholderReplacementin interfaceConfiguration- Returns:
- Whether placeholders should be replaced. (default: true)
-
getPlaceholders
public java.util.Map<java.lang.String,java.lang.String> getPlaceholders()
Description copied from interface:ConfigurationRetrieves the map of <placeholder, replacementValue> to apply to sql migration scripts.- Specified by:
getPlaceholdersin interfaceConfiguration- Returns:
- The map of <placeholder, replacementValue> to apply to sql migration scripts.
-
getPlaceholderPrefix
public java.lang.String getPlaceholderPrefix()
Description copied from interface:ConfigurationRetrieves the prefix of every placeholder.- Specified by:
getPlaceholderPrefixin interfaceConfiguration- Returns:
- The prefix of every placeholder. (default: ${ )
-
getPlaceholderSuffix
public java.lang.String getPlaceholderSuffix()
Description copied from interface:ConfigurationRetrieves the suffix of every placeholder.- Specified by:
getPlaceholderSuffixin interfaceConfiguration- Returns:
- The suffix of every placeholder. (default: } )
-
getScriptPlaceholderPrefix
public java.lang.String getScriptPlaceholderPrefix()
Description copied from interface:ConfigurationRetrieves the prefix of every script placeholder.- Specified by:
getScriptPlaceholderPrefixin interfaceConfiguration- Returns:
- The prefix of every script placeholder. (default: FP__ )
-
getScriptPlaceholderSuffix
public java.lang.String getScriptPlaceholderSuffix()
Description copied from interface:ConfigurationRetrieves the suffix of every script placeholder.- Specified by:
getScriptPlaceholderSuffixin interfaceConfiguration- Returns:
- The suffix of every script placeholder. (default: __ )
-
getSqlMigrationPrefix
public java.lang.String getSqlMigrationPrefix()
Description copied from interface:ConfigurationThe file name prefix for versioned SQL migrations. Versioned SQL migrations have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix, which using the defaults translates to V1.1__My_description.sql- Specified by:
getSqlMigrationPrefixin interfaceConfiguration- Returns:
- The file name prefix for sql migrations. (default: V)
-
getBaselineMigrationPrefix
public java.lang.String getBaselineMigrationPrefix()
Description copied from interface:ConfigurationThe file name prefix for baseline migrations. Baseline migrations represent all migrations with version <= current baseline migration version while keeping older migrations if needed for upgrading older deployments They have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix, which using the defaults translates to B1.1__My_description.sql Flyway Teams only- Specified by:
getBaselineMigrationPrefixin interfaceConfiguration- Returns:
- The file name prefix for baseline migration. (default: B)
-
getUndoSqlMigrationPrefix
public java.lang.String getUndoSqlMigrationPrefix()
Description copied from interface:ConfigurationThe file name prefix for undo SQL migrations. 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 Teams only- Specified by:
getUndoSqlMigrationPrefixin interfaceConfiguration- Returns:
- The file name prefix for undo sql migrations. (default: U)
-
getRepeatableSqlMigrationPrefix
public java.lang.String getRepeatableSqlMigrationPrefix()
Description copied from interface:ConfigurationRetrieves the file name prefix for repeatable SQL migrations. Repeatable SQL migrations have the following file name structure: prefixSeparatorDESCRIPTIONsuffix, which using the defaults translates to R__My_description.sql<- Specified by:
getRepeatableSqlMigrationPrefixin interfaceConfiguration- Returns:
- The file name prefix for repeatable sql migrations. (default: R)
-
getResourceProvider
public ResourceProvider getResourceProvider()
Description copied from interface:ConfigurationRetrieves the custom ResourceProvider to be used to look up resources. If not set, the default strategy will be used.- Specified by:
getResourceProviderin interfaceConfiguration- Returns:
- The custom ResourceProvider to be used to look up resources (default: null)
-
getJavaMigrationClassProvider
public ClassProvider<JavaMigration> getJavaMigrationClassProvider()
Description copied from interface:ConfigurationRetrieves the custom ClassProvider to be used to look upJavaMigrationclasses. If not set, the default strategy will be used.- Specified by:
getJavaMigrationClassProviderin interfaceConfiguration- Returns:
- The custom ClassProvider to be used to look up
JavaMigrationclasses (default: null)
-
getSqlMigrationSeparator
public java.lang.String getSqlMigrationSeparator()
Description copied from interface:ConfigurationRetrieves the file name separator for sql migrations. SQL migrations have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix, which using the defaults translates to V1_1__My_description.sql- Specified by:
getSqlMigrationSeparatorin interfaceConfiguration- Returns:
- The file name separator for sql migrations. (default: __)
-
getSqlMigrationSuffixes
public java.lang.String[] getSqlMigrationSuffixes()
Description copied from interface:ConfigurationThe file name suffixes for SQL migrations. (default: .sql) 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.- Specified by:
getSqlMigrationSuffixesin interfaceConfiguration- Returns:
- The file name suffixes for SQL migrations.
-
getJavaMigrations
public JavaMigration[] getJavaMigrations()
Description copied from interface:ConfigurationThe manually added Java-based migrations. These are not Java-based migrations discovered through classpath scanning and instantiated by Flyway. Instead these are manually added instances of JavaMigration. This is particularly useful when working with a dependency injection container, where you may want the DI container to instantiate the class and wire up its dependencies for you.- Specified by:
getJavaMigrationsin interfaceConfiguration- Returns:
- The manually added Java-based migrations. An empty array if none. (default: none)
-
isIgnoreMissingMigrations
@Deprecated public boolean isIgnoreMissingMigrations()
Deprecated.- Specified by:
isIgnoreMissingMigrationsin interfaceConfiguration- Returns:
trueto continue normally and log a warning,falseto fail fast with an exception. (default:false)
-
isIgnoreIgnoredMigrations
@Deprecated public boolean isIgnoreIgnoredMigrations()
Deprecated.- Specified by:
isIgnoreIgnoredMigrationsin interfaceConfiguration- Returns:
trueto continue normally,falseto fail fast with an exception. (default:false)
-
isIgnorePendingMigrations
@Deprecated public boolean isIgnorePendingMigrations()
Deprecated.- Specified by:
isIgnorePendingMigrationsin interfaceConfiguration- Returns:
trueto continue normally,falseto fail fast with an exception. (default:false)
-
isIgnoreFutureMigrations
@Deprecated public boolean isIgnoreFutureMigrations()
Deprecated.- Specified by:
isIgnoreFutureMigrationsin interfaceConfiguration- Returns:
trueto continue normally and log a warning,falseto fail fast with an exception. (default:true)
-
getIgnoreMigrationPatterns
public ValidatePattern[] getIgnoreMigrationPatterns()
Description copied from interface:ConfigurationIgnore migrations that match this comma-separated list of patterns when validating migrations. Each pattern is of the form: See https://flywaydb.org/documentation/configuration/parameters/ignoreMigrationPatterns for full details Example: repeatable:missing,versioned:pending,*:failed Flyway Teams only - Specified by:
getIgnoreMigrationPatternsin interfaceConfiguration
-
isValidateMigrationNaming
public boolean isValidateMigrationNaming()
Description copied from interface:ConfigurationWhether to validate migrations and callbacks whose scripts do not obey the correct naming convention. A failure can be useful to check that errors such as case sensitivity in migration prefixes have been corrected.- Specified by:
isValidateMigrationNamingin interfaceConfiguration- Returns:
falseto continue normally,trueto fail fast with an exception. (default:false)
-
isValidateOnMigrate
public boolean isValidateOnMigrate()
Description copied from interface:ConfigurationWhether to automatically call validate or not when running migrate.- Specified by:
isValidateOnMigratein interfaceConfiguration- Returns:
trueif validate should be called.falseif not. (default:true)
-
isCleanOnValidationError
public boolean isCleanOnValidationError()
Description copied from interface:ConfigurationWhether to automatically call clean or not when a validation error occurs. This is exclusively intended as a convenience for development. even though 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!- Specified by:
isCleanOnValidationErrorin interfaceConfiguration- Returns:
trueif clean should be called.falseif not. (default:false)
-
isCleanDisabled
public boolean isCleanDisabled()
Description copied from interface:ConfigurationWhether to disable clean. This is especially useful for production environments where running clean can be quite a career limiting move.- Specified by:
isCleanDisabledin interfaceConfiguration- Returns:
trueto disable clean.falseto leave it enabled. (default:false)
-
getBaselineVersion
public MigrationVersion getBaselineVersion()
Description copied from interface:ConfigurationRetrieves the version to tag an existing schema with when executing baseline.- Specified by:
getBaselineVersionin interfaceConfiguration- Returns:
- The version to tag an existing schema with when executing baseline. (default: 1)
-
getBaselineDescription
public java.lang.String getBaselineDescription()
Description copied from interface:ConfigurationRetrieves the description to tag an existing schema with when executing baseline.- Specified by:
getBaselineDescriptionin interfaceConfiguration- Returns:
- The description to tag an existing schema with when executing baseline. (default: << Flyway Baseline >>)
-
isBaselineOnMigrate
public boolean isBaselineOnMigrate()
Description copied from interface:ConfigurationWhether 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 thebaselineVersionbefore executing the migrations. Only migrations abovebaselineVersionwill 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!- Specified by:
isBaselineOnMigratein interfaceConfiguration- Returns:
trueif baseline should be called on migrate for non-empty schemas,falseif not. (default:false)
-
isOutOfOrder
public boolean isOutOfOrder()
Description copied from interface:ConfigurationAllows migrations to be run "out of order". 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.- Specified by:
isOutOfOrderin interfaceConfiguration- Returns:
trueif outOfOrder migrations should be applied,falseif not. (default:false)
-
isSkipExecutingMigrations
public boolean isSkipExecutingMigrations()
Description copied from interface:ConfigurationWhether Flyway should skip actually executing the contents of the migrations and only update the schema history table. This should be used when you have applied a migration manually (via executing the sql yourself, or via an ide), and just want the schema history table to reflect this. Use in conjunction withcherryPickto skip specific migrations instead of all pending ones. Flyway Teams only- Specified by:
isSkipExecutingMigrationsin interfaceConfiguration- Returns:
trueif executing the migrations should be skipped on migrate,falseif not. (default:false)
-
isSkipDefaultCallbacks
public boolean isSkipDefaultCallbacks()
Description copied from interface:ConfigurationWhether Flyway should skip the default callbacks. If true, only custom callbacks are used.- Specified by:
isSkipDefaultCallbacksin interfaceConfiguration- Returns:
- Whether default built-in callbacks should be skipped. (default: false)
-
getResolvers
public MigrationResolver[] getResolvers()
Description copied from interface:ConfigurationRetrieves the custom MigrationResolvers to be used in addition to the built-in ones for resolving Migrations to apply.- Specified by:
getResolversin interfaceConfiguration- Returns:
- The custom MigrationResolvers to be used in addition to the built-in ones for resolving Migrations to apply. An empty array if none. (default: none)
-
isSkipDefaultResolvers
public boolean isSkipDefaultResolvers()
Description copied from interface:ConfigurationWhether Flyway should skip the default resolvers. If true, only custom resolvers are used.- Specified by:
isSkipDefaultResolversin interfaceConfiguration- Returns:
- Whether default built-in resolvers should be skipped. (default: false)
-
isMixed
public boolean isMixed()
Description copied from interface:ConfigurationWhether to allow mixing transactional and non-transactional statements within the same migration. Enabling this automatically causes the entire affected migration to be run without a transaction. Note that this is only applicable for PostgreSQL, Aurora PostgreSQL, SQL Server and SQLite which all have statements that do not run at all within a transaction. This is not to be confused with implicit transaction, as they occur in MySQL or Oracle, where even though a DDL statement was run within a transaction, the database will issue an implicit commit before and after its execution.- Specified by:
isMixedin interfaceConfiguration- Returns:
trueif mixed migrations should be allowed.falseif an error should be thrown instead. (default:false)
-
isGroup
public boolean isGroup()
Description copied from interface:ConfigurationWhether to group all pending migrations together in the same transaction when applying them (only recommended for databases with support for DDL transactions).- Specified by:
isGroupin interfaceConfiguration- Returns:
trueif migrations should be grouped.falseif they should be applied individually instead. (default:false)
-
getInstalledBy
public java.lang.String getInstalledBy()
Description copied from interface:ConfigurationThe username that will be recorded in the schema history table as having applied the migration.- Specified by:
getInstalledByin interfaceConfiguration- Returns:
- The username or
nullfor the current database user of the connection. (default:null).
-
isCreateSchemas
public boolean isCreateSchemas()
Description copied from interface:ConfigurationWhether Flyway should attempt to create the schemas specified in the schemas property.- Specified by:
isCreateSchemasin interfaceConfiguration- Returns:
-
getErrorOverrides
public java.lang.String[] getErrorOverrides()
Description copied from interface:ConfigurationRules for the built-in error handler that let you override specific SQL states and errors codes in order to force specific errors or warnings to be treated as debug messages, info messages, warnings or errors.Each error override has the following format:
STATE:12345:W. It is a 5 character SQL state (or * to match all SQL states), a colon, the SQL error code (or * to match all SQL error codes), a colon and finally the desired behavior that should override the initial one.The following behaviors are accepted:
Dto force a debug messageD-to force a debug message, but do not show the original sql state and error codeIto force an info messageI-to force an info message, but do not show the original sql state and error codeWto force a warningW-to force a warning, but do not show the original sql state and error codeEto force an errorE-to force an error, but do not show the original sql state and error code
Example 1: to force Oracle stored procedure compilation issues to produce errors instead of warnings, the following errorOverride can be used:
99999:17110:EExample 2: to force SQL Server PRINT messages to be displayed as info messages (without SQL state and error code details) instead of warnings, the following errorOverride can be used:
S0001:0:I-Example 3: to force all errors with SQL error code 123 to be treated as warnings instead, the following errorOverride can be used:
Flyway Teams only*:123:W- Specified by:
getErrorOverridesin interfaceConfiguration- Returns:
- The ErrorOverrides or an empty array if none are defined. (default: none)
-
getDryRunOutput
public java.io.OutputStream getDryRunOutput()
Description copied from interface:ConfigurationThe stream where to output the SQL statements of a migration dry run.nullif the SQL statements are executed against the database directly. Flyway Teams only- Specified by:
getDryRunOutputin interfaceConfiguration- Returns:
- The stream or
nullif the SQL statements are executed against the database directly.
-
isStream
public boolean isStream()
Description copied from interface:ConfigurationWhether to stream SQL migrations when executing them. Streaming doesn't load the entire migration in memory at once. Instead each statement is loaded individually. This is particularly useful for very large SQL migrations composed of multiple MB or even GB of reference data, as this dramatically reduces Flyway's memory consumption. Flyway Teams only- Specified by:
isStreamin interfaceConfiguration- Returns:
trueto stream SQL migrations.falseto fully loaded them in memory instead. (default:false)
-
isBatch
public boolean isBatch()
Description copied from interface:ConfigurationWhether to batch SQL statements when executing them. Batching can save up to 99 percent of network roundtrips by sending up to 100 statements at once over the network to the database, instead of sending each statement individually. This is particularly useful for very large SQL migrations composed of multiple MB or even GB of reference data, as this can dramatically reduce the network overhead. This is supported for INSERT, UPDATE, DELETE, MERGE and UPSERT statements. All other statements are automatically executed without batching. Flyway Teams only- Specified by:
isBatchin interfaceConfiguration- Returns:
trueto batch SQL statements.falseto execute them individually instead. (default:false)
-
isOutputQueryResults
public boolean isOutputQueryResults()
Description copied from interface:ConfigurationWhether Flyway should output a table with the results of queries when executing migrations. Flyway Teams only- Specified by:
isOutputQueryResultsin interfaceConfiguration- Returns:
trueto output the results table (default:true)
-
getLicenseKey
public java.lang.String getLicenseKey()
Description copied from interface:ConfigurationYour Flyway license key (FL01...). Not yet a Flyway Teams Edition customer? Request your Flyway trial license key to try out Flyway Teams Edition features free for 30 days. Flyway Teams only- Specified by:
getLicenseKeyin interfaceConfiguration- Returns:
- Your Flyway license key.
-
getLockRetryCount
public int getLockRetryCount()
Description copied from interface:ConfigurationThe maximum number of retries when trying to obtain a lock. -1 indicates attempting to repeat indefinitely.- Specified by:
getLockRetryCountin interfaceConfiguration
-
getJdbcProperties
public java.util.Map<java.lang.String,java.lang.String> getJdbcProperties()
Description copied from interface:ConfigurationProperties to pass to the JDBC driver object Flyway Teams only- Specified by:
getJdbcPropertiesin interfaceConfiguration- Returns:
- Properties that will be passed to the JDBC driver object
-
isOracleSqlplus
public boolean isOracleSqlplus()
Description copied from interface:ConfigurationWhether to Flyway's support for Oracle SQL*Plus commands should be activated. Flyway Teams only- Specified by:
isOracleSqlplusin interfaceConfiguration- Returns:
trueto active SQL*Plus support.falseto fail fast instead. (default:false)
-
isOracleSqlplusWarn
public boolean isOracleSqlplusWarn()
Description copied from interface:ConfigurationWhether Flyway should issue a warning instead of an error whenever it encounters an Oracle SQL*Plus statement it doesn't yet support. Flyway Teams only- Specified by:
isOracleSqlplusWarnin interfaceConfiguration- Returns:
trueto issue a warning.falseto fail fast instead. (default:false)
-
getKerberosConfigFile
public java.lang.String getKerberosConfigFile()
Description copied from interface:ConfigurationThe path to the Kerberos config file. Flyway Teams only- Specified by:
getKerberosConfigFilein interfaceConfiguration
-
getOracleKerberosConfigFile
public java.lang.String getOracleKerberosConfigFile()
- Specified by:
getOracleKerberosConfigFilein interfaceConfiguration
-
getOracleKerberosCacheFile
public java.lang.String getOracleKerberosCacheFile()
- Specified by:
getOracleKerberosCacheFilein interfaceConfiguration
-
getSqlServerKerberosLoginFile
public java.lang.String getSqlServerKerberosLoginFile()
Description copied from interface:ConfigurationThe path to the SQL Server Kerberos login file. Flyway Teams only- Specified by:
getSqlServerKerberosLoginFilein interfaceConfiguration
-
getOracleWalletLocation
public java.lang.String getOracleWalletLocation()
Description copied from interface:ConfigurationThe location of your Oracle wallet, used to automatically sign in to your databases. Flyway Teams only- Specified by:
getOracleWalletLocationin interfaceConfiguration
-
isFailOnMissingLocations
public boolean isFailOnMissingLocations()
Description copied from interface:ConfigurationWhether to fail if a location specified in the flyway.locations option doesn't exist- Specified by:
isFailOnMissingLocationsin interfaceConfiguration- Returns:
-
getLoggers
public java.lang.String[] getLoggers()
Description copied from interface:ConfigurationThe loggers Flyway should use. Valid options are:- auto: Auto detect the logger (default behavior)
- console: Use stdout/stderr (only available when using the CLI)
- slf4j2: Use the slf4j2 logger
- log4j2: Use the log4j2 logger
- apache-commons: Use the Apache Commons logger
- Specified by:
getLoggersin interfaceConfiguration
-
setApiExtensions
public void setApiExtensions(java.util.List<org.flywaydb.core.extensibility.ApiExtension> apiExtensions)
-
setDriver
public void setDriver(java.lang.String driver)
-
setUrl
public void setUrl(java.lang.String url)
-
setUser
public void setUser(java.lang.String user)
-
setPassword
public void setPassword(java.lang.String password)
-
setInitSql
public void setInitSql(java.lang.String initSql)
The SQL statements to run to initialize a new database connection immediately after opening it.- Parameters:
initSql- The SQL statements. (default:null)
-
setClassLoader
public void setClassLoader(java.lang.ClassLoader classLoader)
-
setEncoding
public void setEncoding(java.nio.charset.Charset encoding)
Sets the encoding of SQL migrations.- Parameters:
encoding- The encoding of SQL migrations. (default: UTF-8)
-
setDefaultSchema
public void setDefaultSchema(java.lang.String defaultSchema)
Sets the default schema managed by Flyway. This schema name is case-sensitive. If not specified, but schemas is, Flyway uses the first schema in that list. If that is also not specified, Flyway uses the default schema for the database connection.Consequences:
- This schema will be the one containing the schema history table.
- This schema will be the default for the database connection (provided the database supports this concept).
- Parameters:
schema- The default schema managed by Flyway, which is where the schema history table will reside.
-
setSchemas
public void setSchemas(java.lang.String[] schemas)
Sets the schemas managed by Flyway. These schema names are case-sensitive. If not specified, Flyway uses the default schema for the database connection. If defaultSchema is not specified, then the first of this list also acts as the default schema.Consequences:
- Flyway will automatically attempt to create all these schemas, unless they already exist.
- The schemas will be cleaned in the order of this list.
- If Flyway created them, the schemas themselves will be dropped when cleaning.
- Parameters:
schemas- The schemas managed by Flyway. May not benull. Must contain at least one element.
-
setTable
public void setTable(java.lang.String table)
Sets the name of the 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, or in the schema specified to flyway.defaultSchema.- Parameters:
table- The name of the schema history table that will be used by Flyway. (default: flyway_schema_history)
-
setTablespace
public void setTablespace(java.lang.String tablespace)
Sets the tablespace where to create the schema history table that will be used by Flyway. If not specified, Flyway uses the default tablespace for the database connection.This setting is only relevant for databases that do support the notion of tablespaces. Its value is simply ignored for all others.- Parameters:
tablespace- The tablespace where to create the schema history table that will be used by Flyway.
-
setTarget
public void setTarget(MigrationVersion target)
Sets the target version up to which Flyway should consider migrations. Migrations with a higher version number will be ignored. Special values:current: Designates the current version of the schemalatest: The latest version of the schema, as defined by the migration with the highest versionnext: The next version of the schema, as defined by the first pending migration
latest.
-
setFailOnMissingTarget
public void setFailOnMissingTarget(boolean failOnMissingTarget)
-
setPlaceholderReplacement
public void setPlaceholderReplacement(boolean placeholderReplacement)
Sets whether placeholders should be replaced.- Parameters:
placeholderReplacement- Whether placeholders should be replaced. (default: true)
-
setPlaceholders
public void setPlaceholders(java.util.Map<java.lang.String,java.lang.String> placeholders)
Sets the placeholders to replace in SQL migration scripts.- Parameters:
placeholders- The map of <placeholder, replacementValue> to apply to sql migration scripts.
-
setRepeatableSqlMigrationPrefix
public void setRepeatableSqlMigrationPrefix(java.lang.String repeatableSqlMigrationPrefix)
Sets the file name prefix for repeatable sql migrations. Repeatable SQL migrations have the following file name structure: prefixSeparatorDESCRIPTIONsuffix, which using the defaults translates to R__My_description.sql- Parameters:
repeatableSqlMigrationPrefix- The file name prefix for repeatable sql migrations (default: R)
-
setResourceProvider
public void setResourceProvider(ResourceProvider resourceProvider)
-
setJavaMigrationClassProvider
public void setJavaMigrationClassProvider(ClassProvider<JavaMigration> javaMigrationClassProvider)
-
setIgnoreMissingMigrations
@Deprecated public void setIgnoreMissingMigrations(boolean ignoreMissingMigrations)
Deprecated.Will remove in Flyway V9. UsesetIgnoreMigrationPatternsinstead. Ignore missing migrations when reading the schema history table. These are migrations that were performed by an older deployment of the application that are no longer available in this version. For example: we have migrations available on the classpath with versions 1.0 and 3.0. The schema history table indicates that a migration with version 2.0 (unknown to us) has also been applied. Instead of bombing out (fail fast) with an exception, a warning is logged and Flyway continues normally. This is useful for situations where one must be able to deploy a newer version of the application even though it doesn't contain migrations included with an older one anymore. Note that if the most recently applied migration is removed, Flyway has no way to know it is missing and will mark it as future instead.- Parameters:
ignoreMissingMigrations-trueto continue normally and log a warning,falseto fail fast with an exception. (default:false)
-
setIgnoreIgnoredMigrations
@Deprecated public void setIgnoreIgnoredMigrations(boolean ignoreIgnoredMigrations)
Deprecated.Will remove in Flyway V9. UsesetIgnoreMigrationPatternsinstead. Ignore ignored migrations when reading the schema history table. These are migrations that were added in between already migrated migrations in this version. For example: we have migrations available on the classpath with versions from 1.0 to 3.0. The schema history table indicates that version 1 was finished on 1.0.15, and the next one was 2.0.0. But with the next release a new migration was added to version 1: 1.0.16. Such scenario is ignored by migrate command, but by default is rejected by validate. When ignoreIgnoredMigrations is enabled, such case will not be reported by validate command. This is useful for situations where one must be able to deliver complete set of migrations in a delivery package for multiple versions of the product, and allows for further development of older versions.- Parameters:
ignoreIgnoredMigrations-trueto continue normally,falseto fail fast with an exception. (default:false)
-
setIgnorePendingMigrations
@Deprecated public void setIgnorePendingMigrations(boolean ignorePendingMigrations)
Deprecated.Will remove in Flyway V9. UsesetIgnoreMigrationPatternsinstead. Ignore pending migrations when reading the schema history table. These are migrations that are available but have not yet been applied. This can be useful for verifying that in-development migration changes don't contain any validation-breaking changes of migrations that have already been applied to a production environment, e.g. as part of a CI/CD process, without failing because of the existence of new migration versions.- Parameters:
ignorePendingMigrations-trueto continue normally,falseto fail fast with an exception. (default:false)
-
setIgnoreFutureMigrations
@Deprecated public void setIgnoreFutureMigrations(boolean ignoreFutureMigrations)
Deprecated.Will remove in Flyway V9. UsesetIgnoreMigrationPatternsinstead. Whether to ignore future migrations when reading the schema history table. These are migrations that were 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 schema history table indicates that a migration to version 4.0 (unknown to us) has already been applied. Instead of bombing out (fail fast) with an exception, a warning is logged and Flyway continues normally. This is useful for situations where one must be able to redeploy an older version of the application after the database has been migrated by a newer one.- Parameters:
ignoreFutureMigrations-trueto continue normally and log a warning,falseto fail fast with an exception. (default:true)
-
setValidateMigrationNaming
public void setValidateMigrationNaming(boolean validateMigrationNaming)
Whether to validate migrations and callbacks whose scripts do not obey the correct naming convention. A failure can be useful to check that errors such as case sensitivity in migration prefixes have been corrected.- Parameters:
validateMigrationNaming-falseto continue normally,trueto fail fast with an exception. (default:false)
-
setValidateOnMigrate
public void setValidateOnMigrate(boolean validateOnMigrate)
Whether to automatically call validate or not when running migrate.- Parameters:
validateOnMigrate-trueif validate should be called.falseif not. (default:true)
-
setCleanOnValidationError
public void setCleanOnValidationError(boolean cleanOnValidationError)
Whether to automatically call clean or not when a validation error occurs. This is exclusively intended as a convenience for development. even though 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!- Parameters:
cleanOnValidationError-trueif clean should be called.falseif not. (default:false)
-
setCleanDisabled
public void setCleanDisabled(boolean cleanDisabled)
Whether to disable clean. This is especially useful for production environments where running clean can be quite a career limiting move.- Parameters:
cleanDisabled-trueto disable clean.falseto leave it enabled. (default:false)
-
setBaselineVersion
public void setBaselineVersion(MigrationVersion baselineVersion)
Sets the version to tag an existing schema with when executing baseline.- Parameters:
baselineVersion- The version to tag an existing schema with when executing baseline. (default: 1)
-
setBaselineDescription
public void setBaselineDescription(java.lang.String baselineDescription)
Sets the description to tag an existing schema with when executing baseline.- Parameters:
baselineDescription- The description to tag an existing schema with when executing baseline. (default: << Flyway Baseline >>)
-
setBaselineOnMigrate
public void setBaselineOnMigrate(boolean baselineOnMigrate)
Whether to automatically call baseline when migrate is executed against a non-empty schema with no schema history table. This schema will then be baselined with thebaselineVersionbefore executing the migrations. Only migrations abovebaselineVersionwill 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!- Parameters:
baselineOnMigrate-trueif baseline should be called on migrate for non-empty schemas,falseif not. (default:false)
-
setOutOfOrder
public void setOutOfOrder(boolean outOfOrder)
Allows migrations to be run "out of order". 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.- Parameters:
outOfOrder-trueif outOfOrder migrations should be applied,falseif not. (default:false)
-
setSkipDefaultCallbacks
public void setSkipDefaultCallbacks(boolean skipDefaultCallbacks)
Whether Flyway should skip the default callbacks. If true, only custom callbacks are used.- Parameters:
skipDefaultCallbacks- Whether default built-in callbacks should be skipped.(default: false)
-
setSkipDefaultResolvers
public void setSkipDefaultResolvers(boolean skipDefaultResolvers)
Whether Flyway should skip the default resolvers. If true, only custom resolvers are used.- Parameters:
skipDefaultResolvers- Whether default built-in resolvers should be skipped. (default: false)
-
setMixed
public void setMixed(boolean mixed)
Whether to allow mixing transactional and non-transactional statements within the same migration. Enabling this automatically causes the entire affected migration to be run without a transaction. Note that this is only applicable for PostgreSQL, Aurora PostgreSQL, SQL Server and SQLite which all have statements that do not run at all within a transaction. This is not to be confused with implicit transaction, as they occur in MySQL or Oracle, where even though a DDL statement was run within a transaction, the database will issue an implicit commit before and after its execution.- Parameters:
mixed-trueif mixed migrations should be allowed.falseif an error should be thrown instead. (default:false)
-
setGroup
public void setGroup(boolean group)
Whether to group all pending migrations together in the same transaction when applying them (only recommended for databases with support for DDL transactions).- Parameters:
group-trueif migrations should be grouped.falseif they should be applied individually instead. (default:false)
-
setCreateSchemas
public void setCreateSchemas(boolean createSchemas)
-
setLockRetryCount
public void setLockRetryCount(int lockRetryCount)
-
setFailOnMissingLocations
public void setFailOnMissingLocations(boolean failOnMissingLocations)
Whether to fail if a location specified in the flyway.locations option doesn't exist
-
-