1 This is a set of SQL scripts to be run, in order, to completely
2 remove data belonging to an OU and its descendants in an Evergreen
3 database. Each script uses a variable called ou_to_del that should
4 be set to the shortname of the OU to remove.
6 Generate script to delete users:
8 SELECT 'DELETE FROM actor.usr WHERE id = ' || id || ';'
9 FROM actor.usr WHERE home_ou IN (
10 SELECT (actor.org_unit_descendants(id)).id FROM actor.org_unit
11 WHERE shortname = 'EXAMPLE'
14 After running through the scripts, it should be possible to
15 remove the actor.org_unit entries themselves.
19 -- remove event output that is no longer associated with any events