From afaa4a6498cc86a1740fa6ad52057d5c252956c6 Mon Sep 17 00:00:00 2001 From: "robin.bygrave" Date: Wed, 1 Nov 2023 13:26:08 +1300 Subject: [PATCH] Update logging message text and MigrationMetaRow.toString() --- .../main/java/io/ebean/migration/runner/MigrationMetaRow.java | 2 +- .../main/java/io/ebean/migration/runner/MigrationTable.java | 4 ++-- ebean-migration/src/test/resources/logback-test.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ebean-migration/src/main/java/io/ebean/migration/runner/MigrationMetaRow.java b/ebean-migration/src/main/java/io/ebean/migration/runner/MigrationMetaRow.java index 0f1a5c0..931ae9f 100644 --- a/ebean-migration/src/main/java/io/ebean/migration/runner/MigrationMetaRow.java +++ b/ebean-migration/src/main/java/io/ebean/migration/runner/MigrationMetaRow.java @@ -52,7 +52,7 @@ final class MigrationMetaRow { @Override public String toString() { - return "id:" + id + " type:" + type + " runVersion:" + version + " comment:" + comment + " runOn:" + runOn + " runBy:" + runBy; + return "id:" + id + " type:" + type + " checksum:" + checksum + " runVersion:" + version + " comment:" + comment + " runOn:" + runOn + " runBy:" + runBy; } /** diff --git a/ebean-migration/src/main/java/io/ebean/migration/runner/MigrationTable.java b/ebean-migration/src/main/java/io/ebean/migration/runner/MigrationTable.java index 110168f..f030fe0 100644 --- a/ebean-migration/src/main/java/io/ebean/migration/runner/MigrationTable.java +++ b/ebean-migration/src/main/java/io/ebean/migration/runner/MigrationTable.java @@ -351,7 +351,7 @@ boolean skipMigration(int checksum, int checksum2, LocalMigrationResource local, } else if (patchLegacyChecksums && existing.checksum() == checksum2) { if (!checkStateOnly) { - log.log(INFO, "Patch migration, set earlyChecksumMode on {0}", local.location()); + log.log(INFO, "Patch migration, set early mode checksum on {0}", local.location()); existing.resetChecksum(checksum, connection, updateChecksumSql); } return true; @@ -479,7 +479,7 @@ private String convertScript(String script) { private void addMigration(String key, MigrationMetaRow metaRow) { if (INIT_VER_0.equals(key)) { if (metaRow.checksum() == EARLY_MODE_CHECKSUM && !earlyChecksumMode) { - throw new IllegalStateException(" 0 db migration row has unexpected checksum value? " + metaRow); + throw new IllegalStateException("Unexpected checksum value on row " + metaRow); } initMetaRow = metaRow; patchLegacyChecksums = earlyChecksumMode && metaRow.checksum() == LEGACY_MODE_CHECKSUM; diff --git a/ebean-migration/src/test/resources/logback-test.xml b/ebean-migration/src/test/resources/logback-test.xml index a352492..a227835 100644 --- a/ebean-migration/src/test/resources/logback-test.xml +++ b/ebean-migration/src/test/resources/logback-test.xml @@ -8,7 +8,7 @@ - +