From 91435189fee9d095677e6a0a0b9d8934823cba47 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 27 Feb 2019 09:07:28 -0500 Subject: [PATCH] Bug 21747: DBRev 18.12.00.017 Signed-off-by: Nick Clemens --- Koha.pm | 2 +- installer/data/mysql/atomicupdate/bug_21747.perl | 21 --------------------- installer/data/mysql/updatedatabase.pl | 19 +++++++++++++++++++ 3 files changed, 20 insertions(+), 22 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_21747.perl diff --git a/Koha.pm b/Koha.pm index 6cf205a748..668896325b 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 = "18.12.00.016"; +$VERSION = "18.12.00.017"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_21747.perl b/installer/data/mysql/atomicupdate/bug_21747.perl deleted file mode 100644 index 3cdaf8a958..0000000000 --- a/installer/data/mysql/atomicupdate/bug_21747.perl +++ /dev/null @@ -1,21 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - $dbh->do(q{ - INSERT IGNORE INTO account_offset_types ( type ) VALUES ( 'fine_increase' ), ( 'fine_decrease' ); - }); - - $dbh->do(q{ - UPDATE account_offsets SET type = 'fine_increase' WHERE type = 'Fine Update' AND amount > 0; - }); - - $dbh->do(q{ - UPDATE account_offsets SET type = 'fine_decrease' WHERE type = 'Fine Update' AND amount < 0; - }); - - $dbh->do(q{ - DELETE FROM account_offset_types WHERE type = 'Fine Update'; - }); - - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 21747 - Update account_offset_types to include 'fine_increase' and 'fine_decrease')\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index e74ed31fda..293cdd0d73 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -17400,6 +17400,25 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 20581 - Allow manual selection of custom ILL request statuses)\n"; } +$DBversion = '18.12.00.017'; +if( CheckVersion( $DBversion ) ) { + $dbh->do(q{ + INSERT IGNORE INTO account_offset_types ( type ) VALUES ( 'fine_increase' ), ( 'fine_decrease' ); + }); + $dbh->do(q{ + UPDATE account_offsets SET type = 'fine_increase' WHERE type = 'Fine Update' AND amount > 0; + }); + $dbh->do(q{ + UPDATE account_offsets SET type = 'fine_decrease' WHERE type = 'Fine Update' AND amount < 0; + }); + + $dbh->do(q{ + DELETE FROM account_offset_types WHERE type = 'Fine Update'; + }); + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 21747 - Update account_offset_types to include 'fine_increase' and 'fine_decrease')\n"; +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.11.0