From: Michele Morgan Date: Fri, 24 Apr 2020 17:03:23 +0000 (-0400) Subject: LP#1482757: Amend upgrade script to remove existing orphaned URIs X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9299ba72c2bf94a6ea34b8b7ed21eee1f5875f62;p=evergreen%2Fpines.git LP#1482757: Amend upgrade script to remove existing orphaned URIs Remove orphaned URIs from the database that have accumulated from past additions, updates and deletions of records with located URIs. Signed-off-by: Michele Morgan Signed-off-by: Jason Stephenson Signed-off-by: Michele Morgan --- diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.function.biblio.extract_located_uris.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.function.biblio.extract_located_uris.sql index d4c86c77ba..0737a35047 100644 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.function.biblio.extract_located_uris.sql +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.function.biblio.extract_located_uris.sql @@ -141,5 +141,13 @@ BEGIN END; $func$ LANGUAGE PLPGSQL; +-- Remove existing orphaned URIs from the database. +DELETE FROM asset.uri +WHERE id NOT IN +( +SELECT uri +FROM asset.uri_call_number_map +); + COMMIT;