Class ClassicConfiguration
- All Implemented Interfaces:
Configuration
This configuration can then be passed to Flyway using the new Flyway(Configuration) constructor.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionClassicConfiguration(ClassLoader classLoader) ClassicConfiguration(Configuration configuration) Creates a new configuration with the same values as this existing one.ClassicConfiguration(org.flywaydb.core.internal.configuration.models.ConfigurationModel modernConfig) -
Method Summary
Modifier and TypeMethodDescriptionvoidConfigures Flyway with these properties.voidconfigure(Properties properties) Configures Flyway with these properties.voidconfigure(Configuration configuration) Configure with the same values as this existing configuration.voidConfigures Flyway using FLYWAY_* environment variables.org.flywaydb.core.ProgressLoggercreateProgress(String operationName) Retrieves the description to tag an existing schema with when executing baseline.Retrieves the version to tag an existing schema with when executing baseline.Gets DataSources for all the environmentsGets the connection environments that have already been resolved from this configurationLocation[]Retrieves the locations to scan recursively for callbacks.Callback[]Gets the callbacks for lifecycle notifications.Gets the migrations that Flyway should consider when migrating or undoing.Retrieves the ClassLoader to use for loading migrations, resolvers, etc.<T extends org.flywaydb.core.extensibility.ConfigurationExtension>
TgetConfigurationExtension(Class<T> extensionClass) Retrieves a configuration extension.intThe maximum number of retries when attempting to connect to the database.intThe maximum time between retries when attempting to connect to the database in seconds.Get the name of the current environmentorg.flywaydb.core.internal.configuration.models.ResolvedEnvironmentorg.flywaydb.core.internal.configuration.models.ResolvedEnvironmentgetCurrentResolvedEnvironment(org.flywaydb.core.ProgressLogger progress) org.flywaydb.core.internal.database.DatabaseTypeGet the Database type determined by the URL or Datasource If there are multiple matching DatabaseTypes for the URL, the first candidate will be returned.Retrieves the dataSource to use to access the database.The default schema managed by Flyway.The JDBC driver of the configurationThe stream where to output the SQL statements of a migration dry run.Retrieves the encoding of Sql migrations.String[]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.Ignore migrations that match this comma-separated list of patterns when validating migrations.The SQL statements to run to initialize a new database connection immediately after opening it.The username that will be recorded in the schema history table as having applied the migration.Retrieves the custom ClassProvider to be used to look upJavaMigrationclasses.The manually added Java-based migrations.Properties to pass to the JDBC driver object Flyway Teams onlyThe path to the Kerberos config file.Location[]Retrieves the locations to scan recursively for migrations.intThe maximum number of retries when trying to obtain a lock.String[]The loggers Flyway should use.org.flywaydb.core.internal.configuration.models.ConfigurationModelRetrieves the password used to construct the dataSource.Retrieves the prefix of every placeholder.Retrieves the map of <placeholder, replacementValue> to apply to sql migration scripts.Retrieves the separator of default placeholders.Retrieves the suffix of every placeholder.org.flywaydb.core.internal.plugin.PluginRegisterRetrieves the PowerShell executable used for running PowerShell scripts.Retrieves the file name prefix for repeatable SQL migrations.Get the filename of generated reportsorg.flywaydb.core.internal.configuration.models.ResolvedEnvironmentgetResolvedEnvironment(String envName) org.flywaydb.core.internal.configuration.models.ResolvedEnvironmentgetResolvedEnvironment(String envName, org.flywaydb.core.internal.configuration.resolvers.ProvisionerMode provisionerMode, org.flywaydb.core.ProgressLogger progress) Retrieves the custom MigrationResolvers to be used in addition to the built-in ones for resolving Migrations to apply.Retrieves the custom ResourceProvider to be used to look up resources.String[]The schemas managed by Flyway.Retrieves the prefix of every script placeholder.Retrieves the suffix of every script placeholder.The file name prefix for versioned SQL migrations.Retrieves the file name separator for sql migrations.String[]The file name suffixes for SQL migrations.getTable()Retrieves the name of the schema history table that will be used by Flyway.The tablespace where to create the schema history table that will be used by Flyway.Gets the target version up to which Flyway should consider migrations.getUrl()Retrieves the url used to construct the dataSource.getUser()Retrieves the user used to construct the dataSource.booleanWhether 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.booleanWhether to disable clean.booleanWhether to automatically call clean or not when a validation error occurs.booleanWhether to disable community database support.booleanWhether Flyway should attempt to create the schemas specified in the schemas property.booleanWhether Flyway should try to automatically detect SQL migration file encodingbooleanChecks whether SQL is executed in a transaction.booleanWhether to fail if a location specified in the flyway.locations option doesn't existbooleanWhether 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).booleanisMixed()Whether to allow mixing transactional and non-transactional statements within the same migration.booleanAllows migrations to be run "out of order".booleanWhether Flyway should output a table with the results of queries when executing migrations.booleanChecks whether placeholders should be replaced.booleanbooleanWhether Flyway should skip the default callbacks.booleanWhether Flyway should skip the default resolvers.booleanWhether 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.booleanWhether to validate migrations and callbacks whose scripts do not obey the correct naming convention.booleanWhether to automatically call validate or not when running migrate.loadCallbackLocation(String path, boolean errorOnNotFound) Scan this location for classes that implement Callback.voidrequestResolvedEnvironmentRefresh(String environmentName) voidsetAllEnvironments(Map<String, org.flywaydb.core.internal.configuration.models.EnvironmentModel> environments) voidsetBaselineDescription(String baselineDescriptionProp) voidsetBaselineOnMigrate(Boolean baselineOnMigrateProp) voidsetBaselineVersion(String baselineVersionProp) voidsetBaselineVersion(MigrationVersion baselineVersion) voidsetBaselineVersionAsString(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.voidsetCallbackLocations(Location... callbackLocations) Sets the locations to scan recursively for callbacks.voidsetCallbackLocationsAsStrings(String... callbackLocations) Sets the locations to scan recursively for callbacks.voidsetCallbacks(Callback... callbacks) voidsetCallbacksAsClassNames(String... callbacks) Set the callbacks for lifecycle notifications.voidsetClassLoader(ClassLoader classLoader) voidsetCleanDisabled(Boolean cleanDisabledProp) voidsetCleanOnValidationError(Boolean cleanOnValidationErrorProp) voidsetCommunityDBSupportEnabled(Boolean communityDBSupportEnabled) 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.voidsetDataSource(String url, String user, String password) Sets the datasource to use.voidsetDataSource(DataSource dataSource) voidsetDefaultSchema(String defaultSchema) voidsetDetectEncoding(boolean detectEncoding) Whether Flyway should try to automatically detect SQL migration file encodingvoidvoidsetDryRunOutput(OutputStream dryRunOutput) Sets the stream where to output the SQL statements of a migration dry run.voidsetDryRunOutputAsFile(File dryRunOutput) Sets the file where to output the SQL statements of a migration dry run.voidsetDryRunOutputAsFileName(String dryRunOutputFileName) Sets the file where to output the SQL statements of a migration dry run.voidsetEncoding(Charset encoding) voidsetEncodingAsString(String encoding) Sets the encoding of SQL migrations.voidsetEnvironment(String environment) voidsetEnvironmentProvisionMode(org.flywaydb.core.internal.configuration.resolvers.ProvisionerMode provisionMode) voidsetErrorOverrides(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.voidsetExecuteInTransaction(boolean executeInTransaction) Sets whether SQL should be executed within a transaction.voidsetFailOnMissingLocations(Boolean failOnMissingLocationsProp) voidvoidsetIgnoreMigrationPatterns(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.voidsetInitSql(String initSqlProp) voidsetInstalledBy(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(Map<String, String> jdbcProperties) Properties to pass to the JDBC driver object.voidsetKerberosConfigFile(String kerberosConfigFile) When connecting to a Kerberos service to authenticate, the path to the Kerberos config file.voidsetLocations(Location... locations) Sets the locations to scan recursively for migrations.voidsetLocationsAsStrings(String... locations) Sets the locations to scan recursively for migrations.voidsetLockRetryCount(Integer lockRetryCount) voidsetLoggers(String... loggers) The loggers Flyway should use.voidvoidsetModernConfig(org.flywaydb.core.internal.configuration.models.ConfigurationModel modernConfig) voidsetOutOfOrder(Boolean outOfOrderProp) voidsetOutputQueryResults(boolean outputQueryResults) Whether Flyway should output a table with the results of queries when executing migrations.voidsetPassword(String password) voidsetPlaceholderPrefix(String placeholderPrefix) Sets the prefix of every placeholder.voidsetPlaceholderReplacement(Boolean placeholderReplacementProp) voidsetPlaceholders(Map<String, String> placeholdersFromProps) voidsetPlaceholderSeparator(String placeholderSeparator) Sets the separator of default placeholders.voidsetPlaceholderSuffix(String placeholderSuffix) Sets the suffix of every placeholder.voidsetPluginRegister(org.flywaydb.core.internal.plugin.PluginRegister pluginRegister) voidsetPowershellExecutable(String powershellExecutable) Sets the PowerShell executable used for running PowerShell scripts.voidsetProvisionMode(org.flywaydb.core.internal.configuration.resolvers.ProvisionerMode provisionerMode) voidsetRepeatableSqlMigrationPrefix(String repeatableSqlMigrationPrefixProp) voidsetReportEnabled(Boolean reportEnabled) voidsetReportFilename(String reportFilename) voidsetResolvers(MigrationResolver... resolvers) Sets custom MigrationResolvers to be used in addition to the built-in ones for resolving Migrations to apply.voidsetResolversAsClassNames(String... resolvers) Sets custom MigrationResolvers to be used in addition to the built-in ones for resolving Migrations to apply.voidsetResourceProvider(ResourceProvider resourceProvider) voidsetSchemas(String[] tokenizeToStringArray) voidsetScriptPlaceholderPrefix(String scriptPlaceholderPrefix) Sets the prefix of every script placeholder.voidsetScriptPlaceholderSuffix(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 skipDefaultCallbacksProp) voidsetSkipDefaultResolvers(Boolean skipDefaultResolversProp) voidsetSkipExecutingMigrations(boolean skipExecutingMigrations) Whether Flyway should skip actually executing the contents of the migrations and only update the schema history table.voidsetSqlMigrationPrefix(String sqlMigrationPrefix) Sets the file name prefix for sql migrations.voidsetSqlMigrationSeparator(String sqlMigrationSeparator) Sets the file name separator for sql migrations.voidsetSqlMigrationSuffixes(String... sqlMigrationSuffixes) The file name suffixes for SQL migrations.voidsetStream(boolean stream) Whether to stream SQL migrations when executing them.voidvoidsetTablespace(String tablespaceProp) voidsetTarget(MigrationVersion target) voidsetTargetAsString(String target) Sets the target version up to which Flyway should consider migrations.voidvoidvoidsetValidateMigrationNaming(Boolean validateMigrationNamingProp) voidsetValidateOnMigrate(Boolean validateOnMigrateProp) voidsetWorkingDirectory(String workingDirectory)
-
Field Details
-
TEMP_ENVIRONMENT_NAME
- See Also:
-
-
Constructor Details
-
ClassicConfiguration
public ClassicConfiguration(org.flywaydb.core.internal.configuration.models.ConfigurationModel modernConfig) -
ClassicConfiguration
public ClassicConfiguration() -
ClassicConfiguration
- Parameters:
classLoader- The ClassLoader to use for loading migrations, resolvers, etc. from the classpath. (default: Thread.currentThread().getContextClassLoader())
-
ClassicConfiguration
Creates a new configuration with the same values as this existing one.
-
-
Method Details
-
setClassLoader
-
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.
-
setDataSource
-
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)
-
setDefaultSchema
-
getCurrentResolvedEnvironment
public org.flywaydb.core.internal.configuration.models.ResolvedEnvironment getCurrentResolvedEnvironment() -
getCurrentResolvedEnvironment
public org.flywaydb.core.internal.configuration.models.ResolvedEnvironment getCurrentResolvedEnvironment(org.flywaydb.core.ProgressLogger progress) -
getResolvedEnvironment
public org.flywaydb.core.internal.configuration.models.ResolvedEnvironment getResolvedEnvironment(String envName) -
getResolvedEnvironment
public org.flywaydb.core.internal.configuration.models.ResolvedEnvironment getResolvedEnvironment(String envName, org.flywaydb.core.internal.configuration.resolvers.ProvisionerMode provisionerMode, org.flywaydb.core.ProgressLogger progress) - Specified by:
getResolvedEnvironmentin interfaceConfiguration
-
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)
-
setSchemas
-
isReportEnabled
public boolean isReportEnabled()- Specified by:
isReportEnabledin interfaceConfiguration
-
setReportEnabled
-
getEncoding
Description copied from interface:ConfigurationRetrieves the encoding of Sql migrations.- Specified by:
getEncodingin interfaceConfiguration- Returns:
- The encoding of Sql migrations. (default: UTF-8)
-
setEncoding
-
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
-
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
-
getReportFilename
Description copied from interface:ConfigurationGet the filename of generated reports- Specified by:
getReportFilenamein interfaceConfiguration- Returns:
- report filename;
-
setReportFilename
-
getCachedResolvedEnvironments
public Map<String,org.flywaydb.core.internal.configuration.models.ResolvedEnvironment> getCachedResolvedEnvironments()Description copied from interface:ConfigurationGets the connection environments that have already been resolved from this configuration- Specified by:
getCachedResolvedEnvironmentsin interfaceConfiguration
-
getCachedDataSources
public Map<String,org.flywaydb.core.internal.configuration.models.DataSourceModel> getCachedDataSources()Description copied from interface:ConfigurationGets DataSources for all the environments- Specified by:
getCachedDataSourcesin interfaceConfiguration
-
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)
-
setCallbacks
-
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)
-
setResolvers
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)
-
getUrl
Description copied from interface:ConfigurationRetrieves the url used to construct the dataSource. May be null if the dataSource was passed in directly. This method will trigger an environment resolution operation if no environment has been resolved yet.- Specified by:
getUrlin interfaceConfiguration- Returns:
- The url used to construct the dataSource. May be null if the dataSource was passed in directly.
-
setUrl
-
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.
-
setUser
-
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.
-
setPassword
-
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)
-
getCallbackLocations
Description copied from interface:ConfigurationRetrieves the locations to scan recursively for callbacks. 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 callbacks. Locations starting withfilesystem:point to a directory on the filesystem, may only contain SQL callbacks and are only scanned recursively down non-hidden directories.- Specified by:
getCallbackLocationsin interfaceConfiguration- Returns:
- Locations to scan recursively for callbacks.
-
setLocations
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)
-
setCallbackLocations
Sets the locations to scan recursively for callbacks. 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 callbacks. Locations starting withfilesystem:point to a directory on the filesystem, may only contain SQL callbacks and are only scanned recursively down non-hidden directories.- Parameters:
callbackLocations- Locations to scan recursively for callbacks.
-
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)
-
setBaselineOnMigrate
-
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.- Specified by:
isSkipExecutingMigrationsin interfaceConfiguration- Returns:
trueif executing the migrations should be skipped on migrate,falseif not. (default:false)
-
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. -
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)
-
setOutOfOrder
-
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://documentation.red-gate.com/flyway/reference/configuration/flyway-namespace/flyway-ignore-migration-patterns-setting for full details Example: repeatable:missing,versioned:pending,*:failed (default: *:future) - Specified by:
getIgnoreMigrationPatternsin interfaceConfiguration
-
setIgnoreMigrationPatterns
Ignore migrations that match this comma-separated list of patterns when validating migrations. Each pattern is of the form: See ... for full details Example: repeatable:missing,versioned:pending,*:failed -
setIgnoreMigrationPatterns
Ignore migrations that match this array of ValidatePatterns when validating migrations. See ... for full details -
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)
-
setValidateMigrationNaming
-
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)
-
setValidateOnMigrate
-
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)
-
setCleanOnValidationError
-
isCleanDisabled
public boolean isCleanDisabled()Description copied from interface:ConfigurationWhether to disable clean. This is especially useful for production environments where running clean can be a career limiting move.- Specified by:
isCleanDisabledin interfaceConfiguration- Returns:
trueto disable clean.falseto be able to clean. (default:true)
-
setCleanDisabled
-
isCommunityDBSupportEnabled
public boolean isCommunityDBSupportEnabled()Description copied from interface:ConfigurationWhether to disable community database support. This is especially useful for production environments where using community databases is undesirable.- Specified by:
isCommunityDBSupportEnabledin interfaceConfiguration- Returns:
trueto disable community database support.falseto be able to use community database support. (default:false)
-
setCommunityDBSupportEnabled
-
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)
-
setMixed
-
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)
-
setGroup
-
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).
-
setInstalledBy
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).
-
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)
-
setErrorOverrides
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)
-
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.
-
setDryRunOutput
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.
-
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)
-
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)
-
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)
-
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)
-
getKerberosConfigFile
Description copied from interface:ConfigurationThe path to the Kerberos config file. Flyway Teams only- Specified by:
getKerberosConfigFilein interfaceConfiguration
-
setKerberosConfigFile
When connecting to a Kerberos service to authenticate, the path to the Kerberos config file. Flyway Teams only -
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)
-
setOutputQueryResults
public void setOutputQueryResults(boolean outputQueryResults) Whether Flyway should output a table with the results of queries when executing migrations. Flyway Teams only -
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:
-
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
-
setLockRetryCount
-
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
-
setJdbcProperties
Properties to pass to the JDBC driver object. -
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:
-
setFailOnMissingLocations
-
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)
- slf4j: Use the slf4j logger
- log4j2: Use the log4j2 logger
- apache-commons: Use the Apache Commons logger
- Specified by:
getLoggersin interfaceConfiguration
-
setLoggers
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)
- slf4j: Use the slf4j logger
- log4j2: Use the log4j2 logger
- apache-commons: Use the Apache Commons logger
-
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)
-
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).
-
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)
-
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).
-
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)
-
setInitSql
-
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)
-
setBaselineVersion
-
setBaselineVersion
-
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 >>)
-
setBaselineDescription
-
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)
-
setSkipDefaultResolvers
-
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)
-
setSkipDefaultCallbacks
-
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)
-
setSqlMigrationPrefix
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)
-
isExecuteInTransaction
public boolean isExecuteInTransaction()Description copied from interface:ConfigurationChecks whether SQL is executed in a transaction.- Specified by:
isExecuteInTransactionin interfaceConfiguration- Returns:
- Whether SQL is executed in a transaction. (default: true)
-
setExecuteInTransaction
public void setExecuteInTransaction(boolean executeInTransaction) Sets whether SQL should be executed within a transaction.- Parameters:
executeInTransaction-trueto enable execution of SQL in a transaction,falseotherwise
-
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)
-
setRepeatableSqlMigrationPrefix
-
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: __)
-
setSqlMigrationSeparator
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: __)
-
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.
-
setSqlMigrationSuffixes
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.
-
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)
-
setPlaceholderReplacement
-
getPlaceholderSuffix
Description copied from interface:ConfigurationRetrieves the suffix of every placeholder.- Specified by:
getPlaceholderSuffixin interfaceConfiguration- Returns:
- The suffix of every placeholder. (default: } )
-
setPlaceholderSuffix
Sets the suffix of every placeholder.- Parameters:
placeholderSuffix- The suffix of every placeholder. (default: } )
-
getPlaceholderPrefix
Description copied from interface:ConfigurationRetrieves the prefix of every placeholder.- Specified by:
getPlaceholderPrefixin interfaceConfiguration- Returns:
- The prefix of every placeholder. (default: ${ )
-
setPlaceholderPrefix
Sets the prefix of every placeholder.- Parameters:
placeholderPrefix- The prefix of every placeholder. (default: ${ )
-
getPlaceholderSeparator
Description copied from interface:ConfigurationRetrieves the separator of default placeholders.- Specified by:
getPlaceholderSeparatorin interfaceConfiguration- Returns:
- The separator of default placeholders. (default: : )
-
setPlaceholderSeparator
Sets the separator of default placeholders.- Parameters:
placeholderSeparator- The separator of default placeholders. (default: : )
-
getScriptPlaceholderSuffix
Description copied from interface:ConfigurationRetrieves the suffix of every script placeholder.- Specified by:
getScriptPlaceholderSuffixin interfaceConfiguration- Returns:
- The suffix of every script placeholder. (default: __ )
-
setScriptPlaceholderSuffix
Sets the suffix of every placeholder.- Parameters:
scriptPlaceholderSuffix- The suffix of every placeholder. (default: __ )
-
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__ )
-
setScriptPlaceholderPrefix
Sets the prefix of every script placeholder.- Parameters:
scriptPlaceholderPrefix- The prefix of every placeholder. (default: FP__ )
-
getPowershellExecutable
Description copied from interface:ConfigurationRetrieves the PowerShell executable used for running PowerShell scripts.- Specified by:
getPowershellExecutablein interfaceConfiguration- Returns:
- The PowerShell executable (default: "powershell" on Windows, "pwsh" on other platforms)
-
setPowershellExecutable
Sets the PowerShell executable used for running PowerShell scripts.- Parameters:
powershellExecutable- The PowerShell executable (default: "powershell" on Windows, "pwsh" on other platforms)
-
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.
-
setPlaceholders
-
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
-
setTarget
-
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
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.
-
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)
-
setTable
-
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.
-
setTablespace
-
setDryRunOutputAsFile
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
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.
-
setLocationsAsStrings
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)
-
setCallbackLocationsAsStrings
Sets the locations to scan recursively for callbacks. 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 callbacks. Locations starting withfilesystem:point to a directory on the filesystem, may only contain SQL callbacks and are only scanned recursively down non-hidden directories.- Parameters:
callbackLocations- Locations to scan recursively for callbacks.
-
setEnvironment
-
setProvisionMode
public void setProvisionMode(org.flywaydb.core.internal.configuration.resolvers.ProvisionerMode provisionerMode) -
setEnvironmentProvisionMode
public void setEnvironmentProvisionMode(org.flywaydb.core.internal.configuration.resolvers.ProvisionerMode provisionMode) -
setAllEnvironments
-
setEncodingAsString
Sets the encoding of SQL migrations.- Parameters:
encoding- The encoding of SQL migrations. (default: UTF-8)
-
setTargetAsString
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. -
setJavaMigrations
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)
-
setDataSource
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.
-
getDatabaseType
public org.flywaydb.core.internal.database.DatabaseType getDatabaseType()Description copied from interface:ConfigurationGet the Database type determined by the URL or Datasource If there are multiple matching DatabaseTypes for the URL, the first candidate will be returned.- Specified by:
getDatabaseTypein interfaceConfiguration
-
setBaselineVersionAsString
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)
-
setCallbacksAsClassNames
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
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.
-
setResolversAsClassNames
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)
-
setShouldCreateSchemas
public void setShouldCreateSchemas(boolean createSchemas) Whether Flyway should attempt to create the schemas specified in the schemas property.- Parameters:
createSchemas-
-
configure
Configure with the same values as this existing configuration. -
configure
Configures Flyway with these properties. This overwrites any existing configuration. Properties are documented here: ...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
Configures Flyway with these properties. This overwrites any existing configuration. Properties are documented here: ...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.
-
getDriver
Description copied from interface:ConfigurationThe JDBC driver of the configuration- Specified by:
getDriverin interfaceConfiguration
-
setDriver
-
requestResolvedEnvironmentRefresh
-
getCurrentEnvironmentName
Description copied from interface:ConfigurationGet the name of the current environment- Specified by:
getCurrentEnvironmentNamein interfaceConfiguration
-
configureUsingEnvVars
public void configureUsingEnvVars()Configures Flyway using FLYWAY_* environment variables. -
createProgress
- Specified by:
createProgressin interfaceConfiguration
-
getConfigurationExtension
public <T extends org.flywaydb.core.extensibility.ConfigurationExtension> T getConfigurationExtension(Class<T> extensionClass) Description copied from interface:ConfigurationRetrieves a configuration extension.- Specified by:
getConfigurationExtensionin interfaceConfiguration- Parameters:
extensionClass- the extension class- Returns:
- configuration extension
-
getModernConfig
public org.flywaydb.core.internal.configuration.models.ConfigurationModel getModernConfig()- Specified by:
getModernConfigin interfaceConfiguration
-
getWorkingDirectory
- Specified by:
getWorkingDirectoryin interfaceConfiguration
-
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() )
-
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
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)
-
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)
-
getPluginRegister
public org.flywaydb.core.internal.plugin.PluginRegister getPluginRegister()- Specified by:
getPluginRegisterin interfaceConfiguration
-
getJarDirs
-
setModernConfig
public void setModernConfig(org.flywaydb.core.internal.configuration.models.ConfigurationModel modernConfig) -
setWorkingDirectory
-
setResourceProvider
-
setJavaMigrationClassProvider
-
setPluginRegister
public void setPluginRegister(org.flywaydb.core.internal.plugin.PluginRegister pluginRegister)
-