[Rt-devel] Question about the data model!

Ruslan U. Zakirov cubic at acronis.ru
Fri Jul 16 11:34:36 EDT 2004


May be you can test RTx::Shredder? :)

Sven Sternberger wrote:
> Hello!
> 
> I'm in the process of understanding the rt datamodel to clean up our 
> database. One think I don't understand if the query:
> 
> select Principals.id,PrincipalType from Principals
> left join Users on Principals.id=Users.id
> left join Groups on Principals.id=Groups.id
> where Users.id is NULL and Groups.id is NULL;
> 
> should give me an empty result or not. I think in "Principals"
> is one entry related to an user or a group?
It should be empty, but ...

> 
> In our database ther 150k row which related to nothing :-/
Oops. I think it's code in RT::Group::Delete.
     # TODO XXX
 
 

     # Remove the principal object
     # Remove this group from anything it's a member of.
     # Remove all cached members of this group
     # Remove any rights granted to this group
     # remove any rights delegated by way of this group 
 


I have 4k records.

> 
> best regards


More information about the Rt-devel mailing list