How to fix number image
-
I deleted the image, After I created a new image but the number of photos did not decrease in order. Please help me to fix it. Thanks for all!
-
@kduy1508 I am not sure if you are aware of hoy databases work in general!? You have an id to identify entries and those need to be unique. So the technique used by almost all databases is to simply use a counter that keeps increasing no matter what. Even if you delete an entry the Id counter won’t go back.
If you really keen and know databases well you can take a dump, drop, manually edit the dump in several places to match ids and references and then let it re-create the whole lot from that modified dump file.
There is no good reason to do this I reckon. Why do you worry about those numbers??
-
Beacause, When i delete the images, the numbers of image did not decrease in order is non-aesthetic numbers
-
@kduy1508 Did you actually read and understand my last answer?
-
@Sebastian-Roth I wanted After deleting the image, the numbers will be recreated in order.
-
@kduy1508 FOG is open source und so you are free to modify it the way you want it to be. Go for it.
-
@Sebastian-Roth Please help me to path the fix number of image
-
@kduy1508 I wrote a script that fixes this, it will re-number the image IDs. Link is below. Very happy to provide this to you.
https://github.com/FOGProject/fog-community-scripts/tree/master/RenumberImageIDs -
@Wayne-Workman
Can you give me a path to insert this code? Many Thanks!