mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
Add migration to fix MDV place
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
--
|
||||
-- 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/
|
||||
--
|
||||
|
||||
----------------------------------------------------
|
||||
-- Make sure the metadatavalue.place column starts at 0 instead of 1
|
||||
----------------------------------------------------
|
||||
UPDATE metadatavalue AS mdv
|
||||
SET place = mdv.place - minplace
|
||||
FROM (
|
||||
SELECT dspace_object_id, metadata_field_id, MIN(place) AS minplace
|
||||
FROM metadatavalue
|
||||
GROUP BY dspace_object_id, metadata_field_id
|
||||
) AS mp
|
||||
WHERE mdv.dspace_object_id = mp.dspace_object_id
|
||||
AND mdv.metadata_field_id = mp.metadata_field_id
|
||||
AND minplace > 0;
|
Reference in New Issue
Block a user