From 1a0ca2874fc60b58db0f5f55f20871377cfe77a1 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 29 Apr 2016 10:30:10 +0000 Subject: [PATCH] Bug 15533 - DBRev 3.23.00.055 Signed-off-by: Kyle M Hall --- Koha.pm | 2 +- .../data/mysql/atomicupdate/hold_itype.sql | 10 ------- installer/data/mysql/updatedatabase.pl | 30 +++++++++++++++++++ 3 files changed, 31 insertions(+), 11 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/hold_itype.sql diff --git a/Koha.pm b/Koha.pm index 69cf6d1f96..2862d89914 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.054"; +$VERSION = "3.23.00.055"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/hold_itype.sql b/installer/data/mysql/atomicupdate/hold_itype.sql deleted file mode 100644 index 60301b6402..0000000000 --- a/installer/data/mysql/atomicupdate/hold_itype.sql +++ /dev/null @@ -1,10 +0,0 @@ -ALTER TABLE reserves ADD COLUMN itemtype VARCHAR(10) NULL DEFAULT NULL AFTER suspend_until; -ALTER TABLE reserves ADD KEY `itemtype` (`itemtype`); -ALTER TABLE reserves ADD CONSTRAINT `reserves_ibfk_5` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE; - -ALTER TABLE old_reserves ADD COLUMN itemtype VARCHAR(10) NULL DEFAULT NULL AFTER suspend_until; -ALTER TABLE old_reserves ADD KEY `itemtype` (`itemtype`); -ALTER TABLE old_reserves ADD CONSTRAINT `old_reserves_ibfk_4` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE; - -INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES -('AllowHoldItemTypeSelection','0','','If enabled, patrons and staff will be able to select the itemtype when placing a hold','YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 38930f2695..65b077f151 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -12441,6 +12441,36 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.23.00.055"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q{ + ALTER TABLE reserves ADD COLUMN itemtype VARCHAR(10) NULL DEFAULT NULL AFTER suspend_until; + }); + $dbh->do(q{ + ALTER TABLE reserves ADD KEY `itemtype` (`itemtype`); + }); + $dbh->do(q{ + ALTER TABLE reserves ADD CONSTRAINT `reserves_ibfk_5` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE; + }); + $dbh->do(q{ + ALTER TABLE old_reserves ADD COLUMN itemtype VARCHAR(10) NULL DEFAULT NULL AFTER suspend_until; + }); + $dbh->do(q{ + ALTER TABLE old_reserves ADD KEY `itemtype` (`itemtype`); + }); + $dbh->do(q{ + ALTER TABLE old_reserves ADD CONSTRAINT `old_reserves_ibfk_4` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE; + }); + + $dbh->do(q{ + INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES + ('AllowHoldItemTypeSelection','0','','If enabled, patrons and staff will be able to select the itemtype when placing a hold','YesNo'); + }); + + print "Upgrade to $DBversion done (Bug 15533 - Allow patrons and librarians to select itemtype when placing hold)\n"; + SetVersion($DBversion); +} + # DEVELOPER PROCESS, search for anything to execute in the db_update directory # SEE bug 13068 -- 2.39.5