From: Bill Erickson Date: Thu, 3 Sep 2020 16:00:27 +0000 (-0400) Subject: LP1850547 Stamping DB upgrade: Ang Acq Search X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=8ee3fa64b7024388443d07745e7971e7634f591f;p=evergreen%2Ftadl.git LP1850547 Stamping DB upgrade: Ang Acq Search Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index ac3b514f98..82227504dd 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 ('1216', :eg_version); -- berick/sandbergja +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1219', :eg_version); -- gmcharlt/berick CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/1217.data.angular_acq_search.sql b/Open-ILS/src/sql/Pg/upgrade/1217.data.angular_acq_search.sql new file mode 100644 index 0000000000..33988de5bc --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1217.data.angular_acq_search.sql @@ -0,0 +1,89 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('1217', :eg_version); + +INSERT INTO config.workstation_setting_type + (name, grp, datatype, label) +VALUES ( + 'eg.acq.search.default.lineitems', 'gui', 'object', + oils_i18n_gettext( + 'eg.acq.search.default.lineitems', + 'Acquisitions Default Search: Lineitems', + 'cwst', 'label') +), ( + 'eg.acq.search.default.purchaseorders', 'gui', 'object', + oils_i18n_gettext( + 'eg.acq.search.default.purchaseorders', + 'Acquisitions Default Search: Purchase Orders', + 'cwst', 'label') +), ( + 'eg.acq.search.default.invoices', 'gui', 'object', + oils_i18n_gettext( + 'eg.acq.search.default.invoices', + 'Acquisitions Default Search: Invoices', + 'cwst', 'label') +), ( + 'eg.acq.search.default.selectionlists', 'gui', 'object', + oils_i18n_gettext( + 'eg.acq.search.default.selectionlists', + 'Acquisitions Default Search: Selection Lists', + 'cwst', 'label') +); + +INSERT INTO config.workstation_setting_type + (name, grp, datatype, label) +VALUES ( + 'eg.acq.search.lineitems.run_immediately', 'gui', 'bool', + oils_i18n_gettext( + 'eg.acq.search.lineitems.run_immediately', + 'Acquisitions Search: Immediately Search Lineitems', + 'cwst', 'label') +), ( + 'eg.acq.search.purchaseorders.run_immediately', 'gui', 'bool', + oils_i18n_gettext( + 'eg.acq.search.purchaseorders.run_immediately', + 'Acquisitions Search: Immediately Search Purchase Orders', + 'cwst', 'label') +), ( + 'eg.acq.search.invoices.run_immediately', 'gui', 'bool', + oils_i18n_gettext( + 'eg.acq.search.invoices.run_immediately', + 'Acquisitions Search: Immediately Search Invoices', + 'cwst', 'label') +), ( + 'eg.acq.search.selectionlists.run_immediately', 'gui', 'bool', + oils_i18n_gettext( + 'eg.acq.search.selectionlists.run_immediately', + 'Acquisitions Search: Immediately Search Selection Lists', + 'cwst', 'label') +); + +INSERT INTO config.workstation_setting_type + (name, grp, datatype, label) +VALUES ( + 'eg.grid.acq.search.lineitems', 'gui', 'object', + oils_i18n_gettext( + 'eg.grid.acq.search.lineitems', + 'Grid Config: acq.search.lineitems', + 'cwst', 'label') +), ( + 'eg.grid.acq.search.purchaseorders', 'gui', 'object', + oils_i18n_gettext( + 'eg.grid.acq.search.purchaseorders', + 'Grid Config: acq.search.purchaseorders', + 'cwst', 'label') +), ( + 'eg.grid.acq.search.selectionlists', 'gui', 'object', + oils_i18n_gettext( + 'eg.grid.acq.search.selectionlists', + 'Grid Config: acq.search.selectionlists', + 'cwst', 'label') +), ( + 'eg.grid.acq.search.invoices', 'gui', 'object', + oils_i18n_gettext( + 'eg.grid.acq.search.invoices', + 'Grid Config: acq.search.invoices', + 'cwst', 'label') +); + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/1218.data.acq_permissions.sql b/Open-ILS/src/sql/Pg/upgrade/1218.data.acq_permissions.sql new file mode 100644 index 0000000000..266d9a079f --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1218.data.acq_permissions.sql @@ -0,0 +1,67 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('1218', :eg_version); + +INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable) + SELECT + pgt.id, perm.id, aout.depth, TRUE + FROM + permission.grp_tree pgt, + permission.perm_list perm, + actor.org_unit_type aout + WHERE + pgt.name = 'Acquisitions Administrator' AND + aout.name = 'Consortium' AND + perm.code IN ( + 'VIEW_FUND', + 'VIEW_FUNDING_SOURCE', + 'VIEW_FUND_ALLOCATION', + 'VIEW_PICKLIST', + 'VIEW_PROVIDER', + 'VIEW_PURCHASE_ORDER', + 'VIEW_INVOICE', + 'CREATE_PICKLIST', + 'ACQ_ADD_LINEITEM_IDENTIFIER', + 'ACQ_SET_LINEITEM_IDENTIFIER', + 'MANAGE_FUND', + 'CREATE_INVOICE', + 'CREATE_PURCHASE_ORDER', + 'IMPORT_ACQ_LINEITEM_BIB_RECORD', + 'IMPORT_ACQ_LINEITEM_BIB_RECORD_UPLOAD', + 'MANAGE_CLAIM', + 'MANAGE_PROVIDER', + 'MANAGE_FUNDING_SOURCE', + 'RECEIVE_PURCHASE_ORDER', + 'ADMIN_ACQ_LINEITEM_ALERT_TEXT', + 'UPDATE_FUNDING_SOURCE', + 'UPDATE_PROVIDER', + 'VIEW_IMPORT_MATCH_SET', + 'VIEW_MERGE_PROFILE', + 'IMPORT_MARC' + ); + + +INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable) + SELECT + pgt.id, perm.id, aout.depth, FALSE + FROM + permission.grp_tree pgt, + permission.perm_list perm, + actor.org_unit_type aout + WHERE + pgt.name = 'Acquisitions' AND + aout.name = 'Consortium' AND + perm.code IN ( + 'ACQ_ADD_LINEITEM_IDENTIFIER', + 'ACQ_SET_LINEITEM_IDENTIFIER', + 'ADMIN_ACQ_FUND', + 'ADMIN_FUND', + 'ACQ_INVOICE-REOPEN', + 'ADMIN_ACQ_DISTRIB_FORMULA', + 'ADMIN_INVOICE', + 'IMPORT_ACQ_LINEITEM_BIB_RECORD_UPLOAD', + 'VIEW_IMPORT_MATCH_SET', + 'VIEW_MERGE_PROFILE' + ); + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/1219.schema.acq_state_views.sql b/Open-ILS/src/sql/Pg/upgrade/1219.schema.acq_state_views.sql new file mode 100644 index 0000000000..41c9c9bd6b --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1219.schema.acq_state_views.sql @@ -0,0 +1,28 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('1219', :eg_version); + +CREATE VIEW acq.li_state_label AS + SELECT * + FROM (VALUES + ('new', 'New'), + ('selector-ready', 'Selector-Ready'), + ('order-ready', 'Order-Ready'), + ('approved', 'Approved'), + ('pending-order', 'Pending-Order'), + ('on-order', 'On-Order'), + ('received', 'Received'), + ('cancelled', 'Cancelled') + ) AS t (id,label); + +CREATE VIEW acq.po_state_label AS + SELECT * + FROM (VALUES + ('new', 'New'), + ('pending', 'Pending'), + ('on-order', 'On-Order'), + ('received', 'Received'), + ('cancelled', 'Cancelled') + ) AS t (id,label); + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.angular_acq_search.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.angular_acq_search.sql deleted file mode 100644 index b3482e0e6c..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.angular_acq_search.sql +++ /dev/null @@ -1,89 +0,0 @@ -BEGIN; - --- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); - -INSERT INTO config.workstation_setting_type - (name, grp, datatype, label) -VALUES ( - 'eg.acq.search.default.lineitems', 'gui', 'object', - oils_i18n_gettext( - 'eg.acq.search.default.lineitems', - 'Acquisitions Default Search: Lineitems', - 'cwst', 'label') -), ( - 'eg.acq.search.default.purchaseorders', 'gui', 'object', - oils_i18n_gettext( - 'eg.acq.search.default.purchaseorders', - 'Acquisitions Default Search: Purchase Orders', - 'cwst', 'label') -), ( - 'eg.acq.search.default.invoices', 'gui', 'object', - oils_i18n_gettext( - 'eg.acq.search.default.invoices', - 'Acquisitions Default Search: Invoices', - 'cwst', 'label') -), ( - 'eg.acq.search.default.selectionlists', 'gui', 'object', - oils_i18n_gettext( - 'eg.acq.search.default.selectionlists', - 'Acquisitions Default Search: Selection Lists', - 'cwst', 'label') -); - -INSERT INTO config.workstation_setting_type - (name, grp, datatype, label) -VALUES ( - 'eg.acq.search.lineitems.run_immediately', 'gui', 'bool', - oils_i18n_gettext( - 'eg.acq.search.lineitems.run_immediately', - 'Acquisitions Search: Immediately Search Lineitems', - 'cwst', 'label') -), ( - 'eg.acq.search.purchaseorders.run_immediately', 'gui', 'bool', - oils_i18n_gettext( - 'eg.acq.search.purchaseorders.run_immediately', - 'Acquisitions Search: Immediately Search Purchase Orders', - 'cwst', 'label') -), ( - 'eg.acq.search.invoices.run_immediately', 'gui', 'bool', - oils_i18n_gettext( - 'eg.acq.search.invoices.run_immediately', - 'Acquisitions Search: Immediately Search Invoices', - 'cwst', 'label') -), ( - 'eg.acq.search.selectionlists.run_immediately', 'gui', 'bool', - oils_i18n_gettext( - 'eg.acq.search.selectionlists.run_immediately', - 'Acquisitions Search: Immediately Search Selection Lists', - 'cwst', 'label') -); - -INSERT INTO config.workstation_setting_type - (name, grp, datatype, label) -VALUES ( - 'eg.grid.acq.search.lineitems', 'gui', 'object', - oils_i18n_gettext( - 'eg.grid.acq.search.lineitems', - 'Grid Config: acq.search.lineitems', - 'cwst', 'label') -), ( - 'eg.grid.acq.search.purchaseorders', 'gui', 'object', - oils_i18n_gettext( - 'eg.grid.acq.search.purchaseorders', - 'Grid Config: acq.search.purchaseorders', - 'cwst', 'label') -), ( - 'eg.grid.acq.search.selectionlists', 'gui', 'object', - oils_i18n_gettext( - 'eg.grid.acq.search.selectionlists', - 'Grid Config: acq.search.selectionlists', - 'cwst', 'label') -), ( - 'eg.grid.acq.search.invoices', 'gui', 'object', - oils_i18n_gettext( - 'eg.grid.acq.search.invoices', - 'Grid Config: acq.search.invoices', - 'cwst', 'label') -); - -COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/YYYY.data.acq_permissions.sql b/Open-ILS/src/sql/Pg/upgrade/YYYY.data.acq_permissions.sql deleted file mode 100644 index 45e33fd6b1..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/YYYY.data.acq_permissions.sql +++ /dev/null @@ -1,65 +0,0 @@ -BEGIN; - -INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable) - SELECT - pgt.id, perm.id, aout.depth, TRUE - FROM - permission.grp_tree pgt, - permission.perm_list perm, - actor.org_unit_type aout - WHERE - pgt.name = 'Acquisitions Administrator' AND - aout.name = 'Consortium' AND - perm.code IN ( - 'VIEW_FUND', - 'VIEW_FUNDING_SOURCE', - 'VIEW_FUND_ALLOCATION', - 'VIEW_PICKLIST', - 'VIEW_PROVIDER', - 'VIEW_PURCHASE_ORDER', - 'VIEW_INVOICE', - 'CREATE_PICKLIST', - 'ACQ_ADD_LINEITEM_IDENTIFIER', - 'ACQ_SET_LINEITEM_IDENTIFIER', - 'MANAGE_FUND', - 'CREATE_INVOICE', - 'CREATE_PURCHASE_ORDER', - 'IMPORT_ACQ_LINEITEM_BIB_RECORD', - 'IMPORT_ACQ_LINEITEM_BIB_RECORD_UPLOAD', - 'MANAGE_CLAIM', - 'MANAGE_PROVIDER', - 'MANAGE_FUNDING_SOURCE', - 'RECEIVE_PURCHASE_ORDER', - 'ADMIN_ACQ_LINEITEM_ALERT_TEXT', - 'UPDATE_FUNDING_SOURCE', - 'UPDATE_PROVIDER', - 'VIEW_IMPORT_MATCH_SET', - 'VIEW_MERGE_PROFILE', - 'IMPORT_MARC' - ); - - -INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable) - SELECT - pgt.id, perm.id, aout.depth, FALSE - FROM - permission.grp_tree pgt, - permission.perm_list perm, - actor.org_unit_type aout - WHERE - pgt.name = 'Acquisitions' AND - aout.name = 'Consortium' AND - perm.code IN ( - 'ACQ_ADD_LINEITEM_IDENTIFIER', - 'ACQ_SET_LINEITEM_IDENTIFIER', - 'ADMIN_ACQ_FUND', - 'ADMIN_FUND', - 'ACQ_INVOICE-REOPEN', - 'ADMIN_ACQ_DISTRIB_FORMULA', - 'ADMIN_INVOICE', - 'IMPORT_ACQ_LINEITEM_BIB_RECORD_UPLOAD', - 'VIEW_IMPORT_MATCH_SET', - 'VIEW_MERGE_PROFILE' - ); - -COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/ZZZZ.schema.acq_state_views.sql b/Open-ILS/src/sql/Pg/upgrade/ZZZZ.schema.acq_state_views.sql deleted file mode 100644 index 2ed6c79bf0..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/ZZZZ.schema.acq_state_views.sql +++ /dev/null @@ -1,28 +0,0 @@ -BEGIN; - --- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); - -CREATE VIEW acq.li_state_label AS - SELECT * - FROM (VALUES - ('new', 'New'), - ('selector-ready', 'Selector-Ready'), - ('order-ready', 'Order-Ready'), - ('approved', 'Approved'), - ('pending-order', 'Pending-Order'), - ('on-order', 'On-Order'), - ('received', 'Received'), - ('cancelled', 'Cancelled') - ) AS t (id,label); - -CREATE VIEW acq.po_state_label AS - SELECT * - FROM (VALUES - ('new', 'New'), - ('pending', 'Pending'), - ('on-order', 'On-Order'), - ('received', 'Received'), - ('cancelled', 'Cancelled') - ) AS t (id,label); - -COMMIT;