From 0ed39b89cdf9891f8bdae6139ad6d8330b04dcab Mon Sep 17 00:00:00 2001 From: Ryan Higgins Date: Tue, 22 Jul 2008 20:52:16 -0500 Subject: [PATCH] DB UPDATE : Patron category code was defined incorrectly in overduerules (notice/status triggers) and deletedborrowers. Signed-off-by: Joshua Ferraro --- installer/data/mysql/kohastructure.sql | 4 ++-- installer/data/mysql/updatedatabase.pl | 8 ++++++++ kohaversion.pl | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index c9813051f0..b0061585a2 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -842,7 +842,7 @@ CREATE TABLE `deletedborrowers` ( `B_phone` mediumtext, `dateofbirth` date default NULL, `branchcode` varchar(10) NOT NULL default '', - `categorycode` varchar(2) default NULL, + `categorycode` varchar(10) default NULL, `dateenrolled` date default NULL, `dateexpiry` date default NULL, `gonenoaddress` tinyint(1) default NULL, @@ -1508,7 +1508,7 @@ CREATE TABLE `opac_news` ( DROP TABLE IF EXISTS `overduerules`; CREATE TABLE `overduerules` ( `branchcode` varchar(10) NOT NULL default '', - `categorycode` varchar(2) NOT NULL default '', + `categorycode` varchar(10) NOT NULL default '', `delay1` int(4) default 0, `letter1` varchar(20) default NULL, `debarred1` varchar(1) default 0, diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index f233d0469b..bb38ae2d98 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -1871,6 +1871,14 @@ if ( C4::Context->preference('Version') < TransformToNum($DBversion) ) { SetVersion($DBversion); } +$DBversion = '3.00.00.101'; +if ( C4::Context->preference('Version') < TransformToNum($DBversion) ) { + $dbh->do('ALTER TABLE `overduerules` CHANGE `categorycode` `categorycode` VARCHAR(10) NOT NULL'); + $dbh->do('ALTER TABLE `deletedborrowers` CHANGE `categorycode` `categorycode` VARCHAR(10) NOT NULL'); + print "Upgrade to $DBversion done (Updating columnd definitions for patron category codes in notice/statsu triggers and deletedborrowers tables.\n"; + SetVersion($DBversion); +} + =item DropAllForeignKeys($table) Drop all foreign keys of the table $table diff --git a/kohaversion.pl b/kohaversion.pl index 943962f3d1..48af193115 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -10,7 +10,7 @@ use strict; sub kohaversion { - our $VERSION = '3.00.00.100'; + our $VERSION = '3.00.00.101'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install -- 2.11.4.GIT