[Koha-patches] [PATCH] Bug 6761 - Longer userid field

Amit Gupta amit.gupta at osslabs.biz
Thu Sep 8 04:23:26 CEST 2011


From: Navya <navya.vp at osslabs.biz>

Some libraries use email ids as userids. The current length of the userid field
is 30 and is not sufficient to accomodate some email addresses.
This change will increase the length to 75.

Signed-off-by: Amit Gupta <amit.gupta at osslabs.biz>
---
 installer/data/mysql/kohastructure.sql |    2 +-
 installer/data/mysql/updatedatabase.pl |    6 ++++++
 kohaversion.pl                         |    2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql
index 13fa53d..d5c91e4 100644
--- a/installer/data/mysql/kohastructure.sql
+++ b/installer/data/mysql/kohastructure.sql
@@ -244,7 +244,7 @@ CREATE TABLE `borrowers` (
   `sex` varchar(1) default NULL,
   `password` varchar(30) default NULL,
   `flags` int(11) default NULL,
-  `userid` varchar(30) default NULL,
+  `userid` varchar(75) default NULL,
   `opacnote` mediumtext,
   `contactnote` varchar(255) default NULL,
   `sort1` varchar(80) default NULL,
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index bdfc9ac..e093645 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -4439,6 +4439,12 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion($DBversion);
 }
 
+$DBversion = "3.05.00.011";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("ALTER TABLE `borrowers` MODIFY `userid` VARCHAR(75);");
+    print "Modified userid column length into 75 in borrowers\n";
+    SetVersion($DBversion);
+}
 
 =head1 FUNCTIONS
 
diff --git a/kohaversion.pl b/kohaversion.pl
index 5b72642..f864378 100644
--- a/kohaversion.pl
+++ b/kohaversion.pl
@@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts :
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.05.00.010';
+    our $VERSION = '3.05.00.011';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install
-- 
1.6.4.2



More information about the Koha-patches mailing list