[turba] Contact Cleanup

Jan Schneider jan at horde.org
Fri Nov 5 09:38:40 PST 2004


Please keep discussions on the list.

Zitat von Jason Sepinsky <jsepinsky at johnson.edu>:

>> DELETE FROM turba_objects WHERE owner_id='old_user'
>
> Unless I am missing something this would require me to first figure out
> all the user names that have been removed then run the delete for each
> user. From what I can tell there are potentially 100 or more users that
> have been deleted but still have contacts stored in the database. Is
> there any way to automate this task? In another 6 months this problem is
> likely to appear again as we are constantly adding and removing users to
> our system.

If you have a recent MySQL version, you could use subqueries. Something like
that (untested!):

DELETE FROM turba_objects WHERE owner_id NOT IN SELECT user_uid FROM
horde_users

assuming that you also use SQL for user management.

If that doesn't work, you need to write a script.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/


More information about the turba mailing list