[open-ils-commits] [GIT] Evergreen ILS branch master updated. 9fc06033c0805b3f1832e74c0953d243d1a9465d

Evergreen Git git at git.evergreen-ils.org
Wed Aug 24 14:53:11 EDT 2016


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, master has been updated
       via  9fc06033c0805b3f1832e74c0953d243d1a9465d (commit)
      from  12159383d46bf76db3e710a689ad8b5140436007 (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 9fc06033c0805b3f1832e74c0953d243d1a9465d
Author: Mike Rylander <mrylander at gmail.com>
Date:   Wed Aug 24 14:51:32 2016 -0400

    Moving function creation to later in the schema def, where its deps exist.
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 1e1dac8..d696bf5 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -1011,26 +1011,6 @@ CREATE TABLE config.usr_activity_type (
     CONSTRAINT  one_of_wwh CHECK (COALESCE(ewho,ewhat,ehow) IS NOT NULL)
 );
 
--- Remove all activity entries by activity type, 
--- except the most recent entry per user. 
-CREATE OR REPLACE FUNCTION 
-    actor.purge_usr_activity_by_type(act_type INTEGER) 
-    RETURNS VOID AS $$
-DECLARE
-    cur_usr INTEGER;
-BEGIN
-    FOR cur_usr IN SELECT DISTINCT(usr) 
-        FROM actor.usr_activity WHERE etype = act_type LOOP
-        DELETE FROM actor.usr_activity WHERE id IN (
-            SELECT id 
-            FROM actor.usr_activity 
-            WHERE usr = cur_usr AND etype = act_type
-            ORDER BY event_time DESC OFFSET 1
-        );
-
-    END LOOP;
-END $$ LANGUAGE PLPGSQL;
-
 CREATE UNIQUE INDEX unique_wwh ON config.usr_activity_type 
     (COALESCE(ewho,''), COALESCE (ewhat,''), COALESCE(ehow,''));
 
diff --git a/Open-ILS/src/sql/Pg/005.schema.actors.sql b/Open-ILS/src/sql/Pg/005.schema.actors.sql
index d7e3e6c..d44ac53 100644
--- a/Open-ILS/src/sql/Pg/005.schema.actors.sql
+++ b/Open-ILS/src/sql/Pg/005.schema.actors.sql
@@ -1031,4 +1031,24 @@ BEGIN
 END;
 $$ STRICT LANGUAGE PLPGSQL;
 
+-- Remove all activity entries by activity type, 
+-- except the most recent entry per user. 
+CREATE OR REPLACE FUNCTION
+    actor.purge_usr_activity_by_type(act_type INTEGER)
+    RETURNS VOID AS $$
+DECLARE
+    cur_usr INTEGER;
+BEGIN
+    FOR cur_usr IN SELECT DISTINCT(usr)
+        FROM actor.usr_activity WHERE etype = act_type LOOP
+        DELETE FROM actor.usr_activity WHERE id IN (
+            SELECT id
+            FROM actor.usr_activity
+            WHERE usr = cur_usr AND etype = act_type
+            ORDER BY event_time DESC OFFSET 1
+        );
+
+    END LOOP;
+END $$ LANGUAGE PLPGSQL;
+
 COMMIT;

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

Summary of changes:
 Open-ILS/src/sql/Pg/002.schema.config.sql |   20 --------------------
 Open-ILS/src/sql/Pg/005.schema.actors.sql |   20 ++++++++++++++++++++
 2 files changed, 20 insertions(+), 20 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list