From e27bca77c77617f807304ca9775897a0b7a11dda Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 29 Apr 2016 10:23:47 +0000 Subject: [PATCH] Bug 15532 - DBRev 3.23.00.054 --- Koha.pm | 2 +- .../atomicupdate/hold_fulfillment_policy.sql | 4 -- installer/data/mysql/updatedatabase.pl | 39 +++++++++++++++---- 3 files changed, 32 insertions(+), 13 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/hold_fulfillment_policy.sql diff --git a/Koha.pm b/Koha.pm index d345b1c288..69cf6d1f96 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 = "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 index ee514e220f..0000000000 --- a/installer/data/mysql/atomicupdate/hold_fulfillment_policy.sql +++ /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; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 8a1ecd0aa5..38930f2695 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -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 -- 2.39.5