4Science / DSpace

This repository contains the 4Science optimized DSpace & DSpace-CRIS distribution.
https://wiki.lyrasis.org/display/DSPACECRIS/
BSD 3-Clause "New" or "Revised" License
42 stars 61 forks source link

improve migration of community subscriptions: set dspace_object_id to community UUID / remove community_id #362

Open saschaszott opened 1 year ago

saschaszott commented 1 year ago

This PR handles community subscriptions managed in the subscription table: it adds the community UUID to column dspace_object_id. This corresponds to the way new community subscriptions in DS CRIS are managed.

Afterward the column community_id in the subscription table is removed. This column was added with DSpace CRIS based on DSpace 1.8.2.2 (https://github.com/4Science/DSpace/blob/dspace-5_x_x-cris/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V1.8.2.2__DSpaceCRIS-subscription_database_schema.sql).

saschaszott commented 1 year ago

The in-depth analysis in issue #371 has shown that the table subscription does not have column community_id in a clean/fresh installation of DS CRIS 7. Therefore, it is crucial that changes in this PR do not affect clean/fresh installations of DS CRIS 7. In its current form, this PR does not consider this fact. It needs to be extended.

saschaszott commented 1 year ago

To fix the problem mentioned in the comment below it is crucial that the Flyway script V1.8.2.2__DSpaceCRIS-subscription_database_schema.sql which was shipped with DS CRIS 5 (https://github.com/4Science/DSpace/blob/dspace-5_x_x-cris/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V1.8.2.2__DSpaceCRIS-subscription_database_schema.sql) is added in org/dspace/storage/rdbms/sqlmigration/postgres.

CRIS installations which have already migrated to DS CRIS 7 need to apply the changes manually.