From 4a57c1f779e9d7fff17df13e5b98f28ac6cf0302 Mon Sep 17 00:00:00 2001 From: Emily Lamancusa Date: Fri, 24 Apr 2026 11:25:22 -0400 Subject: [PATCH] Bug 39107: (QA follow-up) Use existing foreign_key_exists function Signed-off-by: Emily Lamancusa Signed-off-by: Lucas Gass --- installer/data/mysql/atomicupdate/bug_39107.pl | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_39107.pl b/installer/data/mysql/atomicupdate/bug_39107.pl index 1c67f9d13c..9d9e5c8c47 100755 --- a/installer/data/mysql/atomicupdate/bug_39107.pl +++ b/installer/data/mysql/atomicupdate/bug_39107.pl @@ -8,19 +8,7 @@ return { my ($args) = @_; my ( $dbh, $out ) = @$args{qw(dbh out)}; - # Check if the foreign key exists before trying to drop it - my $fk_exists = $dbh->selectrow_array( - q{ - SELECT COUNT(*) - FROM information_schema.TABLE_CONSTRAINTS - WHERE CONSTRAINT_SCHEMA = DATABASE() - AND TABLE_NAME = 'illrequests' - AND CONSTRAINT_NAME = 'illrequests_safk' - AND CONSTRAINT_TYPE = 'FOREIGN KEY' - } - ); - - if ($fk_exists) { + if ( foreign_key_exists( 'illrequests', 'illrequests_safk' ) ) { $dbh->do(q{ ALTER TABLE illrequests DROP FOREIGN KEY illrequests_safk }); say_success( $out, "Removed illrequests_safk FK constraint on illrequests.status_alias" ); } else {