From: Jason Etheridge Date: Tue, 27 Feb 2018 21:26:09 +0000 (-0500) Subject: ensure we don't use deleted copy locations X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=commitdiff_plain;h=a1e4af4f898071d7de1bd233f085c5ea774fee0d ensure we don't use deleted copy locations Signed-off-by: Jason Etheridge --- diff --git a/sql/base/base.sql b/sql/base/base.sql index 4cc945d..40a1e8b 100644 --- a/sql/base/base.sql +++ b/sql/base/base.sql @@ -2751,6 +2751,7 @@ CREATE OR REPLACE FUNCTION migration_tools.handle_shelf (TEXT,TEXT,TEXT,INTEGER) || ' SET x_shelf = id FROM asset_copy_location b' || ' WHERE BTRIM(UPPER(a.desired_shelf)) = BTRIM(UPPER(b.name))' || ' AND b.owning_lib = $1' + || ' AND NOT b.deleted' USING org; FOREACH o IN ARRAY org_list LOOP @@ -2758,6 +2759,7 @@ CREATE OR REPLACE FUNCTION migration_tools.handle_shelf (TEXT,TEXT,TEXT,INTEGER) || ' SET x_shelf = id FROM asset.copy_location b' || ' WHERE BTRIM(UPPER(a.desired_shelf)) = BTRIM(UPPER(b.name))' || ' AND b.owning_lib = $1 AND x_shelf IS NULL' + || ' AND NOT b.deleted' USING o; END LOOP;