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>
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