Fog Creek Software
Discussion Board




Explosion of case numbers

Regarding ,

http://www.fogcreek.com/FogBUGZ/KB/trouble/CaseNumbers.html

(Btw php.ini is not located in /etc if your using entropy.ch apache plugin, it's located in /usr/local/php/lib)

It seems that a mal formed email is causing the same problem with our Fogzbugs software. We have removed the offending email, but we stuck now with cases starting at 3800  when they used to start at 280. This is not acceptable for our Q/A system. What can I do to recover? 

Thanks

Lloyd Newby
Monday, July 26, 2004

I guess you are using MySQL as you have the php version of FogBugz.

I have done something similar but it does involve getting dirty in the database.

First you need to stop everyone from accessing the copy of FogBugz (stopping the webserver is the easiest way).

Using Navicat (www.navicat.com) or any similar package, you need to flush the tables so the data is up to date.

Next open the Bug table and remove all the cases that are duplicated.  You will then need to open the table in design mode and set the auto increment value to the number you want the cases to restart at, and then save this back to the database.

As you will probably have atleast one bugevent for each of these duplicate bugs, you may want to go in to the Bugevent table and remove all the bugevents where the bug field matches one of your duplicate bugs.  Again you may want to restart the auto incrementing back to a lower value, in design mode.

It is a bit involved and I suppose you could write an SQL query to do it for you, but I found it more reassuring to do it myself by hand.

One thing to remember to do, is to make a backup of the data before you start this as any mistake could kill the database.

Jon

Jon Tresadern
Monday, July 26, 2004

Hi Jon,

Thanks for the info. Fortunatly the offending email was the only one to come in over the weekend, so restoring the database to the pre-scrambled version worked ok. Next time I might not be so lucky and have to don the green elbo length rubber gloves and get stuck in to your database solution.

Thanks again,

Lloyd 

Lloyd Newby
Monday, July 26, 2004

No problems.

I learnt a few new things when I had to get my hands dirty, but hope never to have to again.

Jon

Jon Tresadern
Tuesday, July 27, 2004

*  Recent Topics

*  Fog Creek Home