Is it possible to reuse item numbers?

I did an import and ended up manually deleting all the items and now I have hundreds of unused numbers. Is it possible to reuse those as they don’t actually have an item attached to them?

Cheers
DC

Hi.

This thread, albeit for Omeka S, could give some hints: Reset Omeka S resource ID

I’m hoping there’s a way to do it without having to reset the database. I have a few thousand items that aren’t empty I don’t want to get rid of.

There is no safe way. It’s the nature of relational databases. Primary keys should not be reused.

At any rate, it’s purely cosmetic. Its ok and expected to have ID gaps.

If you still want to do something about it, you should first determine the highest ID used for a not-empty Item; then, you might use the following command in your database:

ALTER TABLE yourtablename AUTO_INCREMENT = newIDvalue

where newIDvalue is the value you’ve found before + 1

Remember that you might still have some gaps, though.

Hope this helps.

This topic was automatically closed 360 days after the last reply. New replies are no longer allowed.