Resetting the Image numbers r4602
At work, our image IDs have reached into the 100s, it’s kinda ridiculous… because the lowest one is in the 80s I think.
I just reset my image IDs at home, going to try it at work tomorrow. Here’s what I did.
Figured out what my lowest Image ID was with this:
SELECT imageID FROM images ORDER BY imageID LIMIT 1;
The above query returned “7” for me on my home FOG server.
Then reset my image IDs in the images table, the imageGroupAssoc table, and the hosts table like this using the information provided by the previous query.
UPDATE images SET imageID = imageID - 7; UPDATE imageGroupAssoc SET igaImageID = igaImageID - 7; UPDATE hosts SET hostImage = hostImage - 7;
I then reset the auto-increment on the images table like this:
ALTER TABLE images AUTO_INCREMENT = 1;
it SEEMS to have worked… but I’m asking to be safe…
Following up here (a year later, yes I’m terrible).
I did this at work, it went fine.
Also, here’s a related thread that deals with the same issue but had problems: