This is an automated email from the ASF dual-hosted git repository.
thenatog pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new 3a15d4fbe5 NIFI-9950 Identify MariaDB database type and use MySQL
migration scripts
3a15d4fbe5 is described below
commit 3a15d4fbe5c35a4c5adcf1e1046a37cfd8c12b89
Author: Bryan Bende <[email protected]>
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 <[email protected]>
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 6a18176ae0..76eb5cf949 100644
--- a/nifi-registry/nifi-registry-core/pom.xml
+++ b/nifi-registry/nifi-registry-core/pom.xml
@@ -182,6 +182,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>