Skip to content

Commit 95ac342

Browse files
Add debug logging to migrator. (#7381)
1 parent 6e4cca8 commit 95ac342

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/HapiMigrator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ private void recordTaskAsCompletedIfNotDryRun(BaseTask theNext, long theExecutio
246246

247247
public void addTasks(Iterable<BaseTask> theMigrationTasks) {
248248
if (HapiSystemProperties.isUnitTestModeEnabled()) {
249+
ourLog.info("Skipping tasks because unit test mode is enabled");
249250
// Tests only need to initialize the schemas. No need to run all the migrations for every test.
250251
for (BaseTask task : theMigrationTasks) {
251252
if (task instanceof InitializeSchemaTask) {

hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTask.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,9 @@ private int doExecuteSql(@Language("SQL") String theSql, Object... theArguments)
217217
} catch (DataAccessException e) {
218218
if (myFlags.contains(TaskFlagEnum.FAILURE_ALLOWED)) {
219219
ourLog.info(
220-
"Task {} did not exit successfully on doExecuteSql(), but task is allowed to fail",
221-
getMigrationVersion());
220+
"Task {} running sql \"{}\"did not exit successfully on doExecuteSql(), but task is allowed to fail",
221+
getMigrationVersion(),
222+
theSql);
222223
ourLog.debug("Error was: {}", e.getMessage(), e);
223224
myExecutionResult = MigrationTaskExecutionResultEnum.NOT_APPLIED_ALLOWED_FAILURE;
224225
return 0;
@@ -334,7 +335,7 @@ public final int hashCode() {
334335

335336
@Override
336337
public final boolean equals(Object theObject) {
337-
if (theObject == null || getClass().equals(theObject.getClass()) == false) {
338+
if (theObject == null || !getClass().equals(theObject.getClass())) {
338339
return false;
339340
}
340341
BaseTask otherObject = (BaseTask) theObject;

0 commit comments

Comments
 (0)