Bug 14048: (RM followup) DB version 16.06.00.006
authorJesse Weaver <jweaver@bywatersolutions.com>
Thu, 7 Jul 2016 17:02:53 +0000 (11:02 -0600)
committerJesse Weaver <jweaver@bywatersolutions.com>
Thu, 7 Jul 2016 17:02:53 +0000 (11:02 -0600)
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Koha.pm
installer/data/mysql/atomicupdate/bug_14048_refundlostitemfeeonreturn.sql [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index 5133f02..48e4cd2 100644 (file)
--- 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 (file)
index ed529ae..0000000
+++ /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);
--- }
index ab20870..4c9ab03 100755 (executable)
@@ -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