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