[Koha] updatedatabase.pl – 2nd request for help

Jürgen Eichenbrenner eichenbrenner at issev.de
Thu Apr 30 21:34:23 NZST 2015

A few days ago I complained here about:


Sorry, for nagging again. I have to be more specific.  It seems to me, there were changes of the database scheme, not reflected properly in the updatedatabase.pl script. It fails (with mysql error s150), when upgrading a database from 3.10 to any newer version of Koha, in creating the following three tables:

- borrower_attributes_types_branches
- categories_branches
- authorised_values_branches

For getting around this, I tried to create the (new 3.12) Koha scheme before I dump in the old 3.10 database dump into a new (3.12) installation. Even then I get errors (which I reported here a few days ago).

If I don't create the newer Koha database scheme beforehand, the "Web installer" gives errors like this:

updatedatabase.pl: DBD::mysql::db do failed: Can't create table 'koha312.categories_branches' (errno: 150) at /usr/share/koha/intranet/cgi-bin/installer/data/mysql/updatedatabase.pl line 6120.

In fact, these statement, like the one from line 6120:
CREATE TABLE categories_branches(categorycode VARCHAR(10), branchcode VARCHAR(10), FOREIGN KEY (categorycode) REFERENCES categories(categorycode) ON DELETE CASCADE, FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE ) ENGINE=INNODB DEFAULT CHARSET=utf8;
are failing with mysql error 150.

Besides of the three additional table creations, there are 6 duplicate entries of PRIMARY keys in the tables:

And a duplicate key name:

Because of this I'm stuck with 3.10 and appreciate any hints and help for getting this solved properly.

Jürgen Eichenbrenner
Int. School of Stuttgart

More information about the Koha mailing list