From 0c630f9a56a139e6b25a5808a1e657a8e0730f84 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Mon, 26 Jun 2023 12:15:49 +0000 Subject: [PATCH] Bug 29390: Rename atomicupdate file Content-Type: text/plain; charset=utf-8 Renamed bug number too. Added a count since an existing FK or an error may impact the count (not to mention running the dbrev multiple times). Remove Dumper. Test plan: If running it previously worked, run it again and see 0 added. Signed-off-by: Marcel de Rooy --- .../data/mysql/atomicupdate/{bug_29336_2.pl => bug29390.pl} | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename installer/data/mysql/atomicupdate/{bug_29336_2.pl => bug29390.pl} (95%) diff --git a/installer/data/mysql/atomicupdate/bug_29336_2.pl b/installer/data/mysql/atomicupdate/bug29390.pl similarity index 95% rename from installer/data/mysql/atomicupdate/bug_29336_2.pl rename to installer/data/mysql/atomicupdate/bug29390.pl index cf97b304cb..863c6d9154 100755 --- a/installer/data/mysql/atomicupdate/bug_29336_2.pl +++ b/installer/data/mysql/atomicupdate/bug29390.pl @@ -1,8 +1,7 @@ use Modern::Perl; -use Data::Dumper; return { - bug_number => 29336, + bug_number => 29390, description => "Add missing FK constraints to authorised value categories", up => sub { my ($args) = @_; @@ -18,6 +17,7 @@ return { ); my $sql; + my $cnt = 0; foreach my $table ( sort keys %fix_tables ) { my $field = $fix_tables{$table}; next if foreign_key_exists( $table, undef, $field ); @@ -53,6 +53,8 @@ return { ON DELETE CASCADE ON UPDATE CASCADE |; $dbh->do($sql); + $cnt++; } + say $out "Added $cnt foreign key constraints."; }, } -- 2.30.2