Merge pull request #1257 from stianst/master

KEYCLOAK-1310 Don't log migration model for fresh instal
This commit is contained in:
Stian Thorgersen 2015-05-13 11:17:55 +02:00
commit 15310d1e97
2 changed files with 6 additions and 6 deletions

View file

@ -16,16 +16,15 @@ public class MigrationModelManager {
String storedVersion = model.getStoredVersion(); String storedVersion = model.getStoredVersion();
if (MigrationModel.LATEST_VERSION.equals(storedVersion)) return; if (MigrationModel.LATEST_VERSION.equals(storedVersion)) return;
ModelVersion stored = null; ModelVersion stored = null;
if (storedVersion == null) stored = new ModelVersion(0, 0, 0); if (storedVersion != null) new ModelVersion(storedVersion);
else stored = new ModelVersion(storedVersion);
if (stored.lessThan(MigrationTo1_2_0_CR1.VERSION)) { if (stored == null || stored.lessThan(MigrationTo1_2_0_CR1.VERSION)) {
logger.info("Migrating older model to 1.2.0.RC1 updates"); if (stored != null) {
logger.debug("Migrating older model to 1.2.0.RC1 updates");
}
new MigrationTo1_2_0_CR1().migrate(session); new MigrationTo1_2_0_CR1().migrate(session);
} }
model.setStoredVersion(MigrationModel.LATEST_VERSION); model.setStoredVersion(MigrationModel.LATEST_VERSION);
} }
} }

View file

@ -18,6 +18,7 @@ log4j.logger.org.keycloak=info
# log4j.logger.org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider=debug # log4j.logger.org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider=debug
# log4j.logger.org.keycloak.connections.mongo.updater.DefaultMongoUpdaterProvider=debug # log4j.logger.org.keycloak.connections.mongo.updater.DefaultMongoUpdaterProvider=debug
# log4j.logger.org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory=debug # log4j.logger.org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory=debug
# log4j.logger.org.keycloak.migration.MigrationModelManager=debug
# Enable to view kerberos/spnego logging # Enable to view kerberos/spnego logging
# log4j.logger.org.keycloak.broker.kerberos=trace # log4j.logger.org.keycloak.broker.kerberos=trace