Bug 15532 - DBRev 3.23.00.054
authorKyle M Hall <kyle@bywatersolutions.com>
Fri, 29 Apr 2016 10:23:47 +0000 (10:23 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 29 Apr 2016 10:23:47 +0000 (10:23 +0000)
Koha.pm
installer/data/mysql/atomicupdate/hold_fulfillment_policy.sql [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index d345b1c..69cf6d1 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 = "3.23.00.053";
+$VERSION = "3.23.00.054";
 
 sub version {
     return $VERSION;
diff --git a/installer/data/mysql/atomicupdate/hold_fulfillment_policy.sql b/installer/data/mysql/atomicupdate/hold_fulfillment_policy.sql
deleted file mode 100644 (file)
index ee514e2..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-ALTER TABLE branch_item_rules         ADD COLUMN hold_fulfillment_policy ENUM('any', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any' AFTER holdallowed;
-ALTER TABLE default_branch_circ_rules ADD COLUMN hold_fulfillment_policy ENUM('any', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any' AFTER holdallowed;
-ALTER TABLE default_branch_item_rules ADD COLUMN hold_fulfillment_policy ENUM('any', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any' AFTER holdallowed;
-ALTER TABLE default_circ_rules        ADD COLUMN hold_fulfillment_policy ENUM('any', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any' AFTER holdallowed;
index 8a1ecd0..38930f2 100755 (executable)
@@ -12400,23 +12400,46 @@ if ( CheckVersion($DBversion) ) {
 
 $DBversion = "3.23.00.053";
 if ( CheckVersion($DBversion) ) {
-my $letters = $dbh->selectall_arrayref(q|
+    my $letters = $dbh->selectall_arrayref(
+        q|
         SELECT code, name
         FROM letter
         WHERE message_transport_type="email"
-        |, { Slice => {} });
-for my $letter ( @$letters ) {
-        $dbh->do(q|
+        |, { Slice => {} }
+    );
+    for my $letter (@$letters) {
+        $dbh->do(
+            q|
                 UPDATE letter
                 SET name = ?
                 WHERE code = ?
                 AND message_transport_type <> "email"
-                |, undef, $letter->{name}, $letter->{code});
-}
+                |, undef, $letter->{name}, $letter->{code}
+        );
+    }
 
     print "Upgrade to $DBversion done (Bug 16217 - Notice' names may have diverged)\n";
-        SetVersion($DBversion);
-        }
+    SetVersion($DBversion);
+}
+
+$DBversion = "3.23.00.054";
+if ( CheckVersion($DBversion) ) {
+    $dbh->do(q{
+        ALTER TABLE branch_item_rules ADD COLUMN hold_fulfillment_policy ENUM('any', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any' AFTER holdallowed;
+    });
+    $dbh->do(q{
+        ALTER TABLE default_branch_circ_rules ADD COLUMN hold_fulfillment_policy ENUM('any', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any' AFTER holdallowed;
+    });
+    $dbh->do(q{
+        ALTER TABLE default_branch_item_rules ADD COLUMN hold_fulfillment_policy ENUM('any', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any' AFTER holdallowed;
+    });
+    $dbh->do(q{
+        ALTER TABLE default_circ_rules ADD COLUMN hold_fulfillment_policy ENUM('any', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any' AFTER holdallowed;
+    });
+
+    print "Upgrade to $DBversion done (Bug 15532 - Add ability to allow only items whose home/holding branch matches the hold's pickup branch to fill a given hold)\n";
+    SetVersion($DBversion);
+}
 
 
 # DEVELOPER PROCESS, search for anything to execute in the db_update directory