Set bib editor / edit_date on authority propagation user/berick/auth-prop-sets-bib-edit-data
authorBill Erickson <berickxx@gmail.com>
Fri, 3 Jun 2016 19:16:58 +0000 (15:16 -0400)
committerBill Erickson <berickxx@gmail.com>
Fri, 3 Jun 2016 19:16:58 +0000 (15:16 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/sql/Pg/999.functions.global.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.authority-propage-edit-date.sql [new file with mode: 0644]

index 97ce100..0ef59c7 100644 (file)
@@ -1485,7 +1485,9 @@ CREATE TRIGGER a_opac_vis_mat_view_tgr AFTER INSERT OR UPDATE ON actor.org_unit
 -- Authority ingest routines
 CREATE OR REPLACE FUNCTION authority.propagate_changes (aid BIGINT, bid BIGINT) RETURNS BIGINT AS $func$
     UPDATE  biblio.record_entry
-      SET   marc = vandelay.merge_record_xml( marc, authority.generate_overlay_template( $1 ) )
+      SET   marc = vandelay.merge_record_xml( marc, authority.generate_overlay_template( $1 ) ),
+            editor = (SELECT editor FROM authority.record_entry WHERE id = $1),
+            edit_date = NOW()
       WHERE id = $2;
     SELECT $1;
 $func$ LANGUAGE SQL;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.authority-propage-edit-date.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.authority-propage-edit-date.sql
new file mode 100644 (file)
index 0000000..5cb7fe1
--- /dev/null
@@ -0,0 +1,13 @@
+
+CREATE OR REPLACE FUNCTION authority.propagate_changes 
+    (aid BIGINT, bid BIGINT) RETURNS BIGINT AS $func$
+    UPDATE  biblio.record_entry
+      SET   marc = vandelay.merge_record_xml( 
+                marc, authority.generate_overlay_template( $1 ) ),
+            editor = (SELECT editor FROM authority.record_entry WHERE id = $1),
+            edit_date = NOW()
+      WHERE id = $2;
+    SELECT $1;
+
+$func$ LANGUAGE SQL;
+