[open-ils-commits] [GIT] Evergreen ILS branch rel_3_2 updated. c233141a4e4c443ded1643fe949039023fc8bb9a

Evergreen Git git at git.evergreen-ils.org
Tue Oct 1 17:09:06 EDT 2019


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_3_2 has been updated
       via  c233141a4e4c443ded1643fe949039023fc8bb9a (commit)
       via  affa5a97d6b723fe0af8e7583162626f18055499 (commit)
      from  24fd99b4e29cd34e79642441d5d908fb038d54cb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c233141a4e4c443ded1643fe949039023fc8bb9a
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Tue Oct 1 17:06:16 2019 -0400

    LP#1840669: stamp schema update
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 628964b76b..c216adc935 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 ('1171', :eg_version); -- rhamby/mstroup/gmcharlt
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1187', :eg_version); -- Dyrcona/gmcharlt
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.function.age_circ_on_delete-auto_renewal.sql b/Open-ILS/src/sql/Pg/upgrade/1187.function.age_circ_on_delete-auto_renewal.sql
similarity index 96%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.function.age_circ_on_delete-auto_renewal.sql
rename to Open-ILS/src/sql/Pg/upgrade/1187.function.age_circ_on_delete-auto_renewal.sql
index 23eca5ed77..d835d8df5b 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.function.age_circ_on_delete-auto_renewal.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/1187.function.age_circ_on_delete-auto_renewal.sql
@@ -1,6 +1,6 @@
 BEGIN;
 
---SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('1187', :eg_version);
 
 CREATE OR REPLACE FUNCTION action.age_circ_on_delete () RETURNS TRIGGER AS $$
 DECLARE

commit affa5a97d6b723fe0af8e7583162626f18055499
Author: Jason Stephenson <jason at sigio.com>
Date:   Thu Aug 29 10:03:50 2019 -0400

    Lp 1840669: Handle autorenewals when aging circulations
    
    Add auto_renewal and auto_renewal_remaining fields to the
    action.age_circ_on_delete trigger function.
    
    Signed-off-by: Jason Stephenson <jason at sigio.com>
    Signed-off-by: John Amundson <jamundson at cwmars.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/sql/Pg/090.schema.action.sql b/Open-ILS/src/sql/Pg/090.schema.action.sql
index b2d2e185ac..187b88e7d2 100644
--- a/Open-ILS/src/sql/Pg/090.schema.action.sql
+++ b/Open-ILS/src/sql/Pg/090.schema.action.sql
@@ -340,14 +340,16 @@ BEGIN
         circ_lib, circ_staff, checkin_staff, checkin_lib, renewal_remaining, grace_period, due_date,
         stop_fines_time, checkin_time, create_time, duration, fine_interval, recurring_fine,
         max_fine, phone_renewal, desk_renewal, opac_renewal, duration_rule, recurring_fine_rule,
-        max_fine_rule, stop_fines, workstation, checkin_workstation, checkin_scan_time, parent_circ)
+        max_fine_rule, stop_fines, workstation, checkin_workstation, checkin_scan_time, parent_circ,
+        auto_renewal, auto_renewal_remaining)
       SELECT
         id,usr_post_code, usr_home_ou, usr_profile, usr_birth_year, copy_call_number, copy_location,
         copy_owning_lib, copy_circ_lib, copy_bib_record, xact_start, xact_finish, target_copy,
         circ_lib, circ_staff, checkin_staff, checkin_lib, renewal_remaining, grace_period, due_date,
         stop_fines_time, checkin_time, create_time, duration, fine_interval, recurring_fine,
         max_fine, phone_renewal, desk_renewal, opac_renewal, duration_rule, recurring_fine_rule,
-        max_fine_rule, stop_fines, workstation, checkin_workstation, checkin_scan_time, parent_circ
+        max_fine_rule, stop_fines, workstation, checkin_workstation, checkin_scan_time, parent_circ,
+        auto_renewal, auto_renewal_remaining
         FROM action.all_circulation WHERE id = OLD.id;
 
     RETURN OLD;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.function.age_circ_on_delete-auto_renewal.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.function.age_circ_on_delete-auto_renewal.sql
new file mode 100644
index 0000000000..23eca5ed77
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.function.age_circ_on_delete-auto_renewal.sql
@@ -0,0 +1,47 @@
+BEGIN;
+
+--SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+CREATE OR REPLACE FUNCTION action.age_circ_on_delete () RETURNS TRIGGER AS $$
+DECLARE
+found char := 'N';
+BEGIN
+
+    -- If there are any renewals for this circulation, don't archive or delete
+    -- it yet.   We'll do so later, when we archive and delete the renewals.
+
+    SELECT 'Y' INTO found
+    FROM action.circulation
+    WHERE parent_circ = OLD.id
+    LIMIT 1;
+
+    IF found = 'Y' THEN
+        RETURN NULL;  -- don't delete
+	END IF;
+
+    -- Archive a copy of the old row to action.aged_circulation
+
+    INSERT INTO action.aged_circulation
+        (id,usr_post_code, usr_home_ou, usr_profile, usr_birth_year, copy_call_number, copy_location,
+        copy_owning_lib, copy_circ_lib, copy_bib_record, xact_start, xact_finish, target_copy,
+        circ_lib, circ_staff, checkin_staff, checkin_lib, renewal_remaining, grace_period, due_date,
+        stop_fines_time, checkin_time, create_time, duration, fine_interval, recurring_fine,
+        max_fine, phone_renewal, desk_renewal, opac_renewal, duration_rule, recurring_fine_rule,
+        max_fine_rule, stop_fines, workstation, checkin_workstation, checkin_scan_time, parent_circ,
+        auto_renewal, auto_renewal_remaining)
+      SELECT
+        id,usr_post_code, usr_home_ou, usr_profile, usr_birth_year, copy_call_number, copy_location,
+        copy_owning_lib, copy_circ_lib, copy_bib_record, xact_start, xact_finish, target_copy,
+        circ_lib, circ_staff, checkin_staff, checkin_lib, renewal_remaining, grace_period, due_date,
+        stop_fines_time, checkin_time, create_time, duration, fine_interval, recurring_fine,
+        max_fine, phone_renewal, desk_renewal, opac_renewal, duration_rule, recurring_fine_rule,
+        max_fine_rule, stop_fines, workstation, checkin_workstation, checkin_scan_time, parent_circ,
+        auto_renewal, auto_renewal_remaining
+        FROM action.all_circulation WHERE id = OLD.id;
+
+    RETURN OLD;
+END;
+$$ LANGUAGE 'plpgsql';
+
+
+COMMIT;

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/sql/Pg/002.schema.config.sql                        | 2 +-
 Open-ILS/src/sql/Pg/090.schema.action.sql                        | 6 ++++--
 ...irc.sql => 1187.function.age_circ_on_delete-auto_renewal.sql} | 9 ++++++---
 3 files changed, 11 insertions(+), 6 deletions(-)
 copy Open-ILS/src/sql/Pg/upgrade/{0533.schema.fix_age_circ.sql => 1187.function.age_circ_on_delete-auto_renewal.sql} (88%)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list