From: Jane Sandberg Date: Wed, 3 May 2023 02:56:55 +0000 (-0700) Subject: LP1993305 stamp upgrade script X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=557b329ed5ea14cdcf065fedab6317acaf72cf2c;p=evergreen%2Fmasslnc.git LP1993305 stamp upgrade script Signed-off-by: Jane Sandberg --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 93911a38de..7d1d8caac8 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 ('1370', :eg_version); -- phasefx / sandbergja +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1371', :eg_version); -- phasefx / sandbergja CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/1371.data.smartpay.sql b/Open-ILS/src/sql/Pg/upgrade/1371.data.smartpay.sql new file mode 100644 index 0000000000..a16ceca6ae --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1371.data.smartpay.sql @@ -0,0 +1,97 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('1371', :eg_version); + +INSERT into config.org_unit_setting_type +( name, grp, label, description, datatype, fm_class ) VALUES + + ( 'credit.processor.smartpay.enabled', 'credit', + oils_i18n_gettext('credit.processor.smartpay.enabled', + 'Enable SmartPAY payments', + 'coust', 'label'), + oils_i18n_gettext('credit.processor.smartpay.enabled', + 'Enable SmartPAY payments', + 'coust', 'description'), + 'bool', null) + +,( 'credit.processor.smartpay.location_id', 'credit', + oils_i18n_gettext('credit.processor.smartpay.location_id', + 'SmartPAY location ID', + 'coust', 'label'), + oils_i18n_gettext('credit.processor.smartpay.location_id', + 'SmartPAY location ID")', + 'coust', 'description'), + 'string', null) + +,( 'credit.processor.smartpay.customer_id', 'credit', + oils_i18n_gettext('credit.processor.smartpay.customer_id', + 'SmartPAY customer ID', + 'coust', 'label'), + oils_i18n_gettext('credit.processor.smartpay.customer_id', + 'SmartPAY customer ID', + 'coust', 'description'), + 'string', null) + +,( 'credit.processor.smartpay.login', 'credit', + oils_i18n_gettext('credit.processor.smartpay.login', + 'SmartPAY login name', + 'coust', 'label'), + oils_i18n_gettext('credit.processor.smartpay.login', + 'SmartPAY login name', + 'coust', 'description'), + 'string', null) + +,( 'credit.processor.smartpay.password', 'credit', + oils_i18n_gettext('credit.processor.smartpay.password', + 'SmartPAY password', + 'coust', 'label'), + oils_i18n_gettext('credit.processor.smartpay.password', + 'SmartPAY password', + 'coust', 'description'), + 'string', null) + +,( 'credit.processor.smartpay.api_key', 'credit', + oils_i18n_gettext('credit.processor.smartpay.api_key', + 'SmartPAY API key', + 'coust', 'label'), + oils_i18n_gettext('credit.processor.smartpay.api_key', + 'SmartPAY API key', + 'coust', 'description'), + 'string', null) + +,( 'credit.processor.smartpay.server', 'credit', + oils_i18n_gettext('credit.processor.smartpay.server', + 'SmartPAY server name', + 'coust', 'label'), + oils_i18n_gettext('credit.processor.smartpay.server', + 'SmartPAY server name', + 'coust', 'description'), + 'string', null) + +,( 'credit.processor.smartpay.port', 'credit', + oils_i18n_gettext('credit.processor.smartpay.port', + 'SmartPAY server port', + 'coust', 'label'), + oils_i18n_gettext('credit.processor.smartpay.port', + 'SmartPAY server port', + 'coust', 'description'), + 'string', null) +; + +UPDATE config.org_unit_setting_type +SET description = oils_i18n_gettext('credit.processor.default', + 'This might be "AuthorizeNet", "PayPal", "PayflowPro", "SmartPAY", or "Stripe".', + 'coust', 'description') +WHERE name = 'credit.processor.default' AND description = 'This might be "AuthorizeNet", "PayPal", "PayflowPro", or "Stripe".'; -- don't clobber local edits or i18n + +UPDATE config.org_unit_setting_type + SET view_perm = (SELECT id FROM permission.perm_list + WHERE code = 'VIEW_CREDIT_CARD_PROCESSING' LIMIT 1) + WHERE name LIKE 'credit.processor.smartpay.%' AND view_perm IS NULL; + +UPDATE config.org_unit_setting_type + SET update_perm = (SELECT id FROM permission.perm_list + WHERE code = 'ADMIN_CREDIT_CARD_PROCESSING' LIMIT 1) + WHERE name LIKE 'credit.processor.smartpay.%' AND update_perm IS NULL; + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.smartpay.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.smartpay.sql deleted file mode 100644 index adfc08fb2b..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.smartpay.sql +++ /dev/null @@ -1,97 +0,0 @@ -BEGIN; - -SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); - -INSERT into config.org_unit_setting_type -( name, grp, label, description, datatype, fm_class ) VALUES - - ( 'credit.processor.smartpay.enabled', 'credit', - oils_i18n_gettext('credit.processor.smartpay.enabled', - 'Enable SmartPAY payments', - 'coust', 'label'), - oils_i18n_gettext('credit.processor.smartpay.enabled', - 'Enable SmartPAY payments', - 'coust', 'description'), - 'bool', null) - -,( 'credit.processor.smartpay.location_id', 'credit', - oils_i18n_gettext('credit.processor.smartpay.location_id', - 'SmartPAY location ID', - 'coust', 'label'), - oils_i18n_gettext('credit.processor.smartpay.location_id', - 'SmartPAY location ID")', - 'coust', 'description'), - 'string', null) - -,( 'credit.processor.smartpay.customer_id', 'credit', - oils_i18n_gettext('credit.processor.smartpay.customer_id', - 'SmartPAY customer ID', - 'coust', 'label'), - oils_i18n_gettext('credit.processor.smartpay.customer_id', - 'SmartPAY customer ID', - 'coust', 'description'), - 'string', null) - -,( 'credit.processor.smartpay.login', 'credit', - oils_i18n_gettext('credit.processor.smartpay.login', - 'SmartPAY login name', - 'coust', 'label'), - oils_i18n_gettext('credit.processor.smartpay.login', - 'SmartPAY login name', - 'coust', 'description'), - 'string', null) - -,( 'credit.processor.smartpay.password', 'credit', - oils_i18n_gettext('credit.processor.smartpay.password', - 'SmartPAY password', - 'coust', 'label'), - oils_i18n_gettext('credit.processor.smartpay.password', - 'SmartPAY password', - 'coust', 'description'), - 'string', null) - -,( 'credit.processor.smartpay.api_key', 'credit', - oils_i18n_gettext('credit.processor.smartpay.api_key', - 'SmartPAY API key', - 'coust', 'label'), - oils_i18n_gettext('credit.processor.smartpay.api_key', - 'SmartPAY API key', - 'coust', 'description'), - 'string', null) - -,( 'credit.processor.smartpay.server', 'credit', - oils_i18n_gettext('credit.processor.smartpay.server', - 'SmartPAY server name', - 'coust', 'label'), - oils_i18n_gettext('credit.processor.smartpay.server', - 'SmartPAY server name', - 'coust', 'description'), - 'string', null) - -,( 'credit.processor.smartpay.port', 'credit', - oils_i18n_gettext('credit.processor.smartpay.port', - 'SmartPAY server port', - 'coust', 'label'), - oils_i18n_gettext('credit.processor.smartpay.port', - 'SmartPAY server port', - 'coust', 'description'), - 'string', null) -; - -UPDATE config.org_unit_setting_type -SET description = oils_i18n_gettext('credit.processor.default', - 'This might be "AuthorizeNet", "PayPal", "PayflowPro", "SmartPAY", or "Stripe".', - 'coust', 'description') -WHERE name = 'credit.processor.default' AND description = 'This might be "AuthorizeNet", "PayPal", "PayflowPro", or "Stripe".'; -- don't clobber local edits or i18n - -UPDATE config.org_unit_setting_type - SET view_perm = (SELECT id FROM permission.perm_list - WHERE code = 'VIEW_CREDIT_CARD_PROCESSING' LIMIT 1) - WHERE name LIKE 'credit.processor.smartpay.%' AND view_perm IS NULL; - -UPDATE config.org_unit_setting_type - SET update_perm = (SELECT id FROM permission.perm_list - WHERE code = 'ADMIN_CREDIT_CARD_PROCESSING' LIMIT 1) - WHERE name LIKE 'credit.processor.smartpay.%' AND update_perm IS NULL; - -COMMIT;