JBAS-2314 Patron expire date extension repair
authorBill Erickson <berickxx@gmail.com>
Mon, 15 Jul 2019 14:34:56 +0000 (10:34 -0400)
committerBill Erickson <berickxx@gmail.com>
Mon, 15 Jul 2019 14:51:46 +0000 (10:51 -0400)
Extend accounts whose last activity occurred after midnight the previous
day.  This fixes an issue where accounts whose latest activity is always
yesterday (e.g. scko logins) were never updated.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
KCLS/utility-scripts/patron_activity/patron_activity.sql

index 28757ab..d54d816 100644 (file)
@@ -6,7 +6,8 @@ UPDATE actor.usr usr
     FROM permission.grp_tree grp where grp.id = usr.profile and
     usr.id IN (
         SELECT DISTINCT(usr) FROM actor.usr_activity
-        WHERE event_time BETWEEN current_date - 2 AND current_date - 1
+        -- Events that occurred after midnight yesterday.
+        WHERE event_time > current_date - 1
         AND actor.usr_activity.usr IS NOT NULL
     ) 
     AND NOT barred