LP1731281: Remove Deleted Items From acvac Table
authorJason Boyer <JBoyer@library.in.gov>
Thu, 9 Nov 2017 14:55:42 +0000 (09:55 -0500)
committerGalen Charlton <gmc@equinoxinitiative.org>
Thu, 9 Nov 2017 16:15:36 +0000 (11:15 -0500)
The script that created the acvac table accidentally
included entries for deleted items which leads to confusion
when titles the library no longer owns are displayed as
available again, even though no copies appear on the record
detail page. This upgrade script removes any that are left
there.

Signed-off-by: Jason Boyer <JBoyer@library.in.gov>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/sql/Pg/upgrade/XXXX.data.lp1731281-acvac-cleanup.sql [new file with mode: 0644]

diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.lp1731281-acvac-cleanup.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.lp1731281-acvac-cleanup.sql
new file mode 100644 (file)
index 0000000..e7bd8f9
--- /dev/null
@@ -0,0 +1,7 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+DELETE FROM asset.copy_vis_attr_cache WHERE target_copy IN (SELECT id FROM asset.copy WHERE deleted);
+
+COMMIT;