From: Mike Rylander Date: Tue, 23 Aug 2011 18:41:41 +0000 (-0400) Subject: Stamped upgrade script for LP#825245 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=8404f072ed948ee315981a5f456218a2b73ec86b;p=evergreen%2Fpines.git Stamped upgrade script for LP#825245 Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 623af3d8b3..e5830e2730 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -86,7 +86,7 @@ CREATE TRIGGER no_overlapping_deps 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 ('0607', :eg_version); -- phasefx/berick +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0608', :eg_version); -- miker/berick CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/0608.data.vandelay-export-error-match-info.sql b/Open-ILS/src/sql/Pg/upgrade/0608.data.vandelay-export-error-match-info.sql new file mode 100644 index 0000000000..2129c67890 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0608.data.vandelay-export-error-match-info.sql @@ -0,0 +1,62 @@ +-- Evergreen DB patch 0608.data.vandelay-export-error-match-info.sql +-- +-- +BEGIN; + + +-- check whether patch can be applied +SELECT evergreen.upgrade_deps_block_check('0608', :eg_version); + +-- Add vqbr.import_error, vqbr.error_detail, and vqbr.matches.size to queue print output + +UPDATE action_trigger.event_definition SET template = $$ +[%- USE date -%] +
+Queue ID: [% target.0.queue.id %]
+Queue Name: [% target.0.queue.name %]
+Queue Type: [% target.0.queue.queue_type %]
+Complete? [% target.0.queue.complete %]
+
+    [% FOR vqbr IN target %]
+=-=-=
+ Title of work    | [% helpers.get_queued_bib_attr('title',vqbr.attributes) %]
+ Author of work   | [% helpers.get_queued_bib_attr('author',vqbr.attributes) %]
+ Language of work | [% helpers.get_queued_bib_attr('language',vqbr.attributes) %]
+ Pagination       | [% helpers.get_queued_bib_attr('pagination',vqbr.attributes) %]
+ ISBN             | [% helpers.get_queued_bib_attr('isbn',vqbr.attributes) %]
+ ISSN             | [% helpers.get_queued_bib_attr('issn',vqbr.attributes) %]
+ Price            | [% helpers.get_queued_bib_attr('price',vqbr.attributes) %]
+ Accession Number | [% helpers.get_queued_bib_attr('rec_identifier',vqbr.attributes) %]
+ TCN Value        | [% helpers.get_queued_bib_attr('eg_tcn',vqbr.attributes) %]
+ TCN Source       | [% helpers.get_queued_bib_attr('eg_tcn_source',vqbr.attributes) %]
+ Internal ID      | [% helpers.get_queued_bib_attr('eg_identifier',vqbr.attributes) %]
+ Publisher        | [% helpers.get_queued_bib_attr('publisher',vqbr.attributes) %]
+ Publication Date | [% helpers.get_queued_bib_attr('pubdate',vqbr.attributes) %]
+ Edition          | [% helpers.get_queued_bib_attr('edition',vqbr.attributes) %]
+ Item Barcode     | [% helpers.get_queued_bib_attr('item_barcode',vqbr.attributes) %]
+ Import Error     | [% vqbr.import_error %]
+ Error Detail     | [% vqbr.error_detail %]
+ Match Count      | [% vqbr.matches.size %]
+
+    [% END %]
+
+$$ +WHERE id = 39; + + +-- Do the same for the CVS version + +UPDATE action_trigger.event_definition SET template = $$ +[%- USE date -%] +"Title of work","Author of work","Language of work","Pagination","ISBN","ISSN","Price","Accession Number","TCN Value","TCN Source","Internal ID","Publisher","Publication Date","Edition","Item Barcode","Import Error","Error Detail","Match Count" +[% FOR vqbr IN target %]"[% helpers.get_queued_bib_attr('title',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('author',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('language',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('pagination',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('isbn',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('issn',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('price',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('rec_identifier',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('eg_tcn',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('eg_tcn_source',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('eg_identifier',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('publisher',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('pubdate',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('edition',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('item_barcode',vqbr.attributes) | replace('"', '""') %]","[% vqbr.import_error | replace('"', '""') %]","[% vqbr.error_detail | replace('"', '""') %]","[% vqbr.matches.size %]" +[% END %] +$$ +WHERE id = 40; + +-- Add matches to the env for both +INSERT INTO action_trigger.environment (event_def, path) VALUES (39, 'matches'); +INSERT INTO action_trigger.environment (event_def, path) VALUES (40, 'matches'); + +COMMIT; + diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.vandelay-export-error-match-info.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.vandelay-export-error-match-info.sql deleted file mode 100644 index e62d9f87b0..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.vandelay-export-error-match-info.sql +++ /dev/null @@ -1,62 +0,0 @@ --- Evergreen DB patch XXXX.data.vandelay-export-error-match-info.sql --- --- FIXME: insert description of change, if needed --- -BEGIN; - - --- check whether patch can be applied -SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); - --- Add vqbr.import_error, vqbr.error_detail, and vqbr.matches.size to queue print output - -UPDATE action_trigger.event_definition SET template = $$ -[%- USE date -%] -
-Queue ID: [% target.0.queue.id %]
-Queue Name: [% target.0.queue.name %]
-Queue Type: [% target.0.queue.queue_type %]
-Complete? [% target.0.queue.complete %]
-
-    [% FOR vqbr IN target %]
-=-=-=
- Title of work    | [% helpers.get_queued_bib_attr('title',vqbr.attributes) %]
- Author of work   | [% helpers.get_queued_bib_attr('author',vqbr.attributes) %]
- Language of work | [% helpers.get_queued_bib_attr('language',vqbr.attributes) %]
- Pagination       | [% helpers.get_queued_bib_attr('pagination',vqbr.attributes) %]
- ISBN             | [% helpers.get_queued_bib_attr('isbn',vqbr.attributes) %]
- ISSN             | [% helpers.get_queued_bib_attr('issn',vqbr.attributes) %]
- Price            | [% helpers.get_queued_bib_attr('price',vqbr.attributes) %]
- Accession Number | [% helpers.get_queued_bib_attr('rec_identifier',vqbr.attributes) %]
- TCN Value        | [% helpers.get_queued_bib_attr('eg_tcn',vqbr.attributes) %]
- TCN Source       | [% helpers.get_queued_bib_attr('eg_tcn_source',vqbr.attributes) %]
- Internal ID      | [% helpers.get_queued_bib_attr('eg_identifier',vqbr.attributes) %]
- Publisher        | [% helpers.get_queued_bib_attr('publisher',vqbr.attributes) %]
- Publication Date | [% helpers.get_queued_bib_attr('pubdate',vqbr.attributes) %]
- Edition          | [% helpers.get_queued_bib_attr('edition',vqbr.attributes) %]
- Item Barcode     | [% helpers.get_queued_bib_attr('item_barcode',vqbr.attributes) %]
- Import Error     | [% vqbr.import_error %]
- Error Detail     | [% vqbr.error_detail %]
- Match Count      | [% vqbr.matches.size %]
-
-    [% END %]
-
-$$ -WHERE id = 39; - - --- Do the same for the CVS version - -UPDATE action_trigger.event_definition SET template = $$ -[%- USE date -%] -"Title of work","Author of work","Language of work","Pagination","ISBN","ISSN","Price","Accession Number","TCN Value","TCN Source","Internal ID","Publisher","Publication Date","Edition","Item Barcode","Import Error","Error Detail","Match Count" -[% FOR vqbr IN target %]"[% helpers.get_queued_bib_attr('title',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('author',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('language',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('pagination',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('isbn',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('issn',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('price',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('rec_identifier',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('eg_tcn',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('eg_tcn_source',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('eg_identifier',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('publisher',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('pubdate',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('edition',vqbr.attributes) | replace('"', '""') %]","[% helpers.get_queued_bib_attr('item_barcode',vqbr.attributes) | replace('"', '""') %]","[% vqbr.import_error | replace('"', '""') %]","[% vqbr.error_detail | replace('"', '""') %]","[% vqbr.matches.size %]" -[% END %] -$$ -WHERE id = 40; - --- Add matches to the env for both -INSERT INTO action_trigger.environment (event_def, path) VALUES (39, 'matches'); -INSERT INTO action_trigger.environment (event_def, path) VALUES (40, 'matches'); - -COMMIT;