[Koha-devel] Biblio Auto-Increment location

Chris Cormack chrisc at catalyst.net.nz
Wed May 4 22:16:28 CEST 2022


Hi Bruce

There's a lot we can code around, cataloguing cats is definitely not one :)

Before you attempt the fix, please do a backup, just in case.

The good news is it is fairly simple, once you have deleted the
offending record, then in the database you can run

ALTER TABLE biblio AUTO_INCREMENT = new_number;

 (new_number should be the current highest + 1, you can do select
max(biblionumber) from biblio; to find the highest)

You'll also want to fix biblioitems and biblio_metadata
ALTER TABLE biblioitems AUTO_INCREMENT = new_number;
ALTER TABLE biblio_metadata AUTO_INCREMENT = new_number;

the new number for biblioitems is max biblioitemnumber + 1
and the new number for biblio_metadata is id + 1

Hope that helps.

Chris

And thanks for the new marketing slogan

Koha - So simple even the library cat can catalogue

On 5/05/22 07:18, Bruce A. Metcalf wrote:
> Greetings,
> 
> Sorry to post a support question here. No one else seems to know, but
> many think folks here might:
> 
> Thanks to help from our library cat, a biblio number was inserted that's
> several orders of magnitude greater than those in use. I have not found
> a way to reset this.
> 
> It's my guess that the highest previous value is stored somewhere, and
> incremented for each additional biblio. If someone could tell me where
> it's stored, I could reset it to the current value and not have a huge
> gap in the numbering.
> 
> Yes, I do appreciate that the numbers are just data-less markers, but
> I'd sill like to fix this.
> 
> Any help most appreciated.
> 
> Regards,
> / Bruce /
> Bruce A. Metcalf
> Augustan Library
> _______________________________________________
> Koha-devel mailing list
> Koha-devel at lists.koha-community.org
> https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : https://www.koha-community.org/
> git : https://git.koha-community.org/
> bugs : https://bugs.koha-community.org/


More information about the Koha-devel mailing list