[Koha-patches] [PATCH 2/4] bug 1532: tweak new reserves columns and add to init SQL (DB rev 121)

Galen Charlton gmcharlt at gmail.com
Fri Feb 19 04:49:32 CET 2010


Changed type of lowestpriority from BOOL to tinyint(1) - BOOL was likely
OK, but made it tinyint(1) to match the rest of the flag columns.  We
should look into converting those to BOOL en masse in 3.4.

Also made expirationdate nullable.

Signed-off-by: Galen Charlton <gmcharlt at gmail.com>
---
 installer/data/mysql/kohastructure.sql |    4 ++++
 installer/data/mysql/updatedatabase.pl |    8 ++++----
 kohaversion.pl                         |    2 +-
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql
index f2e9423..4ddcbd5 100644
--- a/installer/data/mysql/kohastructure.sql
+++ b/installer/data/mysql/kohastructure.sql
@@ -1338,6 +1338,8 @@ CREATE TABLE `old_reserves` (
   `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
   `itemnumber` int(11) default NULL,
   `waitingdate` date default NULL,
+  `expirationdate` DATE DEFAULT NULL,
+  `lowestPriority` tinyint(1) NOT NULL,
   KEY `old_reserves_borrowernumber` (`borrowernumber`),
   KEY `old_reserves_biblionumber` (`biblionumber`),
   KEY `old_reserves_itemnumber` (`itemnumber`),
@@ -1511,6 +1513,8 @@ CREATE TABLE `reserves` (
   `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
   `itemnumber` int(11) default NULL,
   `waitingdate` date default NULL,
+  `expirationdate` DATE DEFAULT NULL,
+  `lowestPriority` tinyint(1) NOT NULL,
   KEY `borrowernumber` (`borrowernumber`),
   KEY `biblionumber` (`biblionumber`),
   KEY `itemnumber` (`itemnumber`),
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index 915a38b..23d9336 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -3482,10 +3482,10 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 
 $DBversion = '3.01.00.121';
 if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
-    $dbh->do("ALTER TABLE `reserves` ADD `expirationdate` DATE NOT NULL");
-    $dbh->do("ALTER TABLE `reserves` ADD `lowestPriority` BOOL NOT NULL");
-    $dbh->do("ALTER TABLE `old_reserves` ADD `expirationdate` DATE NOT NULL");
-    $dbh->do("ALTER TABLE `old_reserves` ADD `lowestPriority` BOOL NOT NULL");
+    $dbh->do("ALTER TABLE `reserves` ADD `expirationdate` DATE DEFAULT NULL");
+    $dbh->do("ALTER TABLE `reserves` ADD `lowestPriority` tinyint(1) NOT NULL");
+    $dbh->do("ALTER TABLE `old_reserves` ADD `expirationdate` DATE DEFAULT NULL");
+    $dbh->do("ALTER TABLE `old_reserves` ADD `lowestPriority` tinyint(1) NOT NULL");
     print "Upgrade to $DBversion done ( Added Additional Fields to Reserves tables )\n";
     SetVersion ($DBversion);
 }
diff --git a/kohaversion.pl b/kohaversion.pl
index 214efcc..14c5ef4 100644
--- a/kohaversion.pl
+++ b/kohaversion.pl
@@ -10,7 +10,7 @@
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.01.00.120';
+    our $VERSION = '3.01.00.121';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install
-- 
1.6.3.3




More information about the Koha-patches mailing list