From 05ec9e45de4e03af97cc8155210c71d561638b85 Mon Sep 17 00:00:00 2001 From: dbs Date: Mon, 25 May 2009 03:19:57 +0000 Subject: [PATCH] Serials: point MFHD records at the master bib record when merging bibs git-svn-id: svn://svn.open-ils.org/ILS/trunk@13222 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/sql/Pg/090.schema.action.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Open-ILS/src/sql/Pg/090.schema.action.sql b/Open-ILS/src/sql/Pg/090.schema.action.sql index 2b13c9321..1140dd4b6 100644 --- a/Open-ILS/src/sql/Pg/090.schema.action.sql +++ b/Open-ILS/src/sql/Pg/090.schema.action.sql @@ -356,6 +356,7 @@ DECLARE target_cn asset.call_number%ROWTYPE; metarec metabib.metarecord%ROWTYPE; hold action.hold_request%ROWTYPE; + ser_rec serial.record_entry%ROWTYPE; uri_count INT := 0; counter INT := 0; uri_datafield TEXT; @@ -476,6 +477,16 @@ BEGIN moved_objects := moved_objects + 1; END LOOP; + -- Find serial records targeting the source record ... + FOR ser_rec IN SELECT * FROM serial.record_entry WHERE record = source_record LOOP + -- ... and move them to the target record + UPDATE serial.record_entry + SET record = target_record + WHERE id = ser_rec.id; + + moved_objects := moved_objects + 1; + END LOOP; + -- Finally, "delete" the source record DELETE FROM biblio.record_entry WHERE id = source_record; -- 2.11.0