From: Bill Erickson Date: Fri, 3 Jun 2016 19:16:58 +0000 (-0400) Subject: Set bib editor / edit_date on authority propagation X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=db679b1fb015ab7b7a72dc453257335a4879d86e;p=working%2FEvergreen.git Set bib editor / edit_date on authority propagation Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/sql/Pg/999.functions.global.sql b/Open-ILS/src/sql/Pg/999.functions.global.sql index 97ce10065b..0ef59c7dc4 100644 --- a/Open-ILS/src/sql/Pg/999.functions.global.sql +++ b/Open-ILS/src/sql/Pg/999.functions.global.sql @@ -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 index 0000000000..5cb7fe16b8 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.authority-propage-edit-date.sql @@ -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; +