From c2430c6ee0d90753bc55700e01f159ec259f7b0d Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Fri, 19 Nov 2021 11:52:54 -0500 Subject: [PATCH] Bug 29341: DBRev 21.05.05.005 Signed-off-by: Kyle M Hall --- installer/data/mysql/atomicupdate/bug_29341.pl | 17 ----------------- installer/data/mysql/updatedatabase.pl | 12 ++++++++++++ 2 files changed, 12 insertions(+), 17 deletions(-) delete mode 100755 installer/data/mysql/atomicupdate/bug_29341.pl diff --git a/installer/data/mysql/atomicupdate/bug_29341.pl b/installer/data/mysql/atomicupdate/bug_29341.pl deleted file mode 100755 index d9abc04b9c..0000000000 --- a/installer/data/mysql/atomicupdate/bug_29341.pl +++ /dev/null @@ -1,17 +0,0 @@ -use Modern::Perl; - -return { - bug_number => "29341", - description => "Remove foreign keys on pseudonymized_transactions", - up => sub { - my ($args) = @_; - my ($dbh, $out) = @$args{qw(dbh out)}; - for my $fk ( qw( pseudonymized_transactions_borrowers_ibfk_2 pseudonymized_transactions_borrowers_ibfk_3 pseudonymized_transactions_ibfk_1 ) ) { - if ( foreign_key_exists( 'pseudonymized_transactions', $fk ) ) { - $dbh->do(qq{ - ALTER TABLE pseudonymized_transactions DROP FOREIGN KEY $fk - }); - } - } - }, -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index e3866330b0..031334d210 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -24529,6 +24529,18 @@ if( CheckVersion( $DBversion ) ) { NewVersion( $DBversion, "29386", "Extend background_jobs.data to LONGTEXT" ); } +$DBversion = '21.05.05.005'; +if( CheckVersion( $DBversion ) ) { + for my $fk ( qw( pseudonymized_transactions_borrowers_ibfk_2 pseudonymized_transactions_borrowers_ibfk_3 pseudonymized_transactions_ibfk_1 ) ) { + if ( foreign_key_exists( 'pseudonymized_transactions', $fk ) ) { + $dbh->do(qq{ + ALTER TABLE pseudonymized_transactions DROP FOREIGN KEY $fk + }); + } + } + NewVersion( $DBversion, "29341", "Remove foreign keys on pseudonymized_transactions" ); +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/'; -- 2.39.5