Request Tracker: changing the ticket an email is attached to

Yesterday I realized that, for the nth time, I'd sent emails to my local Request Tracker with the wrong subject line -- and thus they were attached to the wrong ticket. Fixing this turned out to be relatively easy (though not necessarily convenient).

First off, get the attachment number for the email you're trying to move; you can do this by viewing the ticket in your browser and hovering over the "show full" link. Second, fire up your MySQL client and run:

update Transactions set ObjectId=(new ticket number) where id=(attachment number) limit 1;

So if the attachment number was 30043, and it should be attached to ticket 4090, you'd run:

update Transactions set ObjectId=4090 where id=30043 limit 1;

Sorted!