Signed-off-by: Bill Erickson <berickxx@gmail.com>
-- 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;
--- /dev/null
+
+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;
+