From ebecee43a26a4efa2c84248f35a37ce0ac70eb94 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 28 Apr 2021 09:07:26 +0000 Subject: [PATCH] Bug 17202: DBRev 20.12.00.042 Signed-off-by: Jonathan Druart --- Koha.pm | 2 +- installer/data/mysql/atomicupdate/bug_17202.perl | 14 -------------- installer/data/mysql/updatedatabase.pl | 15 +++++++++++++++ 3 files changed, 16 insertions(+), 15 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_17202.perl diff --git a/Koha.pm b/Koha.pm index 413a5f2d43..b1cad76c63 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.12.00.041"; +$VERSION = "20.12.00.042"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_17202.perl b/installer/data/mysql/atomicupdate/bug_17202.perl deleted file mode 100644 index 85f3f41325..0000000000 --- a/installer/data/mysql/atomicupdate/bug_17202.perl +++ /dev/null @@ -1,14 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - unless( foreign_key_exists( 'collections_tracking', 'collectionst_ibfk_1' ) ) { - $dbh->do(q{ - DELETE FROM collections_tracking WHERE colId NOT IN ( SELECT colId FROM collections ) - }); - $dbh->do(q{ - ALTER TABLE collections_tracking - ADD CONSTRAINT `collectionst_ibfk_1` FOREIGN KEY (`colId`) REFERENCES `collections` (`colId`) ON DELETE CASCADE ON UPDATE CASCADE - }); - } - - NewVersion( $DBversion, 17202, "Add FK constraint for collection to collections_tracking"); -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 02defac2ef..2bfeb813cb 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -24151,6 +24151,21 @@ if ( CheckVersion($DBversion) ) { NewVersion( $DBversion, 26734, ["Update notices to use defaults", "WARNING - ACCOUNT_DEBIT and ACCOUNT_CREDIT slip templates have been replaced. Backups have been made to the action logs for your reference."] ); } +$DBversion = '20.12.00.042'; +if( CheckVersion( $DBversion ) ) { + unless( foreign_key_exists( 'collections_tracking', 'collectionst_ibfk_1' ) ) { + $dbh->do(q{ + DELETE FROM collections_tracking WHERE colId NOT IN ( SELECT colId FROM collections ) + }); + $dbh->do(q{ + ALTER TABLE collections_tracking + ADD CONSTRAINT `collectionst_ibfk_1` FOREIGN KEY (`colId`) REFERENCES `collections` (`colId`) ON DELETE CASCADE ON UPDATE CASCADE + }); + } + + NewVersion( $DBversion, 17202, "Add FK constraint for collection to collections_tracking"); +} + # 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.20.1