From 52fe58dd9526c38efbdac08c9ddf5a1890442f7e Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 18 Feb 2010 21:45:56 -0500 Subject: [PATCH] bug 1532: tweak new reserves columns and add to init SQL (DB rev 121) 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 --- 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 f2e9423683..4ddcbd5c66 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 915a38bdac..23d93361dd 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 214efcc476..14c5ef4b3e 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 -- 2.39.5