[Koha-patches] [PATCH] DB UPDATE : Patron category code was defined incorrectly in overduerules (notice/status triggers) and deletedborrowers.
Ryan Higgins
rch at liblime.com
Wed Jul 23 03:52:16 CEST 2008
---
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 c981305..b006158 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 f233d04..bb38ae2 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 943962f..48af193 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
--
1.5.5.GIT
More information about the Koha-patches
mailing list