RED-8702: Explore document databases to store entityLog
* fix pmd and checkstyle
This commit is contained in:
parent
fc9a014395
commit
d4d84c6ac2
@ -20,6 +20,7 @@ import liquibase.integration.spring.SpringLiquibase;
|
|||||||
import liquibase.integration.spring.SpringResourceAccessor;
|
import liquibase.integration.spring.SpringResourceAccessor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import lombok.SneakyThrows;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@ -27,6 +28,7 @@ public class MongoSpringLiquibase extends SpringLiquibase {
|
|||||||
|
|
||||||
protected Database database;
|
protected Database database;
|
||||||
|
|
||||||
|
|
||||||
public MongoSpringLiquibase() {
|
public MongoSpringLiquibase() {
|
||||||
|
|
||||||
super();
|
super();
|
||||||
@ -63,8 +65,8 @@ public class MongoSpringLiquibase extends SpringLiquibase {
|
|||||||
|
|
||||||
if (rollbackFile != null) {
|
if (rollbackFile != null) {
|
||||||
|
|
||||||
try (final OutputStream outputStream = Files.newOutputStream(rollbackFile.toPath()); Writer output = new OutputStreamWriter(outputStream,
|
try (OutputStream outputStream = Files.newOutputStream(rollbackFile.toPath()); Writer output = new OutputStreamWriter(outputStream,
|
||||||
GlobalConfiguration.OUTPUT_FILE_ENCODING.getCurrentValue())) {
|
GlobalConfiguration.OUTPUT_FILE_ENCODING.getCurrentValue())) {
|
||||||
|
|
||||||
if (tag != null) {
|
if (tag != null) {
|
||||||
liquibase.futureRollbackSQL(tag, new Contexts(getContexts()), new LabelExpression(getLabelFilter()), output);
|
liquibase.futureRollbackSQL(tag, new Contexts(getContexts()), new LabelExpression(getLabelFilter()), output);
|
||||||
@ -79,18 +81,21 @@ public class MongoSpringLiquibase extends SpringLiquibase {
|
|||||||
|
|
||||||
|
|
||||||
@SuppressWarnings("squid:S2095")
|
@SuppressWarnings("squid:S2095")
|
||||||
protected Liquibase createLiquibase(Database db) throws LiquibaseException {
|
@SneakyThrows
|
||||||
|
protected Liquibase createLiquibase(Database db) {
|
||||||
|
|
||||||
SpringResourceAccessor resourceAccessor = createResourceOpener();
|
Liquibase liquibase;
|
||||||
Liquibase liquibase = new Liquibase(getChangeLog(), resourceAccessor, db);
|
try (SpringResourceAccessor resourceAccessor = createResourceOpener()) {
|
||||||
if (parameters != null) {
|
liquibase = new Liquibase(getChangeLog(), resourceAccessor, db);
|
||||||
for (Map.Entry<String, String> entry : parameters.entrySet()) {
|
if (parameters != null) {
|
||||||
liquibase.setChangeLogParameter(entry.getKey(), entry.getValue());
|
for (Map.Entry<String, String> entry : parameters.entrySet()) {
|
||||||
|
liquibase.setChangeLogParameter(entry.getKey(), entry.getValue());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (isDropFirst()) {
|
if (isDropFirst()) {
|
||||||
liquibase.dropAll();
|
liquibase.dropAll();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return liquibase;
|
return liquibase;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user