From 729120437d95f238d56c7e3531476ff8b0add266 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 2 May 2013 11:43:03 -0400 Subject: [PATCH] improvements to bib nuking script - truncate a few tables that don't have explicit FK links to bibs or copies - nuke authority records - inform the sysadmin of the next steps to take to complete the purge Signed-off-by: Galen Charlton --- sql/nuke-bibs-and-items.sql | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/sql/nuke-bibs-and-items.sql b/sql/nuke-bibs-and-items.sql index 9e64647..d872671 100644 --- a/sql/nuke-bibs-and-items.sql +++ b/sql/nuke-bibs-and-items.sql @@ -30,13 +30,24 @@ CREATE TABLE biblio.record_entry_temp AS ( TRUNCATE action.circulation, asset.copy, + asset.opac_visible_copies, biblio.record_entry, asset.call_number, metabib.metarecord_source_map, - metabib.metarecord + metabib.metarecord, + metabib.facet_entry, + metabib.browse_entry, + authority.record_entry, + authority.full_rec, + authority.rec_descriptor CASCADE; INSERT INTO asset.call_number SELECT * FROM asset.call_number_temp; INSERT INTO biblio.record_entry SELECT * FROM biblio.record_entry_temp; +DROP TABLE asset.call_number_temp; +DROP TABLE biblio.record_entry_temp; + +\echo If the purge looks good, please COMMIT +\echo You should also follow with a VACUUM ANALYZE or the like. -- 1.7.2.5