|
|
@ -19,6 +19,8 @@ package org.springframework.boot.autoconfigure.flyway;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.File;
|
|
|
|
import java.nio.charset.Charset;
|
|
|
|
import java.nio.charset.Charset;
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
|
|
|
|
import java.time.Duration;
|
|
|
|
|
|
|
|
import java.time.temporal.ChronoUnit;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Collections;
|
|
|
|
import java.util.Collections;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashMap;
|
|
|
@ -27,6 +29,7 @@ import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
|
|
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
|
|
|
|
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
|
|
|
|
|
|
|
|
import org.springframework.boot.convert.DurationUnit;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Configuration properties for Flyway database migrations.
|
|
|
|
* Configuration properties for Flyway database migrations.
|
|
|
@ -73,6 +76,13 @@ public class FlywayProperties {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private int connectRetries;
|
|
|
|
private int connectRetries;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Maximum time between retries when attempting to connect to the database. If a
|
|
|
|
|
|
|
|
* duration suffix is not specified, seconds will be used.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@DurationUnit(ChronoUnit.SECONDS)
|
|
|
|
|
|
|
|
private Duration connectRetriesInterval;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Maximum number of retries when trying to obtain a lock.
|
|
|
|
* Maximum number of retries when trying to obtain a lock.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -365,6 +375,16 @@ public class FlywayProperties {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private String stateScriptPrefix;
|
|
|
|
private String stateScriptPrefix;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Prefix of placeholders in migration scripts.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private String scriptPlaceholderPrefix;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Suffix of placeholders in migration scripts.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private String scriptPlaceholderSuffix;
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isEnabled() {
|
|
|
|
public boolean isEnabled() {
|
|
|
|
return this.enabled;
|
|
|
|
return this.enabled;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -417,6 +437,14 @@ public class FlywayProperties {
|
|
|
|
this.connectRetries = connectRetries;
|
|
|
|
this.connectRetries = connectRetries;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Duration getConnectRetriesInterval() {
|
|
|
|
|
|
|
|
return this.connectRetriesInterval;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setConnectRetriesInterval(Duration connectRetriesInterval) {
|
|
|
|
|
|
|
|
this.connectRetriesInterval = connectRetriesInterval;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Integer getLockRetryCount() {
|
|
|
|
public Integer getLockRetryCount() {
|
|
|
|
return this.lockRetryCount;
|
|
|
|
return this.lockRetryCount;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -868,4 +896,20 @@ public class FlywayProperties {
|
|
|
|
this.stateScriptPrefix = stateScriptPrefix;
|
|
|
|
this.stateScriptPrefix = stateScriptPrefix;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String getScriptPlaceholderPrefix() {
|
|
|
|
|
|
|
|
return this.scriptPlaceholderPrefix;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setScriptPlaceholderPrefix(String scriptPlaceholderPrefix) {
|
|
|
|
|
|
|
|
this.scriptPlaceholderPrefix = scriptPlaceholderPrefix;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String getScriptPlaceholderSuffix() {
|
|
|
|
|
|
|
|
return this.scriptPlaceholderSuffix;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setScriptPlaceholderSuffix(String scriptPlaceholderSuffix) {
|
|
|
|
|
|
|
|
this.scriptPlaceholderSuffix = scriptPlaceholderSuffix;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|