Upgrade to Liquibase 4.16.0

Closes gh-32354
pull/32374/head
Stephane Nicoll 2 years ago
parent 4c7d6799f8
commit bcb5f048d2

@ -99,7 +99,7 @@ public class LiquibaseAutoConfiguration {
liquibase.setDatabaseChangeLogLockTable(this.properties.getDatabaseChangeLogLockTable());
liquibase.setDropFirst(this.properties.isDropFirst());
liquibase.setShouldRun(this.properties.isEnabled());
liquibase.setLabels(this.properties.getLabels());
liquibase.setLabelFilter(this.properties.getLabelFilter());
liquibase.setChangeLogParameters(this.properties.getParameters());
liquibase.setRollbackFile(this.properties.getRollbackFile());
liquibase.setTestRollbackOnUpdate(this.properties.isTestRollbackOnUpdate());

@ -22,6 +22,7 @@ import java.util.Map;
import liquibase.integration.spring.SpringLiquibase;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
import org.springframework.util.Assert;
/**
@ -111,7 +112,7 @@ public class LiquibaseProperties {
/**
* Comma-separated list of runtime labels to use.
*/
private String labels;
private String labelFilter;
/**
* Change log parameters.
@ -248,12 +249,23 @@ public class LiquibaseProperties {
this.url = url;
}
public String getLabelFilter() {
return this.labelFilter;
}
public void setLabelFilter(String labelFilter) {
this.labelFilter = labelFilter;
}
@Deprecated
@DeprecatedConfigurationProperty(replacement = "spring.liquibase.label-filter")
public String getLabels() {
return this.labels;
return getLabelFilter();
}
@Deprecated
public void setLabels(String labels) {
this.labels = labels;
setLabelFilter(labels);
}
public Map<String, String> getParameters() {

@ -296,10 +296,18 @@ class LiquibaseAutoConfigurationTests {
}
@Test
void overrideLabels() {
void overrideLabelFilter() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
.withPropertyValues("spring.liquibase.labels:test, production")
.run(assertLiquibase((liquibase) -> assertThat(liquibase.getLabels()).isEqualTo("test, production")));
.withPropertyValues("spring.liquibase.label-filter:test, production").run(assertLiquibase(
(liquibase) -> assertThat(liquibase.getLabelFilter()).isEqualTo("test, production")));
}
@Test
@Deprecated
void overrideLabelFilterWithDeprecatedLabelsProperty() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
.withPropertyValues("spring.liquibase.labels:test, production").run(assertLiquibase(
(liquibase) -> assertThat(liquibase.getLabelFilter()).isEqualTo("test, production")));
}
@Test

@ -845,7 +845,7 @@ bom {
]
}
}
library("Liquibase", "4.13.0") {
library("Liquibase", "4.16.0") {
group("org.liquibase") {
modules = [
"liquibase-cdi",

Loading…
Cancel
Save