Class V1_3_9__Drop_constraint_for_DSpace_1_4_schema
- java.lang.Object
-
- org.flywaydb.core.api.migration.BaseJavaMigration
-
- org.dspace.storage.rdbms.migration.V1_3_9__Drop_constraint_for_DSpace_1_4_schema
-
- All Implemented Interfaces:
org.flywaydb.core.api.migration.JavaMigration
public class V1_3_9__Drop_constraint_for_DSpace_1_4_schema extends org.flywaydb.core.api.migration.BaseJavaMigrationThis class is in support of the "V1.4__Upgrade_to_DSpace_1.4_schema.sql" It simply drops the database constraint associated with the "name" column of the "community" table. This is necessary for the upgrade from 1.3 to 1.4This class was created because the names of database constraints differs based on the type of database (Postgres vs. H2). As such, it becomes difficult to write simple SQL which will work for multiple database types (especially since unit tests require H2 and the syntax for H2 is different from Postgres).
NOTE: This migration class is very simple because it is meant to be used in conjuction with the corresponding SQL script: ./etc/migrations/[db-type]/V1.4__Upgrade_to_DSpace_1.4_schema.sql
Also note that this migration is "hackingly" versioned "1.3.9" as it needs to run just PRIOR to the 1.4 migration script.
This class represents a Flyway DB Java Migration http://flywaydb.org/documentation/migration/java.html
- Author:
- Tim Donohue
-
-
Constructor Summary
Constructors Constructor Description V1_3_9__Drop_constraint_for_DSpace_1_4_schema()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegergetChecksum()Return the checksum to be associated with this Migration in the Flyway database table (schema_version).voidmigrate(org.flywaydb.core.api.migration.Context context)Actually migrate the existing database
-
-
-
Method Detail
-
migrate
public void migrate(org.flywaydb.core.api.migration.Context context) throws IOException, SQLExceptionActually migrate the existing database- Parameters:
context- Flyway Migration Context- Throws:
IOException- A general class of exceptions produced by failed or interrupted I/O operations.SQLException- An exception that provides information on a database access error or other errors.
-
getChecksum
public Integer getChecksum()
Return the checksum to be associated with this Migration in the Flyway database table (schema_version).- Specified by:
getChecksumin interfaceorg.flywaydb.core.api.migration.JavaMigration- Overrides:
getChecksumin classorg.flywaydb.core.api.migration.BaseJavaMigration- Returns:
- checksum as an Integer
-
-