Skip to content

Commit

Permalink
fix : issue with starting application
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed Jan 5, 2024
1 parent 67d9dde commit 3f11332
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

import com.zaxxer.hikari.HikariDataSource;
import javax.sql.DataSource;
import liquibase.UpdateSummaryEnum;
import liquibase.UpdateSummaryOutputEnum;
import liquibase.integration.spring.SpringLiquibase;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
Expand Down Expand Up @@ -39,7 +40,6 @@ LiquibaseProperties primaryLiquibaseProperties() {
}

@Bean
@DependsOnDatabaseInitialization
SpringLiquibase primaryLiquibase(
@Qualifier("primaryDataSource") DataSource primaryDataSource,
@Qualifier("primaryLiquibaseProperties")
Expand Down Expand Up @@ -68,7 +68,6 @@ LiquibaseProperties secondaryLiquibaseProperties() {
}

@Bean
@DependsOnDatabaseInitialization
SpringLiquibase secondaryLiquibase(
@Qualifier("secondaryDataSource") DataSource secondaryDataSource,
@Qualifier("secondaryLiquibaseProperties")
Expand All @@ -95,6 +94,13 @@ private SpringLiquibase springLiquibase(DataSource dataSource, LiquibaseProperti
liquibase.setRollbackFile(properties.getRollbackFile());
liquibase.setTestRollbackOnUpdate(properties.isTestRollbackOnUpdate());
liquibase.setTag(properties.getTag());
if (properties.getShowSummary() != null) {
liquibase.setShowSummary(UpdateSummaryEnum.valueOf(properties.getShowSummary().name()));
}
if (properties.getShowSummaryOutput() != null) {
liquibase.setShowSummaryOutput(
UpdateSummaryOutputEnum.valueOf(properties.getShowSummaryOutput().name()));
}
return liquibase;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

import com.zaxxer.hikari.HikariDataSource;
import javax.sql.DataSource;
import liquibase.UpdateSummaryEnum;
import liquibase.UpdateSummaryOutputEnum;
import liquibase.integration.spring.SpringLiquibase;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
Expand Down Expand Up @@ -39,7 +40,6 @@ LiquibaseProperties primaryLiquibaseProperties() {
}

@Bean
@DependsOnDatabaseInitialization
SpringLiquibase primaryLiquibase(
@Qualifier("primaryDataSource") DataSource primaryDataSource,
@Qualifier("primaryLiquibaseProperties")
Expand Down Expand Up @@ -68,7 +68,6 @@ LiquibaseProperties secondaryLiquibaseProperties() {
}

@Bean
@DependsOnDatabaseInitialization
SpringLiquibase secondaryLiquibase(
@Qualifier("secondaryDataSource") DataSource secondaryDataSource,
@Qualifier("secondaryLiquibaseProperties")
Expand All @@ -95,6 +94,13 @@ private SpringLiquibase springLiquibase(DataSource dataSource, LiquibaseProperti
liquibase.setRollbackFile(properties.getRollbackFile());
liquibase.setTestRollbackOnUpdate(properties.isTestRollbackOnUpdate());
liquibase.setTag(properties.getTag());
if (properties.getShowSummary() != null) {
liquibase.setShowSummary(UpdateSummaryEnum.valueOf(properties.getShowSummary().name()));
}
if (properties.getShowSummaryOutput() != null) {
liquibase.setShowSummaryOutput(
UpdateSummaryOutputEnum.valueOf(properties.getShowSummaryOutput().name()));
}
return liquibase;
}
}

0 comments on commit 3f11332

Please sign in to comment.