Skip to content

Commit

Permalink
Revert "[26167] do not show db update ui for system property db config"
Browse files Browse the repository at this point in the history
This reverts commit 5e80a6f.
  • Loading branch information
huthomas committed Feb 27, 2024
1 parent ae30a00 commit da00a07
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
import org.slf4j.LoggerFactory;

import ch.elexis.core.constants.ElexisSystemPropertyConstants;
import ch.elexis.core.l10n.Messages;
import ch.elexis.core.jpa.entitymanager.ui.IDatabaseUpdateUi;
import ch.elexis.core.jpa.liquibase.LiquibaseDBInitializer;
import ch.elexis.core.jpa.liquibase.LiquibaseDBScriptExecutor;
import ch.elexis.core.jpa.liquibase.LiquibaseDBUpdater;
import ch.elexis.core.l10n.Messages;
import ch.elexis.core.services.IElexisEntityManager;
import ch.elexis.core.utils.CoreUtil;

Expand Down Expand Up @@ -102,8 +102,9 @@ public synchronized EntityManager getEntityManager(boolean managed) {
if (factory == null) {
// try to initialize
if (factoryBuilder != null) {

if (!SKIP_LIQUIBASE) {
if (updateProgress != null && !isSystemPropertyDBConfig()) {
if (updateProgress != null) {
try {
updateProgress.executeWithProgress(Messages.ElexisEntityManger_Database_Init, () -> {
dbInit(updateProgress);
Expand Down Expand Up @@ -156,12 +157,6 @@ public synchronized EntityManager getEntityManager(boolean managed) {
}
}

private boolean isSystemPropertyDBConfig() {
String prop_dbUser = System.getProperty(ElexisSystemPropertyConstants.CONN_DB_USERNAME);
String prop_dbConnSpec = System.getProperty(ElexisSystemPropertyConstants.CONN_DB_SPEC);
return prop_dbUser != null && prop_dbConnSpec != null;
}

private void dbUpdate(IDatabaseUpdateUi updateProgress2) {
LiquibaseDBUpdater updater = new LiquibaseDBUpdater(dataSource, updateProgress);
updateSuccess = updater.update();
Expand Down

0 comments on commit da00a07

Please sign in to comment.