The "empty bib" deletion needs to exclude electronic resources (source <> 3)
authorChris Sharp <csharp@georgialibraries.org>
Mon, 27 Jan 2014 21:35:15 +0000 (16:35 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Thu, 6 Nov 2014 17:54:16 +0000 (12:54 -0500)
Open-ILS/src/sql/Pg/version-upgrade/pines-pre-2.3-2.4.0-upgrade-db.sql

index 33159b2..8553348 100644 (file)
@@ -16,7 +16,7 @@ DROP FUNCTION tsvector_concat(public.tsvector,public.tsvector);
 UPDATE asset.call_number acn SET deleted = TRUE WHERE NOT acn.deleted AND acn.id NOT IN (SELECT acp.call_number FROM asset.copy acp WHERE NOT acp.deleted) AND acn.create_date < (now() - interval '1 month');
 
 -- delete empty bibs over 1 month old - real    1m23.544s on test
-UPDATE biblio.record_entry bre SET deleted = TRUE WHERE NOT bre.deleted and bre.id NOT IN (SELECT acn.record FROM asset.call_number acn WHERE NOT acn.deleted) AND bre.create_date < (now() - interval '1 month');
+UPDATE biblio.record_entry bre SET deleted = TRUE WHERE NOT bre.deleted and bre.id NOT IN (SELECT acn.record FROM asset.call_number acn WHERE NOT acn.deleted) AND source <> 3 AND bre.create_date < (now() - interval '1 month');
 
 -- delete Missing items over one year old
 UPDATE asset.copy SET deleted = TRUE WHERE NOT deleted AND status IN (SELECT id FROM config.copy_status WHERE name = 'Missing') AND edit_date <= (now() - interval '1 year');