Package org.dspace.storage.rdbms
Class FlywayUpgradeUtils
- java.lang.Object
-
- org.dspace.storage.rdbms.FlywayUpgradeUtils
-
public class FlywayUpgradeUtils extends Object
Utility class used to detect issues with the Flyway migration history table and attempt to correct/fix them. These issues can occur when attempting to upgrade your database across multiple versions/releases of Flyway.As documented in this issue ticket, Flyway does not normally support skipping over any major release (for example going from v3 to v5 is unsuppored): https://github.com/flyway/flyway/issues/2126
This class allows us to do a migration (where needed) through multiple major versions of Flyway.
- Author:
- Tim Donohue
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static voidupgradeFlywayTable(org.flywaydb.core.Flyway flyway, Connection connection)Ensures the Flyway migration history table (FLYWAY_TABLE) is upgraded to the latest version of Flyway safely.
-
-
-
Method Detail
-
upgradeFlywayTable
protected static void upgradeFlywayTable(org.flywaydb.core.Flyway flyway, Connection connection) throws SQLExceptionEnsures the Flyway migration history table (FLYWAY_TABLE) is upgraded to the latest version of Flyway safely.Unfortunately, Flyway does not always support skipping major versions (e.g. upgrading directly from Flyway v3.x to 5.x is not possible, see https://github.com/flyway/flyway/issues/2126).
While sometimes it's possible to do so, other times you MUST upgrade through each major version. This method ensures we upgrade the Flyway history table through each version of Flyway where deemed necessary.
- Parameters:
flyway- initialized/configured Flyway objectconnection- current database connection- Throws:
SQLException
-
-