diff --git a/src/main/java/com/manticore/h2/H2MigrationTool.java b/src/main/java/com/manticore/h2/H2MigrationTool.java index dc82408..235aad1 100644 --- a/src/main/java/com/manticore/h2/H2MigrationTool.java +++ b/src/main/java/com/manticore/h2/H2MigrationTool.java @@ -550,7 +550,7 @@ public void run() { if (versionFrom != null && versionFrom.length() > 1) { app.migrate(versionFrom, versionTo, databaseFileName, user, password, scriptFileName, - compression, upgradeOptions, overwrite, force, null); + compression, upgradeOptions, overwrite, force, ""); } else { app.migrateAuto(versionTo, databaseFileName, user, password, scriptFileName, compression, @@ -660,7 +660,7 @@ public ScriptResult writeScript(DriverRecord driverRecord, String databaseFileNa properties.setProperty("password", password); Driver driver = loadDriver(driverRecord); try (Connection connection = driver.connect( - "jdbc:h2:" + databaseFileName + ";ACCESS_MODE_DATA=r" + connectionParameters, + "jdbc:h2:" + databaseFileName + ";ACCESS_MODE_DATA=r" + Objects.requireNonNull(connectionParameters), properties)) { List commands = executeHooks(connection, HookStage.IMPORT); executeHooks(connection, HookStage.EXPORT); @@ -835,7 +835,7 @@ public ScriptResult migrate(String versionFrom, String versionTo, String databas scriptResult = writeScript(driverRecordFrom, modifiedDatabaseFileName, user, password, - modifiedScriptFileName, modifiedCompression, connectionParameters); + modifiedScriptFileName, modifiedCompression, Objects.requireNonNull(connectionParameters)); modifiedScriptFileName = scriptResult.scriptFileName; commands.addAll(scriptResult.commands); @@ -894,16 +894,16 @@ public ScriptResult migrate(String versionFrom, String versionTo, String databas } String options = - modifiedCompression != null && modifiedCompression.length() > 0 + modifiedCompression != null && !modifiedCompression.isEmpty() ? modifiedCompression + " " + upgradeOptions : upgradeOptions; if (success) { try { - scriptResult = createFromScript(driverRecordTo, databaseFileName, user, password, - modifiedScriptFileName, options, commands, force, connectionParameters); - modifiedDatabaseFileName = databaseFileName + "." + driverRecordTo.patchId - + (!driverRecordTo.buildId.isEmpty() ? ("-" + driverRecordTo.buildId) : ""); + scriptResult = createFromScript(driverRecordTo, modifiedDatabaseFileName, user, password, + modifiedScriptFileName, options, commands, force, Objects.requireNonNull(connectionParameters)); + modifiedDatabaseFileName = modifiedDatabaseFileName + "." + driverRecordTo.patchId + + (!driverRecordTo.buildId.isEmpty() ? ("-" + driverRecordTo.buildId) : "") + ".mv.db"; LOGGER.info("Created new " + driverRecordTo + " database: " @@ -1024,14 +1024,14 @@ public boolean accept(File dir, String name) { } String options = - compression != null && compression.length() > 0 + compression != null && !compression.isEmpty() ? compression + " " + upgradeOptions : upgradeOptions; if (success) { try { ScriptResult scriptResult = createFromScript(driverRecordTo, databaseName, user, password, - modifiedScriptFileName, options, commands, force, null); + modifiedScriptFileName, options, commands, force, ""); databaseName = scriptResult.scriptFileName; LOGGER.info("Created new " + driverRecordTo + " database: " diff --git a/src/main/resources/drivers/h2-2.2.229-SNAPSHOT.bin b/src/main/resources/drivers/h2-2.2.229-SNAPSHOT.bin index a6ee3cf..5f4c06c 100644 Binary files a/src/main/resources/drivers/h2-2.2.229-SNAPSHOT.bin and b/src/main/resources/drivers/h2-2.2.229-SNAPSHOT.bin differ