3 DELETE FROM registration_registrationprofile;
5 -- unlink users who have contributed
7 UPDATE patchwork_person SET user_id = NULL
8 WHERE user_id IN (SELECT id FROM auth_user WHERE is_active = False)
9 AND id IN (SELECT DISTINCT submitter_id FROM patchwork_comment);
11 -- remove persons who only have a user linkage
13 DELETE FROM patchwork_person WHERE user_id IN
14 (SELECT id FROM auth_user WHERE is_active = False);
18 DELETE FROM patchwork_userprofile WHERE user_id IN
19 (SELECT id FROM auth_user WHERE is_active = False);
21 -- delete inactive users
23 DELETE FROM auth_user WHERE is_active = False;
25 DROP TABLE registration_registrationprofile;