From: Mike Rylander Date: Wed, 28 Feb 2018 15:33:50 +0000 (-0500) Subject: Stamping upgrade scripts for new copy alerts X-Git-Url: https://git.evergreen-ils.org/?p=working%2FEvergreen.git;a=commitdiff_plain;h=f9159c9de6c2e90c8983d02854c0a3831daf9b1a Stamping upgrade scripts for new copy alerts 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 2a72ffe582..5dd5f78d18 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 ('1094', :eg_version); -- miker/kmlussier +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1098', :eg_version); -- gmcharlt/miker CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/1095.schema.copy_alerts.sql b/Open-ILS/src/sql/Pg/upgrade/1095.schema.copy_alerts.sql new file mode 100644 index 0000000000..ceaba7003f --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1095.schema.copy_alerts.sql @@ -0,0 +1,114 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('1095', :eg_version); + +CREATE OR REPLACE FUNCTION asset.copy_state (cid BIGINT) RETURNS TEXT AS $$ +DECLARE + last_circ_stop TEXT; + the_copy asset.copy%ROWTYPE; +BEGIN + + SELECT * INTO the_copy FROM asset.copy WHERE id = cid; + IF NOT FOUND THEN RETURN NULL; END IF; + + IF the_copy.status = 3 THEN -- Lost + RETURN 'LOST'; + ELSIF the_copy.status = 4 THEN -- Missing + RETURN 'MISSING'; + ELSIF the_copy.status = 14 THEN -- Damaged + RETURN 'DAMAGED'; + ELSIF the_copy.status = 17 THEN -- Lost and paid + RETURN 'LOST_AND_PAID'; + END IF; + + SELECT stop_fines INTO last_circ_stop + FROM action.circulation + WHERE target_copy = cid + ORDER BY xact_start DESC LIMIT 1; + + IF FOUND THEN + IF last_circ_stop IN ( + 'CLAIMSNEVERCHECKEDOUT', + 'CLAIMSRETURNED', + 'LONGOVERDUE' + ) THEN + RETURN last_circ_stop; + END IF; + END IF; + + RETURN 'NORMAL'; +END; +$$ LANGUAGE PLPGSQL; + +CREATE TYPE config.copy_alert_type_state AS ENUM ( + 'NORMAL', + 'LOST', + 'LOST_AND_PAID', + 'MISSING', + 'DAMAGED', + 'CLAIMSRETURNED', + 'LONGOVERDUE', + 'CLAIMSNEVERCHECKEDOUT' +); + +CREATE TYPE config.copy_alert_type_event AS ENUM ( + 'CHECKIN', + 'CHECKOUT' +); + +CREATE TABLE config.copy_alert_type ( + id serial primary key, -- reserve 1-100 for system + scope_org int not null references actor.org_unit (id) on delete cascade, + active bool not null default true, + name text not null unique, + state config.copy_alert_type_state, + event config.copy_alert_type_event, + in_renew bool, + invert_location bool not null default false, + at_circ bool, + at_owning bool, + next_status int[] +); +SELECT SETVAL('config.copy_alert_type_id_seq'::TEXT, 100); + +CREATE OR REPLACE FUNCTION evergreen.asset_copy_alert_copy_inh_fkey() RETURNS TRIGGER AS $f$ +BEGIN + PERFORM 1 FROM asset.copy WHERE id = NEW.copy; + IF NOT FOUND THEN + RAISE foreign_key_violation USING MESSAGE = FORMAT( + $$Referenced asset.copy id not found, copy:%s$$, NEW.copy + ); + END IF; + RETURN NEW; +END; +$f$ LANGUAGE PLPGSQL VOLATILE COST 50; + +CREATE CONSTRAINT TRIGGER inherit_asset_copy_alert_copy_fkey + AFTER UPDATE OR INSERT ON asset.copy_alert + DEFERRABLE FOR EACH ROW EXECUTE PROCEDURE evergreen.asset_copy_alert_copy_inh_fkey(); + +CREATE TABLE actor.copy_alert_suppress ( + id serial primary key, + org int not null references actor.org_unit (id) on delete cascade, + alert_type int not null references config.copy_alert_type (id) on delete cascade +); + +CREATE TABLE asset.copy_alert ( + id bigserial primary key, + alert_type int not null references config.copy_alert_type (id) on delete cascade, + copy bigint not null, + temp bool not null default false, + create_time timestamptz not null default now(), + create_staff bigint not null references actor.usr (id) on delete set null, + note text, + ack_time timestamptz, + ack_staff bigint references actor.usr (id) on delete set null +); + +CREATE VIEW asset.active_copy_alert AS + SELECT * + FROM asset.copy_alert + WHERE ack_time IS NULL; + +COMMIT; + diff --git a/Open-ILS/src/sql/Pg/upgrade/1096.data.stock_copy_alert_types.sql b/Open-ILS/src/sql/Pg/upgrade/1096.data.stock_copy_alert_types.sql new file mode 100644 index 0000000000..4a91997219 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1096.data.stock_copy_alert_types.sql @@ -0,0 +1,64 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('1096', :eg_version); + +-- staff-usable alert types with no location awareness +INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew) +VALUES (1, 1, TRUE, 'Normal checkout', 'NORMAL', 'CHECKOUT', FALSE); +INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew) +VALUES (2, 1, TRUE, 'Normal checkin', 'NORMAL', 'CHECKIN', FALSE); +INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew) +VALUES (3, 1, FALSE, 'Normal renewal', 'NORMAL', 'CHECKIN', TRUE); + +-- copy alerts upon checkin or renewal of exceptional copy statuses are not active by +-- default; they're meant to be turned once a site is ready to fully +-- commit to using the webstaff client for circulation +INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) +VALUES (4, 1, FALSE, 'Checkin of lost copy', 'LOST', 'CHECKIN'); +INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) +VALUES (5, 1, FALSE, 'Checkin of missing copy', 'MISSING', 'CHECKIN'); +INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) +VALUES (6, 1, FALSE, 'Checkin of lost-and-paid copy', 'LOST_AND_PAID', 'CHECKIN'); +INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) +VALUES (7, 1, FALSE, 'Checkin of damaged copy', 'DAMAGED', 'CHECKIN'); +INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) +VALUES (8, 1, FALSE, 'Checkin of claims-returned copy', 'CLAIMSRETURNED', 'CHECKIN'); +INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) +VALUES (9, 1, FALSE, 'Checkin of long overdue copy', 'LONGOVERDUE', 'CHECKIN'); +INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) +VALUES (10, 1, FALSE, 'Checkin of claims-never-checked-out copy', 'CLAIMSNEVERCHECKEDOUT', 'CHECKIN'); + +-- copy alerts upon checkout of exceptional copy statuses are not active by +-- default; they're meant to be turned once a site is ready to fully +-- commit to using the webstaff client for circulation +INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) +VALUES (11, 1, FALSE, 'Checkout of lost copy', 'LOST', 'CHECKOUT'); +INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) +VALUES (12, 1, FALSE, 'Checkout of missing copy', 'MISSING', 'CHECKOUT'); +INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) +VALUES (13, 1, FALSE, 'Checkout of lost-and-paid copy', 'LOST_AND_PAID', 'CHECKOUT'); +INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) +VALUES (14, 1, FALSE, 'Checkout of damaged copy', 'DAMAGED', 'CHECKOUT'); +INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) +VALUES (15, 1, FALSE, 'Checkout of claims-returned copy', 'CLAIMSRETURNED', 'CHECKOUT'); +INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) +VALUES (16, 1, FALSE, 'Checkout of long overdue copy', 'LONGOVERDUE', 'CHECKOUT'); +INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) +VALUES (17, 1, FALSE, 'Checkout of claims-never-checked-out copy', 'CLAIMSNEVERCHECKEDOUT', 'CHECKOUT'); + +-- staff-usable alert types based on location +INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew, at_circ) +VALUES (18, 1, FALSE, 'Normal checkout at circ lib', 'NORMAL', 'CHECKOUT', FALSE, TRUE); +INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew, at_circ) +VALUES (19, 1, FALSE, 'Normal checkin at circ lib', 'NORMAL', 'CHECKIN', FALSE, TRUE); +INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew, at_circ) +VALUES (20, 1, FALSE, 'Normal renewal at circ lib', 'NORMAL', 'CHECKIN', TRUE, TRUE); + +INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew, at_owning) +VALUES (21, 1, FALSE, 'Normal checkout at owning lib', 'NORMAL', 'CHECKOUT', FALSE, TRUE); +INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew, at_owning) +VALUES (22, 1, FALSE, 'Normal checkin at owning lib', 'NORMAL', 'CHECKIN', FALSE, TRUE); +INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew, at_owning) +VALUES (23, 1, FALSE, 'Normal renewal at owning lib', 'NORMAL', 'CHECKIN', TRUE, TRUE); + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/1097.data.yaous_for_open_circ_exists_fine_handling.sql b/Open-ILS/src/sql/Pg/upgrade/1097.data.yaous_for_open_circ_exists_fine_handling.sql new file mode 100644 index 0000000000..d3a706d4ee --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1097.data.yaous_for_open_circ_exists_fine_handling.sql @@ -0,0 +1,35 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('1097', :eg_version); + +INSERT INTO config.org_unit_setting_type + (name, grp, label, description, datatype) + VALUES + ('circ.copy_alerts.forgive_fines_on_lost_checkin', + 'circ', + oils_i18n_gettext('circ.copy_alerts.forgive_fines_on_lost_checkin', + 'Forgive fines when checking out a lost item and copy alert is suppressed?', + 'coust', 'label'), + oils_i18n_gettext('circ.copy_alerts.forgive_fines_on_lost_checkin', + 'Controls whether fines are automatically forgiven when checking out an '|| + 'item that has been marked as lost, and the corresponding copy alert has been '|| + 'suppressed.', + 'coust', 'description'), + 'bool'); + +INSERT INTO config.org_unit_setting_type + (name, grp, label, description, datatype) + VALUES + ('circ.copy_alerts.forgive_fines_on_long_overdue_checkin', + 'circ', + oils_i18n_gettext('circ.copy_alerts.forgive_fines_on_long_overdue_checkin', + 'Forgive fines when checking out a long-overdue item and copy alert is suppressed?', + 'coust', 'label'), + oils_i18n_gettext('circ.copy_alerts.forgive_fines_on_lost_checkin', + 'Controls whether fines are automatically forgiven when checking out an '|| + 'item that has been marked as lost, and the corresponding copy alert has been '|| + 'suppressed.', + 'coust', 'description'), + 'bool'); + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/1098.data.move_legacy_copy_alerts.sql b/Open-ILS/src/sql/Pg/upgrade/1098.data.move_legacy_copy_alerts.sql new file mode 100644 index 0000000000..fa7fa0c41e --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1098.data.move_legacy_copy_alerts.sql @@ -0,0 +1,23 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('1098', :eg_version); + +\qecho Copying copy alert messages to normal checkout copy alerts... +INSERT INTO asset.copy_alert (alert_type, copy, note, create_staff) +SELECT 1, id, alert_message, 1 +FROM asset.copy +WHERE alert_message IS NOT NULL +AND alert_message <> ''; + +\qecho Copying copy alert messages to normal checkin copy alerts... +INSERT INTO asset.copy_alert (alert_type, copy, note, create_staff) +SELECT 2, id, alert_message, 1 +FROM asset.copy +WHERE alert_message IS NOT NULL +AND alert_message <> ''; + +\qecho Clearing legacy copy alert field; this may take a while +UPDATE asset.copy SET alert_message = NULL +WHERE alert_message IS NOT NULL; + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.copy_alerts.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.copy_alerts.sql deleted file mode 100644 index 993b6790b2..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.copy_alerts.sql +++ /dev/null @@ -1,112 +0,0 @@ -BEGIN; - -CREATE OR REPLACE FUNCTION asset.copy_state (cid BIGINT) RETURNS TEXT AS $$ -DECLARE - last_circ_stop TEXT; - the_copy asset.copy%ROWTYPE; -BEGIN - - SELECT * INTO the_copy FROM asset.copy WHERE id = cid; - IF NOT FOUND THEN RETURN NULL; END IF; - - IF the_copy.status = 3 THEN -- Lost - RETURN 'LOST'; - ELSIF the_copy.status = 4 THEN -- Missing - RETURN 'MISSING'; - ELSIF the_copy.status = 14 THEN -- Damaged - RETURN 'DAMAGED'; - ELSIF the_copy.status = 17 THEN -- Lost and paid - RETURN 'LOST_AND_PAID'; - END IF; - - SELECT stop_fines INTO last_circ_stop - FROM action.circulation - WHERE target_copy = cid - ORDER BY xact_start DESC LIMIT 1; - - IF FOUND THEN - IF last_circ_stop IN ( - 'CLAIMSNEVERCHECKEDOUT', - 'CLAIMSRETURNED', - 'LONGOVERDUE' - ) THEN - RETURN last_circ_stop; - END IF; - END IF; - - RETURN 'NORMAL'; -END; -$$ LANGUAGE PLPGSQL; - -CREATE TYPE config.copy_alert_type_state AS ENUM ( - 'NORMAL', - 'LOST', - 'LOST_AND_PAID', - 'MISSING', - 'DAMAGED', - 'CLAIMSRETURNED', - 'LONGOVERDUE', - 'CLAIMSNEVERCHECKEDOUT' -); - -CREATE TYPE config.copy_alert_type_event AS ENUM ( - 'CHECKIN', - 'CHECKOUT' -); - -CREATE TABLE config.copy_alert_type ( - id serial primary key, -- reserve 1-100 for system - scope_org int not null references actor.org_unit (id) on delete cascade, - active bool not null default true, - name text not null unique, - state config.copy_alert_type_state, - event config.copy_alert_type_event, - in_renew bool, - invert_location bool not null default false, - at_circ bool, - at_owning bool, - next_status int[] -); -SELECT SETVAL('config.copy_alert_type_id_seq'::TEXT, 100); - -CREATE OR REPLACE FUNCTION evergreen.asset_copy_alert_copy_inh_fkey() RETURNS TRIGGER AS $f$ -BEGIN - PERFORM 1 FROM asset.copy WHERE id = NEW.copy; - IF NOT FOUND THEN - RAISE foreign_key_violation USING MESSAGE = FORMAT( - $$Referenced asset.copy id not found, copy:%s$$, NEW.copy - ); - END IF; - RETURN NEW; -END; -$f$ LANGUAGE PLPGSQL VOLATILE COST 50; - -CREATE CONSTRAINT TRIGGER inherit_asset_copy_alert_copy_fkey - AFTER UPDATE OR INSERT ON asset.copy_alert - DEFERRABLE FOR EACH ROW EXECUTE PROCEDURE evergreen.asset_copy_alert_copy_inh_fkey(); - -CREATE TABLE actor.copy_alert_suppress ( - id serial primary key, - org int not null references actor.org_unit (id) on delete cascade, - alert_type int not null references config.copy_alert_type (id) on delete cascade -); - -CREATE TABLE asset.copy_alert ( - id bigserial primary key, - alert_type int not null references config.copy_alert_type (id) on delete cascade, - copy bigint not null, - temp bool not null default false, - create_time timestamptz not null default now(), - create_staff bigint not null references actor.usr (id) on delete set null, - note text, - ack_time timestamptz, - ack_staff bigint references actor.usr (id) on delete set null -); - -CREATE VIEW asset.active_copy_alert AS - SELECT * - FROM asset.copy_alert - WHERE ack_time IS NULL; - -COMMIT; - diff --git a/Open-ILS/src/sql/Pg/upgrade/YYYY.data.stock_copy_alert_types.sql b/Open-ILS/src/sql/Pg/upgrade/YYYY.data.stock_copy_alert_types.sql deleted file mode 100644 index ae79a9ca13..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/YYYY.data.stock_copy_alert_types.sql +++ /dev/null @@ -1,62 +0,0 @@ -BEGIN; - --- staff-usable alert types with no location awareness -INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew) -VALUES (1, 1, TRUE, 'Normal checkout', 'NORMAL', 'CHECKOUT', FALSE); -INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew) -VALUES (2, 1, TRUE, 'Normal checkin', 'NORMAL', 'CHECKIN', FALSE); -INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew) -VALUES (3, 1, FALSE, 'Normal renewal', 'NORMAL', 'CHECKIN', TRUE); - --- copy alerts upon checkin or renewal of exceptional copy statuses are not active by --- default; they're meant to be turned once a site is ready to fully --- commit to using the webstaff client for circulation -INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) -VALUES (4, 1, FALSE, 'Checkin of lost copy', 'LOST', 'CHECKIN'); -INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) -VALUES (5, 1, FALSE, 'Checkin of missing copy', 'MISSING', 'CHECKIN'); -INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) -VALUES (6, 1, FALSE, 'Checkin of lost-and-paid copy', 'LOST_AND_PAID', 'CHECKIN'); -INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) -VALUES (7, 1, FALSE, 'Checkin of damaged copy', 'DAMAGED', 'CHECKIN'); -INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) -VALUES (8, 1, FALSE, 'Checkin of claims-returned copy', 'CLAIMSRETURNED', 'CHECKIN'); -INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) -VALUES (9, 1, FALSE, 'Checkin of long overdue copy', 'LONGOVERDUE', 'CHECKIN'); -INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) -VALUES (10, 1, FALSE, 'Checkin of claims-never-checked-out copy', 'CLAIMSNEVERCHECKEDOUT', 'CHECKIN'); - --- copy alerts upon checkout of exceptional copy statuses are not active by --- default; they're meant to be turned once a site is ready to fully --- commit to using the webstaff client for circulation -INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) -VALUES (11, 1, FALSE, 'Checkout of lost copy', 'LOST', 'CHECKOUT'); -INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) -VALUES (12, 1, FALSE, 'Checkout of missing copy', 'MISSING', 'CHECKOUT'); -INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) -VALUES (13, 1, FALSE, 'Checkout of lost-and-paid copy', 'LOST_AND_PAID', 'CHECKOUT'); -INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) -VALUES (14, 1, FALSE, 'Checkout of damaged copy', 'DAMAGED', 'CHECKOUT'); -INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) -VALUES (15, 1, FALSE, 'Checkout of claims-returned copy', 'CLAIMSRETURNED', 'CHECKOUT'); -INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) -VALUES (16, 1, FALSE, 'Checkout of long overdue copy', 'LONGOVERDUE', 'CHECKOUT'); -INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event) -VALUES (17, 1, FALSE, 'Checkout of claims-never-checked-out copy', 'CLAIMSNEVERCHECKEDOUT', 'CHECKOUT'); - --- staff-usable alert types based on location -INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew, at_circ) -VALUES (18, 1, FALSE, 'Normal checkout at circ lib', 'NORMAL', 'CHECKOUT', FALSE, TRUE); -INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew, at_circ) -VALUES (19, 1, FALSE, 'Normal checkin at circ lib', 'NORMAL', 'CHECKIN', FALSE, TRUE); -INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew, at_circ) -VALUES (20, 1, FALSE, 'Normal renewal at circ lib', 'NORMAL', 'CHECKIN', TRUE, TRUE); - -INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew, at_owning) -VALUES (21, 1, FALSE, 'Normal checkout at owning lib', 'NORMAL', 'CHECKOUT', FALSE, TRUE); -INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew, at_owning) -VALUES (22, 1, FALSE, 'Normal checkin at owning lib', 'NORMAL', 'CHECKIN', FALSE, TRUE); -INSERT INTO config.copy_alert_type (id, scope_org, active, name, state, event, in_renew, at_owning) -VALUES (23, 1, FALSE, 'Normal renewal at owning lib', 'NORMAL', 'CHECKIN', TRUE, TRUE); - -COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/ZZZA.data.move_legacy_copy_alerts.sql b/Open-ILS/src/sql/Pg/upgrade/ZZZA.data.move_legacy_copy_alerts.sql deleted file mode 100644 index f430cbfb45..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/ZZZA.data.move_legacy_copy_alerts.sql +++ /dev/null @@ -1,23 +0,0 @@ -BEGIN; - ---- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); - -\qecho Copying copy alert messages to normal checkout copy alerts... -INSERT INTO asset.copy_alert (alert_type, copy, note, create_staff) -SELECT 1, id, alert_message, 1 -FROM asset.copy -WHERE alert_message IS NOT NULL -AND alert_message <> ''; - -\qecho Copying copy alert messages to normal checkin copy alerts... -INSERT INTO asset.copy_alert (alert_type, copy, note, create_staff) -SELECT 2, id, alert_message, 1 -FROM asset.copy -WHERE alert_message IS NOT NULL -AND alert_message <> ''; - -\qecho Clearing legacy copy alert field; this may take a while -UPDATE asset.copy SET alert_message = NULL -WHERE alert_message IS NOT NULL; - -COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/ZZZZ.data.yaous_for_open_circ_exists_fine_handling.sql b/Open-ILS/src/sql/Pg/upgrade/ZZZZ.data.yaous_for_open_circ_exists_fine_handling.sql deleted file mode 100644 index 4235527112..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/ZZZZ.data.yaous_for_open_circ_exists_fine_handling.sql +++ /dev/null @@ -1,35 +0,0 @@ -BEGIN; - ---- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); - -INSERT INTO config.org_unit_setting_type - (name, grp, label, description, datatype) - VALUES - ('circ.copy_alerts.forgive_fines_on_lost_checkin', - 'circ', - oils_i18n_gettext('circ.copy_alerts.forgive_fines_on_lost_checkin', - 'Forgive fines when checking out a lost item and copy alert is suppressed?', - 'coust', 'label'), - oils_i18n_gettext('circ.copy_alerts.forgive_fines_on_lost_checkin', - 'Controls whether fines are automatically forgiven when checking out an '|| - 'item that has been marked as lost, and the corresponding copy alert has been '|| - 'suppressed.', - 'coust', 'description'), - 'bool'); - -INSERT INTO config.org_unit_setting_type - (name, grp, label, description, datatype) - VALUES - ('circ.copy_alerts.forgive_fines_on_long_overdue_checkin', - 'circ', - oils_i18n_gettext('circ.copy_alerts.forgive_fines_on_long_overdue_checkin', - 'Forgive fines when checking out a long-overdue item and copy alert is suppressed?', - 'coust', 'label'), - oils_i18n_gettext('circ.copy_alerts.forgive_fines_on_lost_checkin', - 'Controls whether fines are automatically forgiven when checking out an '|| - 'item that has been marked as lost, and the corresponding copy alert has been '|| - 'suppressed.', - 'coust', 'description'), - 'bool'); - -COMMIT;