Bug 15533 - DBRev 3.23.00.055
authorKyle M Hall <kyle@bywatersolutions.com>
Fri, 29 Apr 2016 10:30:10 +0000 (10:30 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 29 Apr 2016 10:31:19 +0000 (10:31 +0000)
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha.pm
installer/data/mysql/atomicupdate/hold_itype.sql [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index 69cf6d1..2862d89 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.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 (file)
index 60301b6..0000000
+++ /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');
index 38930f2..65b077f 100755 (executable)
@@ -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