]> git.evergreen-ils.org Git - Evergreen.git/blob - docs/modules/admin/pages/purge_user_activity.adoc
LP#1848524: ... and swap in the Antora docs
[Evergreen.git] / docs / modules / admin / pages / purge_user_activity.adoc
1 == Purge User Activity ==
2
3 User activity types are now set to transient by default for new
4 Evergreen installs.  This means only the most recent activity entry per
5 user per activity type is retained in the database.
6
7 .Use case
8 ****
9
10 Setting more user activity types collects less patron data, which helps
11 protect patron privacy. Additionally, the _actor.usr_activity_ table
12 gets really big really fast if all event types are non-transient.
13
14 ****
15
16 This change does not affect existing activity types, which were set to
17 non-transient by default.  To make an activity type transient, modify the
18 'Transient' field of the desired type in the staff client under Admin -> 
19 Server Administration -> User Activity Types.
20
21 Setting an activity type to transient means data for a given user will
22 be cleaned up automatically if and when the user performs the activity
23 in question.  However, administrators can also force an activity
24 cleanup via SQL.  This is useful for ensuring that all old activity
25 data is deleted and for controlling when the cleanup occurs, which 
26 may be useful on very large actor.usr_activity tables.
27
28 To force clean all activity types:
29
30 [source,sql]
31 ------------------------------------------------------------
32 SELECT actor.purge_usr_activity_by_type(etype.id)
33     FROM config.usr_activity_type etype;
34 ------------------------------------------------------------
35
36 NOTE: This could take hours to run on a very large actor.usr_activity table.