From: Galen Charlton Date: Tue, 8 Sep 2020 14:52:21 +0000 (-0400) Subject: LP#1860703: stamp schema update X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=957beb59dc1096663607ca0570340fda9eebdc6d;p=evergreen%2Fjoelewis.git LP#1860703: stamp schema update Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 7dd7921936..bd961a1fae 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -92,7 +92,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 ('1221', :eg_version); -- miker/JBoyer +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1222', :eg_version); -- miker/gmcharlt CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/1222.data.CallHTTP_at_reactor.sql b/Open-ILS/src/sql/Pg/upgrade/1222.data.CallHTTP_at_reactor.sql new file mode 100644 index 0000000000..f51aa10622 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1222.data.CallHTTP_at_reactor.sql @@ -0,0 +1,14 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('1222', :eg_version); + +INSERT INTO action_trigger.reactor (module, description) VALUES ( + 'CallHTTP', 'Push event information out to an external system via HTTP' +); + +INSERT INTO action_trigger.hook (key, core_type, description, passive) VALUES ( + 'bre.edit', 'bre', 'A bib record was edited', FALSE +); + +COMMIT; + diff --git a/Open-ILS/src/sql/Pg/upgrade/1223.data.new_user_a-t_hooks.sql b/Open-ILS/src/sql/Pg/upgrade/1223.data.new_user_a-t_hooks.sql new file mode 100644 index 0000000000..ad069706a4 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1223.data.new_user_a-t_hooks.sql @@ -0,0 +1,26 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('1223', :eg_version); + +-- First, normalize the au.create[d] and au.update[d] hooks. The code and seed data differ. + +INSERT INTO action_trigger.hook (key, core_type, description, passive) + VALUES ('au.created', 'au', 'A user was created', 't') ON CONFLICT DO NOTHING; +INSERT INTO action_trigger.hook (key, core_type, description, passive) + VALUES ('au.updated', 'au', 'A user was updated', 't') ON CONFLICT DO NOTHING; + + +UPDATE action_trigger.event_definition SET hook = 'au.created' WHERE hook = 'au.create'; +UPDATE action_trigger.event_definition SET hook = 'au.updated' WHERE hook = 'au.update'; + +DELETE FROM action_trigger.hook WHERE key = 'au.create'; +DELETE FROM action_trigger.hook WHERE key = 'au.update'; + +-- Now the entirely new ones... +INSERT INTO action_trigger.hook (key, core_type, description, passive) + VALUES ('au.renewed', 'au', 'A user was renewed by having their expire date changed', 't'); + +INSERT INTO action_trigger.hook (key, core_type, description, passive) + VALUES ('au.barcode_changed', 'au', 'A card was updated or created for an existing user', 't'); + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.CallHTTP_at_reactor.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.CallHTTP_at_reactor.sql deleted file mode 100644 index e25e281352..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.CallHTTP_at_reactor.sql +++ /dev/null @@ -1,14 +0,0 @@ -BEGIN; - -SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); - -INSERT INTO action_trigger.reactor (module, description) VALUES ( - 'CallHTTP', 'Push event information out to an external system via HTTP' -); - -INSERT INTO action_trigger.hook (key, core_type, description, passive) VALUES ( - 'bre.edit', 'bre', 'A bib record was edited', FALSE -); - -COMMIT; - diff --git a/Open-ILS/src/sql/Pg/upgrade/YYYY.new_user_a-t_hooks.sql b/Open-ILS/src/sql/Pg/upgrade/YYYY.new_user_a-t_hooks.sql deleted file mode 100644 index 8857cd19f2..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/YYYY.new_user_a-t_hooks.sql +++ /dev/null @@ -1,26 +0,0 @@ -BEGIN; - -SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); - --- First, normalize the au.create[d] and au.update[d] hooks. The code and seed data differ. - -INSERT INTO action_trigger.hook (key, core_type, description, passive) - VALUES ('au.created', 'au', 'A user was created', 't') ON CONFLICT DO NOTHING; -INSERT INTO action_trigger.hook (key, core_type, description, passive) - VALUES ('au.updated', 'au', 'A user was updated', 't') ON CONFLICT DO NOTHING; - - -UPDATE action_trigger.event_definition SET hook = 'au.created' WHERE hook = 'au.create'; -UPDATE action_trigger.event_definition SET hook = 'au.updated' WHERE hook = 'au.update'; - -DELETE FROM action_trigger.hook WHERE key = 'au.create'; -DELETE FROM action_trigger.hook WHERE key = 'au.update'; - --- Now the entirely new ones... -INSERT INTO action_trigger.hook (key, core_type, description, passive) - VALUES ('au.renewed', 'au', 'A user was renewed by having their expire date changed', 't'); - -INSERT INTO action_trigger.hook (key, core_type, description, passive) - VALUES ('au.barcode_changed', 'au', 'A card was updated or created for an existing user', 't'); - -COMMIT;