From 63a2fde6c05e7259eb34d72df34f4254723dfa27 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 11 Mar 2026 09:02:42 -0400 Subject: [PATCH] Bug 42068: Update on bug 26993 breaks items deletions with a corrupted foreign key On bug 26993 we turned off foreign key checks to remove a unique constraint, then enabled them Test plan: 1) Run the db update for bug 42068 2) Attempt to delete an item from Koha or via mysql 3) Note the error 4) Reset your database to pre 42068 5) Apply this patch 6) Run the db update for bug 42068 7) Note you can delete items again! --- installer/data/mysql/db_revs/251200013.pl | 3 --- 1 file changed, 3 deletions(-) diff --git a/installer/data/mysql/db_revs/251200013.pl b/installer/data/mysql/db_revs/251200013.pl index 409a1a07b19..7cf39d55aa9 100755 --- a/installer/data/mysql/db_revs/251200013.pl +++ b/installer/data/mysql/db_revs/251200013.pl @@ -9,7 +9,6 @@ return { my ( $dbh, $out ) = @$args{qw(dbh out)}; if ( index_exists( 'items_last_borrower', 'itemnumber' ) ) { - $dbh->do('SET FOREIGN_KEY_CHECKS=0'); # Drop the unique index $dbh->do( @@ -17,8 +16,6 @@ return { ALTER TABLE items_last_borrower DROP INDEX itemnumber } ); - $dbh->do('SET FOREIGN_KEY_CHECKS=1'); - say_success( $out, "Adjusted foreign key constraints on items_last_borrower table" ); } -- 2.50.1 (Apple Git-155)