[open-ils-commits] r13222 - trunk/Open-ILS/src/sql/Pg (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun May 24 23:19:59 EDT 2009
Author: dbs
Date: 2009-05-24 23:19:57 -0400 (Sun, 24 May 2009)
New Revision: 13222
Modified:
trunk/Open-ILS/src/sql/Pg/090.schema.action.sql
Log:
Serials: point MFHD records at the master bib record when merging bibs
Modified: trunk/Open-ILS/src/sql/Pg/090.schema.action.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/090.schema.action.sql 2009-05-24 22:22:18 UTC (rev 13221)
+++ trunk/Open-ILS/src/sql/Pg/090.schema.action.sql 2009-05-25 03:19:57 UTC (rev 13222)
@@ -356,6 +356,7 @@
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 @@
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;
More information about the open-ils-commits
mailing list