From 38af401a16c1647314d9957d1793b8d58f668e08 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Wed, 13 May 2015 11:16:30 +0200 Subject: [PATCH] KEYCLOAK-1310 Don't log migration model for fresh instal --- .../org/keycloak/migration/MigrationModelManager.java | 11 +++++------ .../integration/src/test/resources/log4j.properties | 1 + 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/model/api/src/main/java/org/keycloak/migration/MigrationModelManager.java b/model/api/src/main/java/org/keycloak/migration/MigrationModelManager.java index a0e5959091..62dcd68dd5 100755 --- a/model/api/src/main/java/org/keycloak/migration/MigrationModelManager.java +++ b/model/api/src/main/java/org/keycloak/migration/MigrationModelManager.java @@ -16,16 +16,15 @@ public class MigrationModelManager { String storedVersion = model.getStoredVersion(); if (MigrationModel.LATEST_VERSION.equals(storedVersion)) return; ModelVersion stored = null; - if (storedVersion == null) stored = new ModelVersion(0, 0, 0); - else stored = new ModelVersion(storedVersion); + if (storedVersion != null) new ModelVersion(storedVersion); - if (stored.lessThan(MigrationTo1_2_0_CR1.VERSION)) { - logger.info("Migrating older model to 1.2.0.RC1 updates"); + if (stored == null || stored.lessThan(MigrationTo1_2_0_CR1.VERSION)) { + if (stored != null) { + logger.debug("Migrating older model to 1.2.0.RC1 updates"); + } new MigrationTo1_2_0_CR1().migrate(session); } model.setStoredVersion(MigrationModel.LATEST_VERSION); - - } } diff --git a/testsuite/integration/src/test/resources/log4j.properties b/testsuite/integration/src/test/resources/log4j.properties index d94d2f9c74..a776341146 100755 --- a/testsuite/integration/src/test/resources/log4j.properties +++ b/testsuite/integration/src/test/resources/log4j.properties @@ -18,6 +18,7 @@ log4j.logger.org.keycloak=info # log4j.logger.org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider=debug # log4j.logger.org.keycloak.connections.mongo.updater.DefaultMongoUpdaterProvider=debug # log4j.logger.org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory=debug +# log4j.logger.org.keycloak.migration.MigrationModelManager=debug # Enable to view kerberos/spnego logging # log4j.logger.org.keycloak.broker.kerberos=trace