DB UPDATE : Patron category code was defined incorrectly in overduerules (notice...
authorRyan Higgins <rch@liblime.com>
Wed, 23 Jul 2008 01:52:16 +0000 (20:52 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Wed, 23 Jul 2008 02:07:49 +0000 (21:07 -0500)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
installer/data/mysql/kohastructure.sql
installer/data/mysql/updatedatabase.pl
kohaversion.pl

index c981305..b006158 100644 (file)
@@ -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,
index f233d04..bb38ae2 100755 (executable)
@@ -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
index 943962f..48af193 100644 (file)
@@ -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