You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by jo...@apache.org on 2022/04/22 15:21:54 UTC

[nifi] 02/02: NIFI-9950 Identify MariaDB database type and use MySQL migration scripts

This is an automated email from the ASF dual-hosted git repository.

joewitt pushed a commit to branch support/nifi-1.16
in repository https://gitbox.apache.org/repos/asf/nifi.git

commit 5d73f05103318a4c3315720ced48929a3c010cb8
Author: Bryan Bende <bb...@gmail.com>
AuthorDate: Thu Apr 21 15:35:48 2022 -0400

    NIFI-9950 Identify MariaDB database type and use MySQL migration scripts
    
    Signed-off-by: Nathan Gough <th...@gmail.com>
    
    This closes 5989.
---
 .../registry/db/CustomFlywayConfiguration.java     |  3 ++-
 nifi-registry/nifi-registry-core/pom.xml           | 26 ++++++++++++++++++++++
 2 files changed, 28 insertions(+), 1 deletion(-)

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 4fc2694c2d..42e2946b70 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
@@ -23,6 +23,7 @@ import org.flywaydb.core.internal.database.DatabaseTypeRegister;
 import org.flywaydb.core.internal.database.postgresql.PostgreSQLDatabaseType;
 import org.flywaydb.core.internal.jdbc.JdbcUtils;
 import org.flywaydb.database.mysql.MySQLDatabaseType;
+import org.flywaydb.database.mysql.mariadb.MariaDBDatabaseType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.boot.autoconfigure.flyway.FlywayConfigurationCustomizer;
@@ -58,7 +59,7 @@ public class CustomFlywayConfiguration implements FlywayConfigurationCustomizer
         final DatabaseType databaseType = getDatabaseType(configuration.getDataSource());
         LOGGER.info("Determined database type is {}", databaseType.getName());
 
-        if (databaseType instanceof MySQLDatabaseType) {
+        if (databaseType instanceof MySQLDatabaseType || databaseType instanceof MariaDBDatabaseType) {
             LOGGER.info("Setting migration locations to {}", Arrays.asList(LOCATIONS_MYSQL));
             configuration.locations(LOCATIONS_MYSQL);
         } else if (databaseType instanceof PostgreSQLDatabaseType) {
diff --git a/nifi-registry/nifi-registry-core/pom.xml b/nifi-registry/nifi-registry-core/pom.xml
index 5fb211babb..12f0305949 100644
--- a/nifi-registry/nifi-registry-core/pom.xml
+++ b/nifi-registry/nifi-registry-core/pom.xml
@@ -184,6 +184,32 @@
                                     </systemPropertyVariables>
                                 </configuration>
                             </execution>
+                            <execution>
+                                <id>mariadb-10_2-test</id>
+                                <phase>verify</phase>
+                                <goals>
+                                    <goal>integration-test</goal>
+                                    <goal>verify</goal>
+                                </goals>
+                                <configuration>
+                                    <systemPropertyVariables>
+                                        <spring.profiles.active>mariadb-10-2</spring.profiles.active>
+                                    </systemPropertyVariables>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>mariadb-10_3-test</id>
+                                <phase>verify</phase>
+                                <goals>
+                                    <goal>integration-test</goal>
+                                    <goal>verify</goal>
+                                </goals>
+                                <configuration>
+                                    <systemPropertyVariables>
+                                        <spring.profiles.active>mariadb-10-3</spring.profiles.active>
+                                    </systemPropertyVariables>
+                                </configuration>
+                            </execution>
                             <execution>
                                 <id>postgres10-test</id>
                                 <phase>verify</phase>