Package io.micronaut.flyway
Class FlywayConfigurationProperties
- java.lang.Object
-
- io.micronaut.flyway.FlywayConfigurationProperties
-
- All Implemented Interfaces:
io.micronaut.core.util.Toggleable
@Context @EachProperty("flyway.datasources") public class FlywayConfigurationProperties extends java.lang.Object implements io.micronaut.core.util.ToggleableCreate a Flyway Configuration for each sub-property of flyway.*.- Since:
- 1.0.0
- See Also:
FluentConfiguration
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_ASYNCstatic booleanDEFAULT_CLEAN_SCHEMAstatic booleanDEFAULT_ENABLED
-
Constructor Summary
Constructors Constructor Description FlywayConfigurationProperties(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.flywaydb.core.api.configuration.FluentConfigurationgetFluentConfiguration()org.flywaydb.core.api.Location[]getLocations()java.lang.StringgetNameQualifier()java.lang.StringgetPassword()java.lang.StringgetUrl()java.lang.StringgetUser()booleanhasAlternativeDatabaseConfiguration()Whether there is an alternative database configuration for the migration.booleanisAsync()booleanisCleanSchema()Whether Flyway will clean the schema before running the migrations.booleanisEnabled()voidsetAsync(boolean async)Whether flyway migrations should run asynchronously.voidsetCleanSchema(boolean cleanSchema)Set whether Flyway will clean the schema before running the migrations.voidsetEnabled(boolean enabled)Set whether this flyway configuration is enabled.voidsetLocations(java.lang.String... locations)voidsetPassword(java.lang.String password)voidsetUrl(java.lang.String url)voidsetUser(java.lang.String user)voidsetUsername(java.lang.String username)
-
-
-
Field Detail
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLED
- See Also:
- Constant Field Values
-
DEFAULT_ASYNC
public static final boolean DEFAULT_ASYNC
- See Also:
- Constant Field Values
-
DEFAULT_CLEAN_SCHEMA
public static final boolean DEFAULT_CLEAN_SCHEMA
- See Also:
- Constant Field Values
-
-
Method Detail
-
getNameQualifier
public java.lang.String getNameQualifier()
- Returns:
- The qualifier associated with this flyway configuration
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabledin interfaceio.micronaut.core.util.Toggleable
-
setEnabled
public void setEnabled(boolean enabled)
Set whether this flyway configuration is enabled. Default value (true).- Parameters:
enabled- true if it is enabled
-
isAsync
public boolean isAsync()
- Returns:
- Whether the flyway migrations should run asynchronously
-
setAsync
public void setAsync(boolean async)
Whether flyway migrations should run asynchronously.- Parameters:
async- true to run flyway migrations asynchronously
-
isCleanSchema
public boolean isCleanSchema()
Whether Flyway will clean the schema before running the migrations. Default value (false).- Returns:
- Whether clean the schema before running the migrations
-
setCleanSchema
public void setCleanSchema(boolean cleanSchema)
Set whether Flyway will clean the schema before running the migrations. Default value (false).- Parameters:
cleanSchema- true to clean the schema before running the migrations.
-
getUrl
public java.lang.String getUrl()
- Returns:
- JDBC url of the database to migrate
-
setUrl
public void setUrl(java.lang.String url)
- Parameters:
url- The JDBC url of the database to migrate
-
getUser
public java.lang.String getUser()
- Returns:
- The user of the database to migrate
-
setUser
public void setUser(java.lang.String user)
- Parameters:
user- The user of the database to migrate
-
setUsername
public void setUsername(java.lang.String username)
- Parameters:
username- The username of the database to migrate
-
getPassword
public java.lang.String getPassword()
- Returns:
- The password of the database to migrate
-
setPassword
public void setPassword(java.lang.String password)
- Parameters:
password- The password of the database to migrate
-
getLocations
public org.flywaydb.core.api.Location[] getLocations()
- Returns:
- The locations for the database migrations
-
setLocations
public void setLocations(java.lang.String... locations)
- Parameters:
locations- The locations for the migrations
-
hasAlternativeDatabaseConfiguration
public boolean hasAlternativeDatabaseConfiguration()
Whether there is an alternative database configuration for the migration. By default Micronaut will use theDataSourcedefined for the application but if bothurlanduserare defined, then those will be use for Flyway.- Returns:
- true if there is an alternative database configuration
-
getFluentConfiguration
public org.flywaydb.core.api.configuration.FluentConfiguration getFluentConfiguration()
- Returns:
- The flyway configuration builder
-
-