Bug 5786: DBRev 3.19.00.017
authorTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 25 Mar 2015 13:31:53 +0000 (10:31 -0300)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 25 Mar 2015 13:33:44 +0000 (10:33 -0300)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
installer/data/mysql/updatedatabase.pl
kohaversion.pl

index 4e21562..951060f 100755 (executable)
@@ -9675,41 +9675,6 @@ if ( CheckVersion($DBversion) ) {
     SetVersion($DBversion);
 }
 
-$DBversion = '3.19.00.XXX';
-if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
-    # First create the column
-    $dbh->do("ALTER TABLE issuingrules ADD onshelfholds tinyint(1) default 0 NOT NULL");
-    # Now update the column
-    if (C4::Context->preference("AllowOnShelfHolds")){
-        # Pref is on, set allow for all rules
-        $dbh->do("UPDATE issuingrules SET onshelfholds=1");
-    } else {
-        # If the preference is not set, leave off
-        $dbh->do("UPDATE issuingrules SET onshelfholds=0");
-    }
-    # Remove from the systempreferences table
-    $dbh->do("DELETE FROM systempreferences WHERE variable = 'AllowOnShelfHolds'");
-
-    # First create the column
-    $dbh->do("ALTER TABLE issuingrules ADD opacitemholds char(1) DEFAULT 'N' NOT NULL");
-    # Now update the column
-    my $opacitemholds = C4::Context->preference("OPACItemHolds") || '';
-    if (lc ($opacitemholds) eq 'force') {
-        $opacitemholds = 'F';
-    }
-    else {
-        $opacitemholds = $opacitemholds ? 'Y' : 'N';
-    }
-    # Set allow for all rules
-    $dbh->do("UPDATE issuingrules SET opacitemholds='$opacitemholds'");
-
-    # Remove from the systempreferences table
-    $dbh->do("DELETE FROM systempreferences WHERE variable = 'OPACItemHolds'");
-
-    print "Upgrade to $DBversion done (Bug 5786 - Move AllowOnShelfHolds to circulation matrix; Move OPACItemHolds system preference to circulation matrix)\n";
-    SetVersion ($DBversion);
-}
-
 $DBversion = "3.19.00.007";
 if ( CheckVersion($DBversion) ) {
     my $orphan_budgets = $dbh->selectall_arrayref(q|
@@ -9902,6 +9867,41 @@ if(CheckVersion($DBversion)) {
     SetVersion($DBversion);
 }
 
+$DBversion = '3.19.00.017';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    # First create the column
+    $dbh->do("ALTER TABLE issuingrules ADD onshelfholds tinyint(1) default 0 NOT NULL");
+    # Now update the column
+    if (C4::Context->preference("AllowOnShelfHolds")){
+        # Pref is on, set allow for all rules
+        $dbh->do("UPDATE issuingrules SET onshelfholds=1");
+    } else {
+        # If the preference is not set, leave off
+        $dbh->do("UPDATE issuingrules SET onshelfholds=0");
+    }
+    # Remove from the systempreferences table
+    $dbh->do("DELETE FROM systempreferences WHERE variable = 'AllowOnShelfHolds'");
+
+    # First create the column
+    $dbh->do("ALTER TABLE issuingrules ADD opacitemholds char(1) DEFAULT 'N' NOT NULL");
+    # Now update the column
+    my $opacitemholds = C4::Context->preference("OPACItemHolds") || '';
+    if (lc ($opacitemholds) eq 'force') {
+        $opacitemholds = 'F';
+    }
+    else {
+        $opacitemholds = $opacitemholds ? 'Y' : 'N';
+    }
+    # Set allow for all rules
+    $dbh->do("UPDATE issuingrules SET opacitemholds='$opacitemholds'");
+
+    # Remove from the systempreferences table
+    $dbh->do("DELETE FROM systempreferences WHERE variable = 'OPACItemHolds'");
+
+    print "Upgrade to $DBversion done (Bug 5786 - Move AllowOnShelfHolds to circulation matrix; Move OPACItemHolds system preference to circulation matrix)\n";
+    SetVersion ($DBversion);
+}
+
 =head1 FUNCTIONS
 
 =head2 TableExists($table)
index a2769f5..7a29352 100644 (file)
@@ -17,7 +17,7 @@ the kohaversion is divided in 4 parts :
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.19.00.016';
+    our $VERSION = '3.19.00.017';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install