From 9299ba72c2bf94a6ea34b8b7ed21eee1f5875f62 Mon Sep 17 00:00:00 2001 From: Michele Morgan Date: Fri, 24 Apr 2020 13:03:23 -0400 Subject: [PATCH] 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 --- .../sql/Pg/upgrade/XXXX.function.biblio.extract_located_uris.sql | 8 ++++++++ 1 file changed, 8 insertions(+) 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; -- 2.11.0