updated java depenencies
This commit is contained in:
1 parent
fa45c13482
commit
c3bf752a57
10 files changed
+31
-21
No files matched your search
@@ -14,7 +14,7 @@
|
||||
|
||||
<properties>
|
||||
<main.basedir>${project.parent.basedir}</main.basedir>
|
||||
<database.driver>com.mysql.jdbc.Driver</database.driver>
|
||||
<database.driver>com.mysql.cj.jdbc.Driver</database.driver>
|
||||
</properties>
|
||||
|
||||
<reporting>
|
||||
|
||||
+14
@@ -49,6 +49,20 @@ public class MigrationItem {
|
||||
public int qtyPending() {
|
||||
return pendingMigrations.length;
|
||||
}
|
||||
|
||||
public void repair() {
|
||||
//Perform a repair just in case an upgrade before 5.0 happens
|
||||
try {
|
||||
//TODO find a better way to perform repair if previous version was before 5.0
|
||||
String schemas = Arrays.toString(getSchemas()).replace("[", "").replace("]", "");
|
||||
logger.info(String.format("Repair status for %s:%n%s", schemas, getAllMigrationsLog()));
|
||||
flyway.repair();
|
||||
} catch (Exception e) {
|
||||
String message = String.format("%nDatabase repair error:%n %s %nPortal webapp cannot continue.", e.getMessage());
|
||||
logger.error(message);
|
||||
throw new RuntimeException(message, e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform the migration
|
||||
|
||||
+4
-1
@@ -40,7 +40,10 @@ public class MigrationManager {
|
||||
|
||||
DataSource ds = portalDatasource.getPortalRootDataSource();
|
||||
migrations = Utils.toList( new MigrationItem(PortalMigration.getFlyway(ds)) );
|
||||
migrations.forEach(item -> item.migrate());
|
||||
migrations.forEach(item -> {
|
||||
item.repair();
|
||||
item.migrate();
|
||||
});
|
||||
portalDatasource.closeRootDataSource();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user