add disable/renable rule so that copy locations can be deleted in remove_ou scripts
[migration-tools.git] / remove_ou_data / README
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.
5
6 Generate script to delete users:
7
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'
12 );
13
14 After running through the scripts, it should be possible to
15 remove the actor.org_unit entries themselves.
16
17 TODO:
18
19 -- remove event output that is no longer associated with any events