Package io.quarkus.flyway.runtime
Class FlywayDataSourceRuntimeConfig
- java.lang.Object
-
- io.quarkus.flyway.runtime.FlywayDataSourceRuntimeConfig
-
public final class FlywayDataSourceRuntimeConfig extends Object
-
-
Field Summary
Fields Modifier and Type Field Description Optional<String>baselineDescriptionThe description to tag an existing schema with when executing baseline.booleanbaselineOnMigrateEnable the creation of the history table if it does not exist already.Optional<String>baselineVersionThe initial baseline version.booleancleanAtStarttrue to execute Flyway clean command automatically when the application starts, false otherwise.booleancleanDisabledtrue to prevent Flyway clean operations, false otherwise.booleancleanOnValidationErrortrue to automatically call clean when a validation error occurs, false otherwise.OptionalIntconnectRetriesThe maximum number of retries when attempting to connect to the database.booleancreateSchemasWhether Flyway should attempt to create the schemas specified in the schemas propertyOptional<String>defaultSchemaSets the default schema managed by Flyway.booleanignoreFutureMigrationsIgnore future migrations when reading the history table.Optional<String[]>ignoreMigrationPatternsIgnore migrations during validate and repair according to a given list of patterns (see https://flywaydb.org/documentation/configuration/parameters/ignoreMigrationPatterns for more information).booleanignoreMissingMigrationsIgnore missing migrations when reading the history table.Optional<String>initSqlThe SQL statements to run to initialize a new database connection immediately after opening it.Optional<String>jdbcUrlThe JDBC URL that Flyway uses to connect to the database.booleanmigrateAtStarttrue to execute Flyway automatically when the application starts, false otherwise.booleanoutOfOrderAllows migrations to be run "out of order".Optional<String>passwordThe password that Flyway uses to connect to the database.Optional<String>placeholderPrefixPrefix of every placeholder (default: ${ )Map<String,String>placeholdersSets the placeholders to replace in SQL migration scripts.Optional<String>placeholderSuffixSuffix of every placeholder (default: } )booleanrepairAtStarttrue to execute a Flyway repair command when the application starts, false otherwise.Optional<String>repeatableSqlMigrationPrefixThe file name prefix for repeatable SQL migrations.Optional<List<String>>schemasComma-separated case-sensitive list of schemas managed by Flyway.Optional<String>sqlMigrationPrefixThe file name prefix for versioned SQL migrations.Optional<String>tableThe name of Flyway's schema history table.Optional<String>usernameThe username that Flyway uses to connect to the database.booleanvalidateAtStarttrue to execute a Flyway validate command when the application starts, false otherwise.booleanvalidateMigrationNamingWhether to validate migrations and callbacks whose scripts do not obey the correct naming convention.booleanvalidateOnMigrateWhether to automatically call validate when performing a migration.
-
Constructor Summary
Constructors Constructor Description FlywayDataSourceRuntimeConfig()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FlywayDataSourceRuntimeConfigdefaultConfig()Creates aFlywayDataSourceRuntimeConfigwith default settings.
-
-
-
Field Detail
-
connectRetries
@ConfigItem public OptionalInt 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.
-
defaultSchema
@ConfigItem public Optional<String> defaultSchema
Sets the default schema managed by Flyway. This schema name is case-sensitive. If not specified, but schemas is, Flyway uses the first schema in that list. If that is also not specified, Flyway uses the default schema for the database connection.Consequences:
- This schema will be the one containing the schema history table.
- This schema will be the default for the database connection (provided the database supports this concept).
-
jdbcUrl
@ConfigItem public Optional<String> jdbcUrl
The JDBC URL that Flyway uses to connect to the database. Falls back to the datasource URL if not specified.
-
username
@ConfigItem public Optional<String> username
The username that Flyway uses to connect to the database. If no specific JDBC URL is configured, falls back to the datasource username if not specified.
-
password
@ConfigItem public Optional<String> password
The password that Flyway uses to connect to the database. If no specific JDBC URL is configured, falls back to the datasource password if not specified.
-
schemas
@ConfigItem public Optional<List<String>> schemas
Comma-separated case-sensitive list of schemas managed by Flyway. The first schema in the list will be automatically set as the default one during the migration. It will also be the one containing the schema history table.
-
table
@ConfigItem public Optional<String> table
The name of Flyway's schema history table. 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.
-
sqlMigrationPrefix
@ConfigItem public Optional<String> sqlMigrationPrefix
The 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
-
repeatableSqlMigrationPrefix
@ConfigItem public Optional<String> repeatableSqlMigrationPrefix
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
-
cleanAtStart
@ConfigItem public boolean cleanAtStart
true to execute Flyway clean command automatically when the application starts, false otherwise.
-
cleanDisabled
@ConfigItem public boolean cleanDisabled
true to prevent Flyway clean operations, false otherwise.
-
cleanOnValidationError
@ConfigItem public boolean cleanOnValidationError
true to automatically call clean when a validation error occurs, false otherwise.
-
migrateAtStart
@ConfigItem public boolean migrateAtStart
true to execute Flyway automatically when the application starts, false otherwise.
-
repairAtStart
@ConfigItem public boolean repairAtStart
true to execute a Flyway repair command when the application starts, false otherwise.
-
validateAtStart
@ConfigItem public boolean validateAtStart
true to execute a Flyway validate command when the application starts, false otherwise.
-
baselineOnMigrate
@ConfigItem public boolean baselineOnMigrate
Enable the creation of the history table if it does not exist already.
-
baselineVersion
@ConfigItem public Optional<String> baselineVersion
The initial baseline version.
-
baselineDescription
@ConfigItem public Optional<String> baselineDescription
The description to tag an existing schema with when executing baseline.
-
validateOnMigrate
@ConfigItem(defaultValue="true") public boolean validateOnMigrate
Whether to automatically call validate when performing a migration.
-
outOfOrder
@ConfigItem public boolean outOfOrder
Allows migrations to be run "out of order".
-
ignoreMissingMigrations
@ConfigItem public boolean ignoreMissingMigrations
Ignore missing migrations when reading the history table. When set to true migrations from older versions present in the history table but absent in the configured locations will be ignored (and logged as a warning), when false (the default) the validation step will fail.
-
ignoreFutureMigrations
@ConfigItem public boolean ignoreFutureMigrations
Ignore future migrations when reading the history table. When set to true migrations from newer versions present in the history table but absent in the configured locations will be ignored (and logged as a warning), when false (the default) the validation step will fail.
-
placeholders
@ConfigItem public Map<String,String> placeholders
Sets the placeholders to replace in SQL migration scripts.
-
createSchemas
@ConfigItem(defaultValue="true") public boolean createSchemas
Whether Flyway should attempt to create the schemas specified in the schemas property
-
placeholderPrefix
@ConfigItem public Optional<String> placeholderPrefix
Prefix of every placeholder (default: ${ )
-
placeholderSuffix
@ConfigItem public Optional<String> placeholderSuffix
Suffix of every placeholder (default: } )
-
initSql
@ConfigItem public Optional<String> initSql
The SQL statements to run to initialize a new database connection immediately after opening it.
-
validateMigrationNaming
@ConfigItem public boolean validateMigrationNaming
Whether to validate migrations and callbacks whose scripts do not obey the correct naming convention. A failure can be useful to check that errors such as case sensitivity in migration prefixes have been corrected.
-
ignoreMigrationPatterns
@ConfigItem public Optional<String[]> ignoreMigrationPatterns
Ignore migrations during validate and repair according to a given list of patterns (see https://flywaydb.org/documentation/configuration/parameters/ignoreMigrationPatterns for more information). When this configuration is set, the ignoreFutureMigrations and ignoreMissingMigrations settings are ignored. Patterns are comma separated.
-
-
Method Detail
-
defaultConfig
public static FlywayDataSourceRuntimeConfig defaultConfig()
Creates aFlywayDataSourceRuntimeConfigwith default settings.- Returns:
FlywayDataSourceRuntimeConfig
-
-