From 6ec92845c7458bfe8fdc8071138aba4d4bb8418c Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 11 Jul 2019 16:24:16 +0100 Subject: [PATCH] Bug 18930: DBRev 19.06.00.011 Signed-off-by: Martin Renvoize --- Koha.pm | 2 +- installer/data/mysql/atomicupdate/bug_18930.perl | 17 ----------------- installer/data/mysql/updatedatabase.pl | 18 ++++++++++++++++++ 3 files changed, 19 insertions(+), 18 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_18930.perl diff --git a/Koha.pm b/Koha.pm index 4a58bea..8c74a90 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 = "19.06.00.010"; +$VERSION = "19.06.00.011"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_18930.perl b/installer/data/mysql/atomicupdate/bug_18930.perl deleted file mode 100644 index 92be5bd..0000000 --- a/installer/data/mysql/atomicupdate/bug_18930.perl +++ /dev/null @@ -1,17 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - - if ( TableExists('refund_lost_item_fee_rules') ) { - if ( column_exists( 'refund_lost_item_fee_rules', 'refund' ) ) { - $dbh->do(" - INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value ) - SELECT NULL, IF(branchcode='*', NULL, branchcode), NULL, 'refund', refund - FROM refund_lost_item_fee_rules - "); - $dbh->do("DROP TABLE refund_lost_item_fee_rules"); - } - } - - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 18930 - Move lost item refund rules to circulation_rules table)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 603dc34..3289c3f 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -18881,6 +18881,24 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 18928 - Move holdallowed, hold_fulfillment_policy, returnbranch to circulation_rules)\n"; } +$DBversion = '19.06.00.011'; +if( CheckVersion( $DBversion ) ) { + + if ( TableExists('refund_lost_item_fee_rules') ) { + if ( column_exists( 'refund_lost_item_fee_rules', 'refund' ) ) { + $dbh->do(" + INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value ) + SELECT NULL, IF(branchcode='*', NULL, branchcode), NULL, 'refund', refund + FROM refund_lost_item_fee_rules + "); + $dbh->do("DROP TABLE refund_lost_item_fee_rules"); + } + } + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 18930 - Move lost item refund rules to circulation_rules table)\n"; +} + # 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/'; -- 1.7.2.5