Search in sources :

Example 1 with ConditionalOnExpression

use of org.springframework.boot.autoconfigure.condition.ConditionalOnExpression in project CzechIdMng by bcvsolutions.

the class AccFlywayConfig method flywayAcc.

@Bean
@DependsOn("flywayCore")
@ConditionalOnMissingBean(name = "flywayAcc")
@ConditionalOnExpression("${flyway.enabled:true} && '${flyway.acc.locations}'!=''")
@ConfigurationProperties(prefix = "flyway.acc")
public Flyway flywayAcc() {
    Flyway flyway = super.createFlyway();
    log.info("Starting flyway migration for module acc [{}]: ", flyway.getTable());
    return flyway;
}
Also used : Flyway(org.flywaydb.core.Flyway) ConditionalOnExpression(org.springframework.boot.autoconfigure.condition.ConditionalOnExpression) DependsOn(org.springframework.context.annotation.DependsOn) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConfigurationProperties(org.springframework.boot.context.properties.ConfigurationProperties) EnableConfigurationProperties(org.springframework.boot.context.properties.EnableConfigurationProperties) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with ConditionalOnExpression

use of org.springframework.boot.autoconfigure.condition.ConditionalOnExpression in project CzechIdMng by bcvsolutions.

the class CoreFlywayConfig method flywayCore.

@Bean
@ConditionalOnMissingBean(name = NAME)
@DependsOn(IdmFlywayPostProcessor.NAME)
@ConditionalOnExpression("${flyway.enabled:true} && '${flyway.core.locations}'!=''")
@ConfigurationProperties(prefix = "flyway.core")
public Flyway flywayCore() {
    Flyway flyway = super.createFlyway();
    log.info("Starting flyway migration for module core [{}]: ", flyway.getTable());
    return flyway;
}
Also used : Flyway(org.flywaydb.core.Flyway) ConditionalOnExpression(org.springframework.boot.autoconfigure.condition.ConditionalOnExpression) DependsOn(org.springframework.context.annotation.DependsOn) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConfigurationProperties(org.springframework.boot.context.properties.ConfigurationProperties) EnableConfigurationProperties(org.springframework.boot.context.properties.EnableConfigurationProperties) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 3 with ConditionalOnExpression

use of org.springframework.boot.autoconfigure.condition.ConditionalOnExpression in project CzechIdMng by bcvsolutions.

the class ExampleFlywayConfig method flywayModuleExample.

@Bean
@DependsOn("flywayCore")
@ConditionalOnMissingBean(name = "flywayModuleExample")
@ConditionalOnExpression("${flyway.enabled:true} && '${flyway.example.locations}'!=''")
@ConfigurationProperties(prefix = "flyway.example")
public Flyway flywayModuleExample() {
    Flyway flyway = super.createFlyway();
    log.info("Starting flyway migration for example module [{}]: ", flyway.getTable());
    return flyway;
}
Also used : Flyway(org.flywaydb.core.Flyway) ConditionalOnExpression(org.springframework.boot.autoconfigure.condition.ConditionalOnExpression) DependsOn(org.springframework.context.annotation.DependsOn) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConfigurationProperties(org.springframework.boot.context.properties.ConfigurationProperties) EnableConfigurationProperties(org.springframework.boot.context.properties.EnableConfigurationProperties) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 4 with ConditionalOnExpression

use of org.springframework.boot.autoconfigure.condition.ConditionalOnExpression in project CzechIdMng by bcvsolutions.

the class RptFlywayConfig method flywayRpt.

@Bean
@DependsOn("flywayCore")
@ConditionalOnMissingBean(name = "flywayRpt")
@ConditionalOnExpression("${flyway.enabled:true} && '${flyway.rpt.locations}'!=''")
@ConfigurationProperties(prefix = "flyway.rpt")
public Flyway flywayRpt() {
    Flyway flyway = super.createFlyway();
    log.info("Starting flyway migration for module rpt [{}]: ", flyway.getTable());
    return flyway;
}
Also used : Flyway(org.flywaydb.core.Flyway) ConditionalOnExpression(org.springframework.boot.autoconfigure.condition.ConditionalOnExpression) DependsOn(org.springframework.context.annotation.DependsOn) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConfigurationProperties(org.springframework.boot.context.properties.ConfigurationProperties) EnableConfigurationProperties(org.springframework.boot.context.properties.EnableConfigurationProperties) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 5 with ConditionalOnExpression

use of org.springframework.boot.autoconfigure.condition.ConditionalOnExpression in project CzechIdMng by bcvsolutions.

the class VirtualSystemFlywayConfig method flywayModuleVirtualSystem.

@Bean
@DependsOn("flywayCore")
@ConditionalOnMissingBean(name = "flywayModuleVirtualSystem")
@ConditionalOnExpression("${flyway.enabled:true} && '${flyway.vs.locations}'!=''")
@ConfigurationProperties(prefix = "flyway.vs")
public Flyway flywayModuleVirtualSystem() {
    Flyway flyway = super.createFlyway();
    log.info("Starting flyway migration for vs module [{}]: ", flyway.getTable());
    return flyway;
}
Also used : Flyway(org.flywaydb.core.Flyway) ConditionalOnExpression(org.springframework.boot.autoconfigure.condition.ConditionalOnExpression) DependsOn(org.springframework.context.annotation.DependsOn) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConfigurationProperties(org.springframework.boot.context.properties.ConfigurationProperties) EnableConfigurationProperties(org.springframework.boot.context.properties.EnableConfigurationProperties) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

Flyway (org.flywaydb.core.Flyway)5 ConditionalOnExpression (org.springframework.boot.autoconfigure.condition.ConditionalOnExpression)5 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)5 ConfigurationProperties (org.springframework.boot.context.properties.ConfigurationProperties)5 EnableConfigurationProperties (org.springframework.boot.context.properties.EnableConfigurationProperties)5 Bean (org.springframework.context.annotation.Bean)5 DependsOn (org.springframework.context.annotation.DependsOn)5