https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19259 --- Comment #11 from Marc Véron <veron@veron.ch> --- (In reply to Marc Véron from comment #4)
Reading: https://dev.mysql.com/doc/refman/5.5/en/rename-table.html ------- RENAME TABLE changes internally generated foreign key constraint names and user-defined foreign key constraint names that contain the string “tbl_name_ibfk_” to reflect the new table name. InnoDB interprets foreign key constraint names that contain the string “tbl_name_ibfk_” as internally generated names.
Foreign key constraint names that point to the renamed table are automatically updated unless there is a conflict, in which case, the statement fails with an error. A conflict occurs if the renamed constraint name already exists. In such cases, you must drop and re-create the foreign keys in order for them to function properly. -------
Line 11590 in updatedatabase.pl renames table overduerules to old_overduerules, then it creates a new table overduerules.
The renaming action changed / renamed REFERENCES in constraints of overduerules_transport_types (maybe in other tables as well?).
That would explain that the error can not be reproduced on a fresh install (i.e. an install later than 3.23.00.007).
For the records: The database issue could be fixed with following hack: mysql> show create table overduerules_transport_types; (Verify that you see REFERENCES `old_overduerules`) mysql> RENAME TABLE overduerules TO old_overduerules; mysql> RENAME TABLE old_overduerules TO overduerules; mysql> show create table overduerules_transport_types; (Verify that REFERENCES has changed to REFERENCES `overduerules`) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.