Class FluentConfiguration
- java.lang.Object
-
- org.flywaydb.core.api.configuration.FluentConfiguration
-
- All Implemented Interfaces:
Configuration
public class FluentConfiguration extends Object implements Configuration
Fluent configuration for Flyway. This is the preferred means of configuring the Flyway API.This configuration can be passed to Flyway using the
new Flyway(Configuration)constructor.
-
-
Constructor Summary
Constructors Constructor Description FluentConfiguration()Creates a new default configuration.FluentConfiguration(ClassLoader classLoader)Creates a new default configuration with this class loader.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description FluentConfigurationbaselineDescription(String baselineDescription)Sets the description to tag an existing schema with when executing baseline.FluentConfigurationbaselineOnMigrate(boolean baselineOnMigrate)Whether to automatically call baseline when migrate is executed against a non-empty schema with no schema history table.FluentConfigurationbaselineVersion(String baselineVersion)Sets the version to tag an existing schema with when executing baseline.FluentConfigurationbaselineVersion(MigrationVersion baselineVersion)Sets the version to tag an existing schema with when executing baseline.FluentConfigurationbatch(boolean batch)Whether to batch SQL statements when executing them.FluentConfigurationcallbacks(String... callbacks)Set the callbacks for lifecycle notifications.FluentConfigurationcallbacks(Callback... callbacks)Set the callbacks for lifecycle notifications.FluentConfigurationcleanDisabled(boolean cleanDisabled)Whether to disable clean.FluentConfigurationcleanOnValidationError(boolean cleanOnValidationError)Whether to automatically call clean or not when a validation error occurs.FluentConfigurationconfiguration(Map<String,String> props)Configures Flyway with these properties.FluentConfigurationconfiguration(Properties properties)Configures Flyway with these properties.FluentConfigurationconfiguration(Configuration configuration)Configure with the same values as this existing configuration.FluentConfigurationconfigure(Map<String,String> props)Deprecated.Use configuration() instead.FluentConfigurationconfigure(Properties properties)Deprecated.Use configuration() instead.FluentConfigurationconfigure(Configuration configuration)Deprecated.Use configuration() instead.FluentConfigurationconnectRetries(int connectRetries)The maximum number of retries when attempting to connect to the database.FluentConfigurationdataSource(String url, String user, String password)Sets the datasource to use.FluentConfigurationdataSource(String url, String user, String password, String... initSqls)Deprecated.Use the separate initSql() method in addition to the dataSource() method if you need to set the initSql.FluentConfigurationdataSource(DataSource dataSource)Sets the datasource to use.FluentConfigurationdryRunOutput(File dryRunOutput)Sets the file where to output the SQL statements of a migration dry run.FluentConfigurationdryRunOutput(OutputStream dryRunOutput)Sets the stream where to output the SQL statements of a migration dry run.FluentConfigurationdryRunOutput(String dryRunOutputFileName)Sets the file where to output the SQL statements of a migration dry run.FluentConfigurationencoding(String encoding)Sets the encoding of Sql migrations.FluentConfigurationencoding(Charset encoding)Sets the encoding of Sql migrations.FluentConfigurationenvVars()Configures Flyway using FLYWAY_* environment variables.FluentConfigurationerrorHandlers(String... errorHandlerClassNames)Deprecated.ErrorHandlers have been deprecated and will be removed in Flyway 6.0 use statement-level callbacks instead.FluentConfigurationerrorHandlers(ErrorHandler... errorHandlers)Deprecated.ErrorHandlers have been deprecated and will be removed in Flyway 6.0 use statement-level callbacks instead.FluentConfigurationerrorOverrides(String... errorOverrides)Rules for the built-in error handler that lets you override specific SQL states and errors codes from error to warning or from warning to error.StringgetBaselineDescription()Retrieves the description to tag an existing schema with when executing baseline.MigrationVersiongetBaselineVersion()Retrieves the version to tag an existing schema with when executing baseline.Callback[]getCallbacks()Gets the callbacks for lifecycle notifications.ClassLoadergetClassLoader()Retrieves the ClassLoader to use for loading migrations, resolvers, etc from the classpath.intgetConnectRetries()The maximum number of retries when attempting to connect to the database.DataSourcegetDataSource()Retrieves the dataSource to use to access the database.OutputStreamgetDryRunOutput()The stream where to output the SQL statements of a migration dry run.CharsetgetEncoding()Retrieves the encoding of Sql migrations.ErrorHandler[]getErrorHandlers()Handlers for errors and warnings that occur during a migration.String[]getErrorOverrides()Rules for the built-in error handler that lets you override specific SQL states and errors codes from error to warning or from warning to error.StringgetInitSql()The SQL statements to run to initialize a new database connection immediately after opening it.StringgetInstalledBy()The username that will be recorded in the schema history table as having applied the migration.StringgetLicenseKey()Flyway's license key.Location[]getLocations()Retrieves the locations to scan recursively for migrations.StringgetPlaceholderPrefix()Retrieves the prefix of every placeholder.Map<String,String>getPlaceholders()Retrieves the map of <placeholder, replacementValue> to apply to sql migration scripts.StringgetPlaceholderSuffix()Retrieves the suffix of every placeholder.StringgetRepeatableSqlMigrationPrefix()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.StringgetSqlMigrationPrefix()The file name prefix for versioned SQL migrations.StringgetSqlMigrationSeparator()Retrieves the file name separator for sql migrations.String[]getSqlMigrationSuffixes()The file name suffixes for SQL migrations.StringgetTable()Retrieves the name of the schema schema history table that will be used by Flyway.MigrationVersiongetTarget()Retrieves the target version up to which Flyway should consider migrations.StringgetUndoSqlMigrationPrefix()The file name prefix for undo SQL migrations.FluentConfigurationgroup(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).FluentConfigurationignoreFutureMigrations(boolean ignoreFutureMigrations)Whether to ignore future migrations when reading the schema history table.FluentConfigurationignoreIgnoredMigrations(boolean ignoreIgnoredMigrations)Ignore ignored migrations when reading the schema history table.FluentConfigurationignoreMissingMigrations(boolean ignoreMissingMigrations)Ignore missing migrations when reading the schema history table.FluentConfigurationignorePendingMigrations(boolean ignorePendingMigrations)Ignore pending migrations when reading the schema history table.FluentConfigurationinitSql(String initSql)The SQL statements to run to initialize a new database connection immediately after opening it.FluentConfigurationinstalledBy(String installedBy)The username that will be recorded in the schema history table as having applied the migration.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.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()Ignore future migrations when reading the schema history table.booleanisIgnoreIgnoredMigrations()Ignore ignored migrations when reading the schema history table.booleanisIgnoreMissingMigrations()Ignore missing migrations when reading the schema history table.booleanisIgnorePendingMigrations()Ignore pending migrations when reading the schema history table.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.booleanisOutOfOrder()Allows migrations to be run "out of order".booleanisPlaceholderReplacement()Checks whether placeholders should be replaced.booleanisSkipDefaultCallbacks()Whether Flyway should skip the default callbacks.booleanisSkipDefaultResolvers()Whether Flyway should skip the default resolvers.booleanisStream()Whether to stream SQL migrations when executing them.booleanisValidateOnMigrate()Whether to automatically call validate or not when running migrate.FluentConfigurationlicenseKey(String licenseKey)Flyway's license key.Flywayload()Loads this configuration into a new Flyway instance.FluentConfigurationlocations(String... locations)Sets the locations to scan recursively for migrations.FluentConfigurationlocations(Location... locations)Sets the locations to scan recursively for migrations.FluentConfigurationmixed(boolean mixed)Whether to allow mixing transactional and non-transactional statements within the same migration.FluentConfigurationoracleSqlplus(boolean oracleSqlplus)Whether to Flyway's support for Oracle SQL*Plus commands should be activated.FluentConfigurationoutOfOrder(boolean outOfOrder)Allows migrations to be run "out of order".FluentConfigurationplaceholderPrefix(String placeholderPrefix)Sets the prefix of every placeholder.FluentConfigurationplaceholderReplacement(boolean placeholderReplacement)Sets whether placeholders should be replaced.FluentConfigurationplaceholders(Map<String,String> placeholders)Sets the placeholders to replace in sql migration scripts.FluentConfigurationplaceholderSuffix(String placeholderSuffix)Sets the suffix of every placeholder.FluentConfigurationrepeatableSqlMigrationPrefix(String repeatableSqlMigrationPrefix)Sets the file name prefix for repeatable sql migrations.FluentConfigurationresolvers(String... resolvers)Sets custom MigrationResolvers to be used in addition to the built-in ones for resolving Migrations to apply.FluentConfigurationresolvers(MigrationResolver... resolvers)Sets custom MigrationResolvers to be used in addition to the built-in ones for resolving Migrations to apply.FluentConfigurationschemas(String... schemas)Sets the schemas managed by Flyway.FluentConfigurationskipDefaultCallbacks(boolean skipDefaultCallbacks)Whether Flyway should skip the default callbacks.FluentConfigurationskipDefaultResolvers(boolean skipDefaultResolvers)Whether Flyway should skip the default resolvers.FluentConfigurationsqlMigrationPrefix(String sqlMigrationPrefix)Sets the file name prefix for sql migrations.FluentConfigurationsqlMigrationSeparator(String sqlMigrationSeparator)Sets the file name separator for sql migrations.FluentConfigurationsqlMigrationSuffixes(String... sqlMigrationSuffixes)The file name suffixes for SQL migrations.FluentConfigurationstream(boolean stream)Whether to stream SQL migrations when executing them.FluentConfigurationtable(String table)Sets the name of the schema schema history table that will be used by Flyway.FluentConfigurationtarget(String target)Sets the target version up to which Flyway should consider migrations.FluentConfigurationtarget(MigrationVersion target)Sets the target version up to which Flyway should consider migrations.FluentConfigurationundoSqlMigrationPrefix(String undoSqlMigrationPrefix)Sets the file name prefix for undo SQL migrations.FluentConfigurationvalidateOnMigrate(boolean validateOnMigrate)Whether to automatically call validate or not when running migrate.
-
-
-
Constructor Detail
-
FluentConfiguration
public FluentConfiguration()
Creates a new default configuration.
-
FluentConfiguration
public FluentConfiguration(ClassLoader classLoader)
Creates a new default configuration with this class loader.- Parameters:
classLoader- The ClassLoader to use for loading migrations, resolvers, etc from the classpath. (default: Thread.currentThread().getContextClassLoader() )
-
-
Method Detail
-
load
public Flyway load()
Loads this configuration into a new Flyway instance.- Returns:
- The new fully-configured Flyway instance.
-
configure
@Deprecated public FluentConfiguration configure(Configuration configuration)
Deprecated.Use configuration() instead. Will be removed in Flyway 6.0.Configure with the same values as this existing configuration.- Parameters:
configuration- The configuration to use.
-
configuration
public FluentConfiguration configuration(Configuration configuration)
Configure with the same values as this existing configuration.- Parameters:
configuration- The configuration to use.
-
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 with
classpath: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)
-
getEncoding
public 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)
-
getSchemas
public String[] getSchemas()
Description copied from interface:ConfigurationRetrieves the schemas managed by Flyway. These schema names are case-sensitive.Consequences:
- Flyway will automatically attempt to create all these schemas, unless the first one already exists.
- The first schema in the list will be automatically set as the default one during the migration.
- The first schema in the list will also be the one containing the schema history table.
- The schemas will be cleaned in the order of this list.
- If Flyway created them, the schemas themselves will as be dropped when cleaning.
- Specified by:
getSchemasin interfaceConfiguration- Returns:
- The schemas managed by Flyway. (default: The default schema for the database connection)
-
getTable
public String getTable()
Description copied from interface:ConfigurationRetrieves 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.
- Specified by:
getTablein interfaceConfiguration- Returns:
- The name of the schema schema history table that will be used by flyway. (default: flyway_schema_history)
-
getTarget
public MigrationVersion getTarget()
Description copied from interface:ConfigurationRetrieves the target version up to which Flyway should consider migrations. Migrations with a higher version number will be ignored. The special valuecurrentdesignates the current version of the schema.- Specified by:
getTargetin interfaceConfiguration- Returns:
- The target version up to which Flyway should consider migrations. (default: the latest version)
-
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 Map<String,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 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 String getPlaceholderSuffix()
Description copied from interface:ConfigurationRetrieves the suffix of every placeholder.- Specified by:
getPlaceholderSuffixin interfaceConfiguration- Returns:
- The suffix of every placeholder. (default: } )
-
getSqlMigrationPrefix
public 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)
-
getRepeatableSqlMigrationPrefix
public 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)
-
getSqlMigrationSeparator
public 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 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.
-
isIgnoreMissingMigrations
public boolean isIgnoreMissingMigrations()
Description copied from interface:ConfigurationIgnore 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.- Specified by:
isIgnoreMissingMigrationsin interfaceConfiguration- Returns:
trueto continue normally and log a warning,falseto fail fast with an exception. (default:false)
-
isIgnoreIgnoredMigrations
public boolean isIgnoreIgnoredMigrations()
Description copied from interface:ConfigurationIgnore 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.- Specified by:
isIgnoreIgnoredMigrationsin interfaceConfiguration- Returns:
trueto continue normally,falseto fail fast with an exception. (default:false)
-
isIgnorePendingMigrations
public boolean isIgnorePendingMigrations()
Description copied from interface:ConfigurationIgnore 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.- Specified by:
isIgnorePendingMigrationsin interfaceConfiguration- Returns:
trueto continue normally,falseto fail fast with an exception. (default:false)
-
isIgnoreFutureMigrations
public boolean isIgnoreFutureMigrations()
Description copied from interface:ConfigurationIgnore 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.- Specified by:
isIgnoreFutureMigrationsin interfaceConfiguration- Returns:
trueto continue normally and log a warning,falseto fail fast with an exception. (default:true)
-
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 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 !
- 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 disabled 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 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 the
baselineVersionbefore 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)
-
getResolvers
public MigrationResolver[] getResolvers()
Description copied from interface:ConfigurationRetrieves the 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)
-
getDataSource
public 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.
-
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.- Specified by:
getConnectRetriesin interfaceConfiguration- Returns:
- The maximum number of retries when attempting to connect to the database. (default: 0)
-
getInitSql
public 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 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() )
-
isMixed
public boolean isMixed()
Description copied from interface:ConfigurationWhether to allow mixing transactional and non-transactional statements within the same migration.- Specified by:
isMixedin interfaceConfiguration- Returns:
trueif mixed migrations should be allowed.falseif an error should be thrown instead. (default:false)
-
getInstalledBy
public 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).
-
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)
-
getErrorHandlers
public ErrorHandler[] getErrorHandlers()
Description copied from interface:ConfigurationHandlers for errors and warnings that occur during a migration. This can be used to customize Flyway's behavior by for example throwing another runtime exception, outputting a warning or suppressing the error instead of throwing a FlywayException. ErrorHandlers are invoked in order until one reports to have successfully handled the errors or warnings. If none do, or if none are present, Flyway falls back to its default handling of errors and warnings.Flyway Pro and Flyway Enterprise only
- Specified by:
getErrorHandlersin interfaceConfiguration- Returns:
- The ErrorHandlers or an empty array if the default internal handler should be used instead. (default: none)
-
getErrorOverrides
public String[] getErrorOverrides()
Description copied from interface:ConfigurationRules for the built-in error handler that lets you override specific SQL states and errors codes from error to warning or from warning to error.Each error override has the following format:
STATE:12345:W. It is a 5 character SQL state, a colon, the SQL error code, a colon and finally the desired behavior that should override the initial one. The following behaviors are accepted:Wto force a warning andEto force an error.For example, to force Oracle stored procedure compilation issues to produce errors instead of warnings, the following errorOverride can be used:
99999:17110:EFlyway Pro and Flyway Enterprise only
- Specified by:
getErrorOverridesin interfaceConfiguration- Returns:
- The ErrorOverrides or an empty array if none are defined. (default: none)
-
getDryRunOutput
public 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 Pro and Flyway Enterprise 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 Pro and Flyway Enterprise 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 Pro and Flyway Enterprise only
- Specified by:
isBatchin interfaceConfiguration- Returns:
trueto batch SQL statements.falseto execute them individually instead. (default:false)
-
isOracleSqlplus
public boolean isOracleSqlplus()
Description copied from interface:ConfigurationWhether to Flyway's support for Oracle SQL*Plus commands should be activated.Flyway Pro and Flyway Enterprise only
- Specified by:
isOracleSqlplusin interfaceConfiguration- Returns:
trueto active SQL*Plus support.falseto fail fast instead. (default:false)
-
getLicenseKey
public String getLicenseKey()
Description copied from interface:ConfigurationFlyway's license key.Flyway Pro and Flyway Enterprise only
- Specified by:
getLicenseKeyin interfaceConfiguration- Returns:
- The license key.
-
dryRunOutput
public FluentConfiguration dryRunOutput(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 when be closing when Flyway finishes writing the output.Flyway Pro and Flyway Enterprise only
- Parameters:
dryRunOutput- The output file ornullto execute the SQL statements directly against the database.
-
dryRunOutput
public FluentConfiguration dryRunOutput(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 Pro and Flyway Enterprise only
- Parameters:
dryRunOutput- The output file ornullto execute the SQL statements directly against the database.
-
dryRunOutput
public FluentConfiguration dryRunOutput(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.Flyway Pro and Flyway Enterprise only
- Parameters:
dryRunOutputFileName- The name of the output file ornullto execute the SQL statements directly against the database.
-
errorHandlers
@Deprecated public FluentConfiguration errorHandlers(ErrorHandler... errorHandlers)
Deprecated.ErrorHandlers have been deprecated and will be removed in Flyway 6.0 use statement-level callbacks instead.Handlers for errors and warnings that occur during a migration. This can be used to customize Flyway's behavior by for example throwing another runtime exception, outputting a warning or suppressing the error instead of throwing a FlywayException. ErrorHandlers are invoked in order until one reports to have successfully handled the errors or warnings. If none do, or if none are present, Flyway falls back to its default handling of errors and warnings.Flyway Pro and Flyway Enterprise only
- Parameters:
errorHandlers- The ErrorHandlers or an empty array if the default internal handler should be used instead. (default: none)
-
errorHandlers
@Deprecated public FluentConfiguration errorHandlers(String... errorHandlerClassNames)
Deprecated.ErrorHandlers have been deprecated and will be removed in Flyway 6.0 use statement-level callbacks instead.Handlers for errors and warnings that occur during a migration. This can be used to customize Flyway's behavior by for example throwing another runtime exception, outputting a warning or suppressing the error instead of throwing a FlywayException. ErrorHandlers are invoked in order until one reports to have successfully handled the errors or warnings. If none do, or if none are present, Flyway falls back to its default handling of errors and warnings.Flyway Pro and Flyway Enterprise only
- Parameters:
errorHandlerClassNames- The fully qualified class names of ErrorHandlers or an empty array if the default internal handler should be used instead. (default: none)
-
errorOverrides
public FluentConfiguration errorOverrides(String... errorOverrides)
Rules for the built-in error handler that lets you override specific SQL states and errors codes from error to warning or from warning to error.Each error override has the following format:
STATE:12345:W. It is a 5 character SQL state, a colon, the SQL error code, a colon and finally the desired behavior that should override the initial one. The following behaviors are accepted:Wto force a warning andEto force an error.For example, to force Oracle stored procedure compilation issues to produce errors instead of warnings, the following errorOverride can be used:
99999:17110:EFlyway Pro and Flyway Enterprise only
- Parameters:
errorOverrides- The ErrorOverrides or an empty array if none are defined. (default: none)
-
group
public FluentConfiguration group(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)
-
installedBy
public FluentConfiguration installedBy(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).
-
mixed
public FluentConfiguration mixed(boolean mixed)
Whether to allow mixing transactional and non-transactional statements within the same migration.- Parameters:
mixed-trueif mixed migrations should be allowed.falseif an error should be thrown instead. (default:false)
-
ignoreMissingMigrations
public FluentConfiguration ignoreMissingMigrations(boolean ignoreMissingMigrations)
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)
-
ignoreIgnoredMigrations
public FluentConfiguration ignoreIgnoredMigrations(boolean ignoreIgnoredMigrations)
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)
-
ignorePendingMigrations
public FluentConfiguration ignorePendingMigrations(boolean ignorePendingMigrations)
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)
-
ignoreFutureMigrations
public FluentConfiguration ignoreFutureMigrations(boolean ignoreFutureMigrations)
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)
-
validateOnMigrate
public FluentConfiguration validateOnMigrate(boolean validateOnMigrate)
Whether to automatically call validate or not when running migrate.- Parameters:
validateOnMigrate-trueif validate should be called.falseif not. (default:true)
-
cleanOnValidationError
public FluentConfiguration cleanOnValidationError(boolean cleanOnValidationError)
Whether to automatically call clean or not when a validation error occurs.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 !
- Parameters:
cleanOnValidationError-trueif clean should be called.falseif not. (default:false)
-
cleanDisabled
public FluentConfiguration cleanDisabled(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 disabled clean.falseto leave it enabled. (default:false)
-
locations
public FluentConfiguration locations(String... locations)
Sets the locations to scan recursively for migrations.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 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)
-
locations
public FluentConfiguration locations(Location... locations)
Sets the locations to scan recursively for migrations.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 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)
-
encoding
public FluentConfiguration encoding(String encoding)
Sets the encoding of Sql migrations.- Parameters:
encoding- The encoding of Sql migrations. (default: UTF-8)
-
encoding
public FluentConfiguration encoding(Charset encoding)
Sets the encoding of Sql migrations.- Parameters:
encoding- The encoding of Sql migrations. (default: UTF-8)
-
schemas
public FluentConfiguration schemas(String... schemas)
Sets the schemas managed by Flyway. These schema names are case-sensitive. (default: The default schema for the database connection)Consequences:
- Flyway will automatically attempt to create all these schemas, unless the first one already exists.
- The first schema in the list will be automatically set as the default one during the migration.
- The first schema in the list will also be the one containing the schema history table.
- The schemas will be cleaned in the order of this list.
- If Flyway created them, the schemas themselves will as be dropped when cleaning.
- Parameters:
schemas- The schemas managed by Flyway. May not benull. Must contain at least one element.
-
table
public FluentConfiguration table(String table)
Sets 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.
- Parameters:
table- The name of the schema schema history table that will be used by flyway. (default: flyway_schema_history)
-
target
public FluentConfiguration target(MigrationVersion target)
Sets the target version up to which Flyway should consider migrations. Migrations with a higher version number will be ignored.- Parameters:
target- The target version up to which Flyway should consider migrations. (default: the latest version)
-
target
public FluentConfiguration target(String target)
Sets the target version up to which Flyway should consider migrations. Migrations with a higher version number will be ignored.- Parameters:
target- The target version up to which Flyway should consider migrations. The special valuecurrentdesignates the current version of the schema. (default: the latest version)
-
placeholderReplacement
public FluentConfiguration placeholderReplacement(boolean placeholderReplacement)
Sets whether placeholders should be replaced.- Parameters:
placeholderReplacement- Whether placeholders should be replaced. (default: true)
-
placeholders
public FluentConfiguration placeholders(Map<String,String> placeholders)
Sets the placeholders to replace in sql migration scripts.- Parameters:
placeholders- The map of <placeholder, replacementValue> to apply to sql migration scripts.
-
placeholderPrefix
public FluentConfiguration placeholderPrefix(String placeholderPrefix)
Sets the prefix of every placeholder.- Parameters:
placeholderPrefix- The prefix of every placeholder. (default: ${ )
-
placeholderSuffix
public FluentConfiguration placeholderSuffix(String placeholderSuffix)
Sets the suffix of every placeholder.- Parameters:
placeholderSuffix- The suffix of every placeholder. (default: } )
-
sqlMigrationPrefix
public FluentConfiguration sqlMigrationPrefix(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)
-
getUndoSqlMigrationPrefix
public 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 Pro and Flyway Enterprise only
- Specified by:
getUndoSqlMigrationPrefixin interfaceConfiguration- Returns:
- The file name prefix for undo sql migrations. (default: U)
-
undoSqlMigrationPrefix
public FluentConfiguration undoSqlMigrationPrefix(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 Pro and Flyway Enterprise only
- Parameters:
undoSqlMigrationPrefix- The file name prefix for undo SQL migrations. (default: U)
-
repeatableSqlMigrationPrefix
public FluentConfiguration repeatableSqlMigrationPrefix(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)
-
sqlMigrationSeparator
public FluentConfiguration sqlMigrationSeparator(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: __)
-
sqlMigrationSuffixes
public FluentConfiguration sqlMigrationSuffixes(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.
-
dataSource
public FluentConfiguration dataSource(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.
-
dataSource
public FluentConfiguration dataSource(String url, String user, String password)
Sets the datasource to use. Must have the necessary privileges to execute ddl.- Parameters:
url- The JDBC URL of the database.user- The user of the database.password- The password of the database.
-
dataSource
public FluentConfiguration dataSource(String url, String user, String password, String... initSqls)
Deprecated.Use the separate initSql() method in addition to the dataSource() method if you need to set the initSql. This method will be removed in Flyway 6.0.Sets the datasource to use. Must have the necessary privileges to execute ddl.- Parameters:
url- The JDBC URL of the database.user- The user of the database.password- The password of the database.initSqls- The (optional) sql statements to execute to initialize a connection immediately after obtaining it.
-
connectRetries
public FluentConfiguration connectRetries(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.- Parameters:
connectRetries- The maximum number of retries (default: 0).
-
initSql
public FluentConfiguration initSql(String initSql)
The SQL statements to run to initialize a new database connection immediately after opening it.- Parameters:
initSql- The SQL statements. (default:null)
-
baselineVersion
public FluentConfiguration baselineVersion(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)
-
baselineVersion
public FluentConfiguration baselineVersion(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)
-
baselineDescription
public FluentConfiguration baselineDescription(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 >>)
-
baselineOnMigrate
public FluentConfiguration baselineOnMigrate(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 the
baselineVersionbefore 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)
-
outOfOrder
public FluentConfiguration outOfOrder(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)
-
getCallbacks
public Callback[] getCallbacks()
Gets the callbacks for lifecycle notifications.- Specified by:
getCallbacksin interfaceConfiguration- Returns:
- The callbacks for lifecycle notifications. An empty array if none. (default: none)
-
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)
-
callbacks
public FluentConfiguration callbacks(Callback... callbacks)
Set the callbacks for lifecycle notifications.- Parameters:
callbacks- The callbacks for lifecycle notifications. (default: none)
-
callbacks
public FluentConfiguration callbacks(String... callbacks)
Set the callbacks for lifecycle notifications.- Parameters:
callbacks- The fully qualified class names of the callbacks for lifecycle notifications. (default: none)
-
skipDefaultCallbacks
public FluentConfiguration skipDefaultCallbacks(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)
-
resolvers
public FluentConfiguration resolvers(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)
-
resolvers
public FluentConfiguration resolvers(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)
-
skipDefaultResolvers
public FluentConfiguration skipDefaultResolvers(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)
-
stream
public FluentConfiguration stream(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 Pro and Flyway Enterprise only
- Parameters:
stream-trueto stream SQL migrations.falseto fully loaded them in memory instead. (default:false)
-
batch
public FluentConfiguration batch(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 Pro and Flyway Enterprise only
- Parameters:
batch-trueto batch SQL statements.falseto execute them individually instead. (default:false)
-
oracleSqlplus
public FluentConfiguration oracleSqlplus(boolean oracleSqlplus)
Whether to Flyway's support for Oracle SQL*Plus commands should be activated.Flyway Pro and Flyway Enterprise only
- Parameters:
oracleSqlplus-trueto active SQL*Plus support.falseto fail fast instead. (default:false)
-
licenseKey
public FluentConfiguration licenseKey(String licenseKey)
Flyway's license key.Flyway Pro and Flyway Enterprise only
- Parameters:
licenseKey- The license key.
-
configure
@Deprecated public FluentConfiguration configure(Properties properties)
Deprecated.Use configuration() instead. Will be removed in Flyway 6.0.Configures Flyway with these properties. This overwrites any existing configuration. Property names are documented in the flyway maven plugin.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
@Deprecated public FluentConfiguration configure(Map<String,String> props)
Deprecated.Use configuration() instead. Will be removed in Flyway 6.0.Configures Flyway with these properties. This overwrites any existing configuration. Property names are documented in the flyway maven plugin.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.
-
configuration
public FluentConfiguration configuration(Properties properties)
Configures Flyway with these properties. This overwrites any existing configuration. Property names are documented in the flyway maven plugin.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.
-
configuration
public FluentConfiguration configuration(Map<String,String> props)
Configures Flyway with these properties. This overwrites any existing configuration. Property names are documented in the flyway maven plugin.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.
-
envVars
public FluentConfiguration envVars()
Configures Flyway using FLYWAY_* environment variables.- Throws:
FlywayException- when the configuration failed.
-
-