Bug 42067

Summary: Items can no longer be deleted after running the bug 26993 database update
Product: Koha Reporter: Kyle M Hall (khall) <kyle>
Component: Architecture, internals, and plumbingAssignee: Kyle M Hall (khall) <kyle>
Status: RESOLVED DUPLICATE QA Contact: Testopia <testopia>
Severity: blocker    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Crowdfunding committed: 0
Crowdfunding contact: Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Kyle M Hall (khall) 2026-03-11 12:26:00 UTC
Caused by bug 26993. 

I think this is because the db rev drops the UNIQUE KEY itemnumber from items_last_borrower using SET FOREIGN_KEY_CHECKS=0 to bypass MySQL's protection against dropping an index that backs a FK constraint. This leaves items_last_borrower_ibfk_1 intact in metadata but without a supporting index, causing all item deletions to fail with error 1451 even if items_last_borrower is empty.
Comment 1 Kyle M Hall (khall) 2026-03-11 12:40:31 UTC

*** This bug has been marked as a duplicate of bug 42068 ***