[rt-users] Deleting tickets 2

Steve Poirier steve at inet-technologies.com
Sat Aug 4 18:25:50 EDT 2001


Thanks! So, what i need to do is:

select id from Tickets where Status='dead';

You delete the Tickets where status is dead

Loop 1 with the array of dead tickets:
select id from Transactions where Ticket='$ticketid';

Loop 2 with array of transactions for this ticket

You delete all rows in Attachments where TransactionID = TransactionIDs

End loop 2

You delete all rows in table Transactions where Ticket='$ticketid';

You delete all rows in table Watchers where Value='$ticketid';

You delete all rows in table ObjectKeywords where ObjectId='$ticketid';

end loop 1

Is that it? If yes, i'll read the DBD-MySQL faq and build a perl script,
is it ok if i submit it to the list after testing?

Regards,
__
Steve Poirier
Project Manager
Inet-Technologies inc.

----- Original Message -----
From: "Jesse" <jesse at fsck.com>
To: "Steve Poirier" <steve at inet-technologies.com>
Cc: <rt-users at lists.fsck.com>
Sent: Saturday, August 04, 2001 2:00 PM
Subject: Re: [rt-users] Deleting tickets 2


> You'll also want to delete rows from the ObjectKeywords table and from the
> Watchers table that correspond to the ticket in question.  At some point,
> I'm planning on doing up a reaper script that can do this automatically
for
> "dead" tickets.
>
>
> On Sat, Aug 04, 2001 at 12:51:56PM -0400, Steve Poirier wrote:
> > Sorry but after some investigation i finally figured out a way to do it.
> >
> > Is this correct (Simple example):
> > select id from Transactions where Ticket=2700;
> > +------+
> > | id   |
> > +------+
> > | 6962 |
> > +------+
> > delete from Attachments where TransactionId=6962;
> > delete from Tickets where id=2700;
> >
> > Is that all i need to do?
> >
> > Regards,
> > __
> > Steve Poirier
> > Project Manager
> > Inet-Technologies inc.
> >
> >
> > _______________________________________________
> > rt-users mailing list
> > rt-users at lists.fsck.com
> > http://lists.fsck.com/mailman/listinfo/rt-users
> >
>
> --
> jesse reed vincent -- root at eruditorum.org -- jesse at fsck.com
> 70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90
>
> . . . when not in doubt, get in doubt.  -- Old Discordian Proveb
>
> _______________________________________________
> rt-users mailing list
> rt-users at lists.fsck.com
> http://lists.fsck.com/mailman/listinfo/rt-users
>





More information about the rt-users mailing list