make sure we clean any existing file before starting

This commit is contained in:
Athou
2024-02-09 18:32:43 +01:00
parent bda3ba4b5c
commit 0bf44dbc7b

View File

@@ -58,6 +58,10 @@ public class H2MigrationService {
Path newVersionPath = path.resolveSibling(path.getFileName() + "." + getPatchVersion(toVersion) + ".mv.db");
Path oldVersionBackupPath = path.resolveSibling(path.getFileName() + "." + getPatchVersion(fromVersion) + ".backup");
Files.deleteIfExists(scriptPath);
Files.deleteIfExists(newVersionPath);
Files.deleteIfExists(oldVersionBackupPath);
H2MigrationTool.readDriverRecords();
new H2MigrationTool().migrate(fromVersion, toVersion, path.toAbsolutePath().toString(), user, password,
scriptPath.toAbsolutePath().toString(), "", "", false, false, "");