From 2f501fcbe5ee8867a6ab98d7568a1c2694f58d40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Korn=C3=A9l=20T=C3=B6r=C3=B6k?= Date: Tue, 29 Mar 2022 17:32:21 +0200 Subject: [PATCH] NIFI-9836: fix database selection during nifi registry startup (#5907) --- .../apache/nifi/registry/db/CustomFlywayConfiguration.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nifi-registry/nifi-registry-core/nifi-registry-framework/src/main/java/org/apache/nifi/registry/db/CustomFlywayConfiguration.java b/nifi-registry/nifi-registry-core/nifi-registry-framework/src/main/java/org/apache/nifi/registry/db/CustomFlywayConfiguration.java index f473ef6708..4fc2694c2d 100644 --- a/nifi-registry/nifi-registry-core/nifi-registry-framework/src/main/java/org/apache/nifi/registry/db/CustomFlywayConfiguration.java +++ b/nifi-registry/nifi-registry-core/nifi-registry-framework/src/main/java/org/apache/nifi/registry/db/CustomFlywayConfiguration.java @@ -58,10 +58,10 @@ public class CustomFlywayConfiguration implements FlywayConfigurationCustomizer final DatabaseType databaseType = getDatabaseType(configuration.getDataSource()); LOGGER.info("Determined database type is {}", databaseType.getName()); - if (databaseType.equals(new MySQLDatabaseType())) { + if (databaseType instanceof MySQLDatabaseType) { LOGGER.info("Setting migration locations to {}", Arrays.asList(LOCATIONS_MYSQL)); configuration.locations(LOCATIONS_MYSQL); - } else if (databaseType.equals(new PostgreSQLDatabaseType())) { + } else if (databaseType instanceof PostgreSQLDatabaseType) { LOGGER.info("Setting migration locations to {}", Arrays.asList(LOCATIONS_POSTGRES)); configuration.locations(LOCATIONS_POSTGRES); } else {