diff --git a/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V7.6_2023.07.20__subscription_add_dspace_object_ids_of_communities.sql b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V7.6_2023.07.20__subscription_add_dspace_object_ids_of_communities.sql new file mode 100644 index 000000000000..a38ba0c971a4 --- /dev/null +++ b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V7.6_2023.07.20__subscription_add_dspace_object_ids_of_communities.sql @@ -0,0 +1,15 @@ +-- +-- The contents of this file are subject to the license and copyright +-- detailed in the LICENSE and NOTICE files at the root of the source +-- tree and available online at +-- +-- http://www.dspace.org/license/ +-- + +----------------------------------------------------------------------------------- +-- add community UUIDs to dspace_object_ids (in community subscriptions) +-- remove column community_id afterwards +----------------------------------------------------------------------------------- + +UPDATE subscription SET dspace_object_id = (SELECT uuid FROM community WHERE community_id = subscription.community_id) WHERE community_id IS NOT NULL; +ALTER TABLE subscription DROP COLUMN IF EXISTS community_id; diff --git a/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.6_2023.07.20__subscription_add_dspace_object_ids_of_communities.sql b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.6_2023.07.20__subscription_add_dspace_object_ids_of_communities.sql new file mode 100644 index 000000000000..a38ba0c971a4 --- /dev/null +++ b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.6_2023.07.20__subscription_add_dspace_object_ids_of_communities.sql @@ -0,0 +1,15 @@ +-- +-- The contents of this file are subject to the license and copyright +-- detailed in the LICENSE and NOTICE files at the root of the source +-- tree and available online at +-- +-- http://www.dspace.org/license/ +-- + +----------------------------------------------------------------------------------- +-- add community UUIDs to dspace_object_ids (in community subscriptions) +-- remove column community_id afterwards +----------------------------------------------------------------------------------- + +UPDATE subscription SET dspace_object_id = (SELECT uuid FROM community WHERE community_id = subscription.community_id) WHERE community_id IS NOT NULL; +ALTER TABLE subscription DROP COLUMN IF EXISTS community_id;