From 0fda22b824a2e7c13e9b633325748d422e98e2a3 Mon Sep 17 00:00:00 2001 From: Jesse Weaver Date: Thu, 7 Jul 2016 11:02:53 -0600 Subject: [PATCH] Bug 14048: (RM followup) DB version 16.06.00.006 Signed-off-by: Jesse Weaver --- Koha.pm | 2 +- .../bug_14048_refundlostitemfeeonreturn.sql | 49 ------------------- installer/data/mysql/updatedatabase.pl | 32 ++++++++++++ 3 files changed, 33 insertions(+), 50 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_14048_refundlostitemfeeonreturn.sql diff --git a/Koha.pm b/Koha.pm index 5133f0227f..48e4cd2c01 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 = "16.06.00.005"; +$VERSION = "16.06.00.006"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_14048_refundlostitemfeeonreturn.sql b/installer/data/mysql/atomicupdate/bug_14048_refundlostitemfeeonreturn.sql deleted file mode 100644 index ed529aecc6..0000000000 --- a/installer/data/mysql/atomicupdate/bug_14048_refundlostitemfeeonreturn.sql +++ /dev/null @@ -1,49 +0,0 @@ -CREATE TABLE `refund_lost_item_fee_rules` ( - `branchcode` varchar(10) NOT NULL default '', - `refund` tinyint(1) NOT NULL default 0, - PRIMARY KEY (`branchcode`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; - -INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) -VALUES( 'RefundLostOnReturnControl', - 'CheckinLibrary', - 'If a lost item is returned, choose which branch to pick rules for refunding.', - 'CheckinLibrary|PatronLibrary|ItemHomeBranch|ItemHoldingBranch', - 'Choice'); - -INSERT INTO refund_lost_item_fee_rules (branchcode,refund) - SELECT '*', COALESCE(value,'1') FROM systempreferences WHERE variable='RefundLostItemFeeOnReturn'; - -DELETE FROM systempreferences WHERE variable = 'RefundLostItemFeeOnReturn'; - --- $DBversion = "16.06.00.XXX"; --- if ( CheckVersion($DBversion) ) { --- $dbh->do(q{ --- CREATE TABLE `refund_lost_item_fee_rules` ( --- `branchcode` varchar(10) NOT NULL default '', --- `refund` tinyint(1) NOT NULL default 0, --- PRIMARY KEY (`branchcode`) --- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; --- }); --- $dbh->do(q{ --- INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) --- VALUES( 'RefundLostOnReturnControl', --- 'CheckinLibrary', --- 'If a lost item is returned, choose which branch to pick rules for refunding.', --- 'CheckinLibrary|PatronLibrary|ItemHomeBranch|ItemHoldingbranch', --- 'Choice') --- }); --- # Pick the old syspref as the default rule --- $dbh->do(q{ --- INSERT INTO refund_lost_item_fee_rules (branchcode,refund) --- SELECT '*', COALESCE(value,'1') FROM systempreferences WHERE variable='RefundLostItemFeeOnReturn' --- }); --- # Delete the old syspref --- $dbh->do(q{ --- DELETE IGNORE FROM systempreferences --- WHERE variable='RefundLostItemFeeOnReturn' --- }); - --- print "Upgrade to $DBversion done (Bug 14048: Change RefundLostItemFeeOnReturn to be branch specific)\n"; --- SetVersion($DBversion); --- } diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index ab208701d1..4c9ab032bc 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -12683,6 +12683,38 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "16.06.00.006"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q{ + CREATE TABLE `refund_lost_item_fee_rules` ( + `branchcode` varchar(10) NOT NULL default '', + `refund` tinyint(1) NOT NULL default 0, + PRIMARY KEY (`branchcode`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + }); + $dbh->do(q{ + INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) + VALUES( 'RefundLostOnReturnControl', + 'CheckinLibrary', + 'If a lost item is returned, choose which branch to pick rules for refunding.', + 'CheckinLibrary|PatronLibrary|ItemHomeBranch|ItemHoldingbranch', + 'Choice') + }); + # Pick the old syspref as the default rule + $dbh->do(q{ + INSERT INTO refund_lost_item_fee_rules (branchcode,refund) + SELECT '*', COALESCE(value,'1') FROM systempreferences WHERE variable='RefundLostItemFeeOnReturn' + }); + # Delete the old syspref + $dbh->do(q{ + DELETE IGNORE FROM systempreferences + WHERE variable='RefundLostItemFeeOnReturn' + }); + + print "Upgrade to $DBversion done (Bug 14048: Change RefundLostItemFeeOnReturn to be branch specific)\n"; + SetVersion($DBversion); +} + # DEVELOPER PROCESS, search for anything to execute in the db_update directory # SEE bug 13068 -- 2.39.5