use MariaDB ConnectorJ instead of Drizzle MySQL JDBC driver -only- during build for Flyway (fixes FINERACT-761)
This commit is contained in:
@@ -424,14 +424,26 @@ buildscript {
|
||||
|
||||
dependencies {
|
||||
classpath "org.flywaydb:flyway-gradle-plugin:3.0" // version upgraded during Spring Boot & MariaDB4j work, as prev. used v0.2 didn't work well after *.sql moved from fineract-db to fineract-provider/src/main/resources (new version also has clearer errors, e.g. in case of missing DB)
|
||||
classpath 'org.drizzle.jdbc:drizzle-jdbc:1.3'
|
||||
|
||||
// NOT classpath 'org.drizzle.jdbc:drizzle-jdbc:1.3' as it is not compatible with Flyway 3.1+ (only up to 3.0)
|
||||
// We require Flyway 3.1+ because =< 3.0 is not compatible with current Gradle versions (only ancient ones we originally used to use).
|
||||
// Using LGPL ConnectorJ ()org.mariadb.jdbc:mariadb-java-client) instead of the BSD licensed drizzle-jdbc *IS OK* at Apache.org,
|
||||
// as long as it's only used as a test library by developers at build time, and not end-user distributed, and optional.
|
||||
// So it's OK here, but would not be as a default runtime dependency and in the dist JAR/WAR.
|
||||
// see https://issues.apache.org/jira/browse/LEGAL-462
|
||||
// see https://issues.apache.org/jira/browse/FINERACT-761
|
||||
// see https://github.com/flyway/flyway/issues/2332
|
||||
// see https://github.com/krummas/DrizzleJDBC/issues/46
|
||||
// see https://github.com/apache/fineract/pull/525
|
||||
// see https://github.com/apache/fineract/pull/550
|
||||
classpath 'org.mariadb.jdbc:mariadb-java-client:2.4.1'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
flyway {
|
||||
url = "jdbc:mysql:thin://localhost:3306/mifostenant-default"
|
||||
driver = "org.drizzle.jdbc.DrizzleDriver"
|
||||
url = "jdbc:mariadb://localhost:3306/mifostenant-default"
|
||||
driver = "org.mariadb.jdbc.Driver"
|
||||
user = mysqlUser
|
||||
password = mysqlPassword
|
||||
}
|
||||
@@ -445,8 +457,8 @@ task migrateTenantDB<<{
|
||||
tenantDbName = rootProject.getProperty("dbName")
|
||||
}
|
||||
|
||||
flyway.url= "jdbc:mysql:thin://localhost:3306/$tenantDbName"
|
||||
flyway.driver = "org.drizzle.jdbc.DrizzleDriver"
|
||||
flyway.url= "jdbc:mariadb://localhost:3306/$tenantDbName"
|
||||
flyway.driver = "org.mariadb.jdbc.Driver"
|
||||
flyway.locations= [filePath]
|
||||
/**We use ${ as the prefix for strecthy reporting, do not want them to be interpreted by Flyway**/
|
||||
flyway.placeholderPrefix = "\$\${"
|
||||
@@ -462,8 +474,8 @@ task showTenantDBInfo<<{
|
||||
tenantDbName = rootProject.getProperty("dbName")
|
||||
}
|
||||
|
||||
flyway.url= "jdbc:mysql:thin://localhost:3306/$tenantDbName"
|
||||
flyway.driver = "org.drizzle.jdbc.DrizzleDriver"
|
||||
flyway.url= "jdbc:mariadb://localhost:3306/$tenantDbName"
|
||||
flyway.driver = "org.mariadb.jdbc.Driver"
|
||||
flyway.locations= [filePath]
|
||||
flywayInfo.execute()
|
||||
}
|
||||
@@ -478,8 +490,8 @@ task migrateTenantListDB<<{
|
||||
tenantsDbName = rootProject.getProperty("dbName")
|
||||
}
|
||||
|
||||
flyway.url= "jdbc:mysql:thin://localhost:3306/$tenantsDbName"
|
||||
flyway.driver = "org.drizzle.jdbc.DrizzleDriver"
|
||||
flyway.url= "jdbc:mariadb://localhost:3306/$tenantsDbName"
|
||||
flyway.driver = "org.mariadb.jdbc.Driver"
|
||||
flyway.locations= [filePath]
|
||||
|
||||
flywayMigrate.execute()
|
||||
@@ -494,8 +506,8 @@ task showTenantListDBInfo<<{
|
||||
tenantsDbName = rootProject.getProperty("dbName")
|
||||
}
|
||||
|
||||
flyway.url= "jdbc:mysql:thin://localhost:3306/$tenantsDbName"
|
||||
flyway.driver = "org.drizzle.jdbc.DrizzleDriver"
|
||||
flyway.url= "jdbc:mariadb://localhost:3306/$tenantsDbName"
|
||||
flyway.driver = "org.mariadb.jdbc.Driver"
|
||||
flyway.locations= [filePath]
|
||||
flywayInfo.execute()
|
||||
}
|
||||
@@ -509,8 +521,8 @@ task repairTenantDB<<{
|
||||
tenantsDbName = rootProject.getProperty("dbName")
|
||||
}
|
||||
|
||||
flyway.url= "jdbc:mysql:thin://localhost:3306/$tenantsDbName"
|
||||
flyway.driver = "org.drizzle.jdbc.DrizzleDriver"
|
||||
flyway.url= "jdbc:mariadb://localhost:3306/$tenantsDbName"
|
||||
flyway.driver = "org.mariadb.jdbc.Driver"
|
||||
flyway.locations= [filePath]
|
||||
flywayRepair.execute()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user