From 6fb901ac87d069ca5d786cebd4cb68e07cbb047d Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Fri, 19 Nov 2021 11:52:54 -0500 Subject: [PATCH] Bug 29341: DBRev 20.11.11.002 Signed-off-by: Kyle M Hall (cherry picked from commit c2430c6ee0d90753bc55700e01f159ec259f7b0d) Signed-off-by: Fridolin Somers --- Koha.pm | 2 +- installer/data/mysql/atomicupdate/bug_29341.pl | 17 ----------------- installer/data/mysql/updatedatabase.pl | 12 ++++++++++++ 3 files changed, 13 insertions(+), 18 deletions(-) delete mode 100755 installer/data/mysql/atomicupdate/bug_29341.pl diff --git a/Koha.pm b/Koha.pm index b411223523..248038e8a2 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,7 +29,7 @@ use vars qw{ $VERSION }; # - #4 : the developer version. The 4th number is the database subversion. # used by developers when the database changes. updatedatabase take care of the changes itself # and is automatically called by Auth.pm when needed. -$VERSION = "20.11.11.001"; +$VERSION = "20.11.11.002"; sub version { return $VERSION; 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 287739c8c0..78718d8a38 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -23725,6 +23725,18 @@ if( CheckVersion( $DBversion ) ) { NewVersion( $DBversion, "29386", "Extend background_jobs.data to LONGTEXT" ); } +$DBversion = '20.11.11.002'; +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