not sure this is going to work yet
This commit is contained in:
parent
da54d3443e
commit
5f30bdb27b
|
@ -21,6 +21,7 @@ package ca.uhn.fhir.jpa.migrate;
|
|||
*/
|
||||
|
||||
import ca.uhn.fhir.jpa.migrate.taskdef.BaseTask;
|
||||
import ca.uhn.fhir.jpa.migrate.taskdef.InitializeSchemaTask;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import org.flywaydb.core.Flyway;
|
||||
import org.flywaydb.core.api.MigrationInfoService;
|
||||
|
@ -85,8 +86,12 @@ public class FlywayMigrator extends BaseMigrator {
|
|||
|
||||
@Override
|
||||
public void addTasks(List<BaseTask> theTasks) {
|
||||
if ("true".equals(System.getProperty("unit_test_mode"))) {
|
||||
theTasks.stream().filter(task -> task instanceof InitializeSchemaTask).forEach(this::addTask);
|
||||
} else {
|
||||
theTasks.forEach(this::addTask);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<MigrationInfoService> getMigrationInfo() {
|
||||
|
|
|
@ -108,7 +108,9 @@ public abstract class BaseTask<T extends BaseTask> {
|
|||
JdbcTemplate jdbcTemplate = getConnectionProperties().newJdbcTemplate();
|
||||
try {
|
||||
int changesCount = jdbcTemplate.update(theSql, theArguments);
|
||||
if (!"true".equals(System.getProperty("unit_test_mode"))) {
|
||||
logInfo(ourLog, "SQL \"{}\" returned {}", theSql, changesCount);
|
||||
}
|
||||
return changesCount;
|
||||
} catch (DataAccessException e) {
|
||||
if (myFailureAllowed) {
|
||||
|
|
Loading…
Reference in New Issue