We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8416
    • 173 Posts
    Hi,
    Is there a possibility to reset the document ID autoincrement functionality? In my case, lots of documents were deleted and I’d like to "reclame those IDs". I can change documents ID in the database but when I create a new document, new IDs will always start at the last higher number that was used even (if the document ID has been removed from the database). The last document Id must be stored somewhere for the auto-increment next value setting.
    I hope it make sense...

    Thanks

    Eric
      • 4310
      • 2,310 Posts
      In phpMyAdmin you go to the "modx_site_content" table and click the Operations tab you’ll see in Table Options a field for "auto_increment" you can set the next value to use there.
      Apart from the aesthetics of having sequential numbers there’s no real advantage in doing this.
      NB This is dangerous as it could wreck your content if you haven’t allocated the id’s correctly, bearing in mind the relationships between parents and children.

        • 3749
        • 24,544 Posts
        Most of us just live with the non-contiguous numbers because they’re harmless and there are risks in changing them. But, for future reference, one way of avoiding this situation is to re-use (re-purpose?) documents rather than deleting them.
        Bob
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting