Menu

Setting the serial number to zero without reinstalling

Help
2013-08-13
2013-08-14
  • Douglas Grindlay

    Our It team are now at the stage of transferring our Refbase veterinary database from the development and tests servers to our live server. During the testing of the import fuction, when we had issues with the import of the language field (requiring the new software version with the bug fix) and needed to tweak the Endnote output style to impoirt correctly, we made several batch imports and deletions of records. As result the serial numbers of records now start at around 1800.

    Is there an easy way to reset the serial numbers to 1 when we delete the existing records and import our final, pristine set of records?

    We have tried reinstalling the software from scratch on the Live server to reset the serial numbers, but had problems with the Language field again despite using the new software version, so instead our plan is to copy over the database from the Test server.

    Thanks,

    Douglas

     
  • Richard Karnesky

    Quite frankly, the best way is to recreate the database tables. Using the delete method built into refbase moves rows into a deleted table & allows an administrator to recover them using SQL. If you really can't just re-create the database, you would need to drop all rows from the deleted table & reset that counter too. To reset the counter, you would do something like:

      ALTER TABLE refs AUTO_INCREMENT = 1;
    

    But, again: it is strongly recommended that you just re-create the database.

     
  • Richard Karnesky

    Also note: This should only really be an aesthetic issue. There's nothing wrong starting with a serial around 1800 (you're not gonna run out).

     
  • Douglas Grindlay

    Thanks for that. We would like to start with 1 again if possible so the numbers reflect the number of records in the database and how recently a record has been added, especially as it is unlikely that any recors will be deleted once in the database.

     
  • Richard Karnesky

    The 'show all' link will tell you how many records are added and, since they are added sequentially, the serial would still provide an estimate of record age (but we actually keep created_date, created_time, modified_date, and modified_time behind the scenes).

     

Log in to post a comment.