BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0736', :eg_version); -- miker/tsbere
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0737', :eg_version); -- dyrcona/dbs
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
--- /dev/null
+BEGIN;
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('0737', :eg_version);
+
+UPDATE action_trigger.event_definition
+SET template =
+$$
+[%-
+# target is the bookbag itself. The 'items' variable does not need to be in
+# the environment because a special reactor will take care of filling it in.
+
+FOR item IN items;
+ bibxml = helpers.unapi_bre(item.target_biblio_record_entry, {flesh => '{mra}'});
+ title = "";
+ FOR part IN bibxml.findnodes('//*[@tag="245"]/*[@code="a" or @code="b"]');
+ title = title _ part.textContent;
+ END;
+ author = bibxml.findnodes('//*[@tag="100"]/*[@code="a"]').textContent;
+ item_type = bibxml.findnodes('//*[local-name()="attributes"]/*[local-name()="field"][@name="item_type"]').getAttribute('coded-value');
+ pub_date = "";
+ FOR pdatum IN bibxml.findnodes('//*[@tag="260"]/*[@code="c"]');
+ IF pub_date ;
+ pub_date = pub_date _ ", " _ pdatum.textContent;
+ ELSE ;
+ pub_date = pdatum.textContent;
+ END;
+ END;
+ helpers.csv_datum(title) %],[% helpers.csv_datum(author) %],[% helpers.csv_datum(pub_date) %],[% helpers.csv_datum(item_type) %],[% FOR note IN item.notes; helpers.csv_datum(note.note); ","; END; "\n";
+END -%]
+$$
+WHERE name = 'Bookbag CSV';
+
+COMMIT;
+++ /dev/null
-BEGIN;
--- check whether patch can be applied
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
-
-UPDATE action_trigger.event_definition
-SET template =
-$$
-[%-
-# target is the bookbag itself. The 'items' variable does not need to be in
-# the environment because a special reactor will take care of filling it in.
-
-FOR item IN items;
- bibxml = helpers.unapi_bre(item.target_biblio_record_entry, {flesh => '{mra}'});
- title = "";
- FOR part IN bibxml.findnodes('//*[@tag="245"]/*[@code="a" or @code="b"]');
- title = title _ part.textContent;
- END;
- author = bibxml.findnodes('//*[@tag="100"]/*[@code="a"]').textContent;
- item_type = bibxml.findnodes('//*[local-name()="attributes"]/*[local-name()="field"][@name="item_type"]').getAttribute('coded-value');
- pub_date = "";
- FOR pdatum IN bibxml.findnodes('//*[@tag="260"]/*[@code="c"]');
- IF pub_date ;
- pub_date = pub_date _ ", " _ pdatum.textContent;
- ELSE ;
- pub_date = pdatum.textContent;
- END;
- END;
- helpers.csv_datum(title) %],[% helpers.csv_datum(author) %],[% helpers.csv_datum(pub_date) %],[% helpers.csv_datum(item_type) %],[% FOR note IN item.notes; helpers.csv_datum(note.note); ","; END; "\n";
-END -%]
-$$
-WHERE id = 48;
-
-COMMIT;