fix gradle createDB/dropDB/setBlankPassword

which broke during the Gradle upgrade in FINERACT-700

do not fix Flyway related migrateTenantDB & Co, as those
are proposed to be removed in FINERACT-765 anyway.  (If really
needed, some of my other WIP branches have the required changes
to make the Flyway related tasks work.)
This commit is contained in:
Michael Vorburger.ch
2019-07-09 10:04:03 +02:00
parent 6f58b30fd8
commit b54a11da9b
+3 -3
View File
@@ -399,7 +399,7 @@ configurations.driver.each {File file ->
task createDB { task createDB {
description= "Creates the Database. Needs database name to be passed (like: -PdbName=someDBname)" description= "Creates the Database. Needs database name to be passed (like: -PdbName=someDBname)"
doLast { doLast {
sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' ) def sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' )
sql.execute( 'create database '+"`$dbName`" ) sql.execute( 'create database '+"`$dbName`" )
} }
} }
@@ -407,13 +407,13 @@ task createDB {
task dropDB { task dropDB {
description= "Drops the specified database. The database name has to be passed (like: -PdbName=someDBname)" description= "Drops the specified database. The database name has to be passed (like: -PdbName=someDBname)"
doLast { doLast {
sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' ) def sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' )
sql.execute( 'DROP DATABASE '+"`$dbName`") sql.execute( 'DROP DATABASE '+"`$dbName`")
} }
} }
task setBlankPassword { task setBlankPassword {
doLast { doLast {
sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' ) def sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' )
sql.execute('USE `mifosplatform-tenants`') sql.execute('USE `mifosplatform-tenants`')
sql.execute('UPDATE mifosplatform-tenants.tenants SET schema_server = \'localhost\', schema_server_port = \'3306\', schema_username = \'mifos\', schema_password = \'mysql\' WHERE id=1;') sql.execute('UPDATE mifosplatform-tenants.tenants SET schema_server = \'localhost\', schema_server_port = \'3306\', schema_username = \'mifos\', schema_password = \'mysql\' WHERE id=1;')
} }