Bug 8431 - Increase the borrower attribute field size from 64 characters to 255
authorKyle M Hall <kyle@bywatersolutions.com>
Thu, 12 Jul 2012 15:29:10 +0000 (11:29 -0400)
committerPaul Poulain <paul.poulain@biblibre.com>
Thu, 13 Sep 2012 09:04:59 +0000 (11:04 +0200)
Some libraries would like to store more verbose data in a borrower attribute field.
This commit increases the maximum length of a borrower attribute from 64 characters
to 255 characters.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
installer/data/mysql/kohastructure.sql
installer/data/mysql/updatedatabase.pl

index a593941..b394a3b 100644 (file)
@@ -302,7 +302,7 @@ DROP TABLE IF EXISTS `borrower_attributes`;
 CREATE TABLE `borrower_attributes` ( -- values of custom patron fields known as extended patron attributes linked to patrons/borrowers
   `borrowernumber` int(11) NOT NULL, -- foreign key from the borrowers table, defines which patron/borrower has this attribute
   `code` varchar(10) NOT NULL, -- foreign key from the borrower_attribute_types table, defines which custom field this value was entered for
-  `attribute` varchar(64) default NULL, -- custom patron field value
+  `attribute` varchar(255) default NULL, -- custom patron field value
   `password` varchar(64) default NULL, -- password associated with this field
   KEY `borrowernumber` (`borrowernumber`),
   KEY `code_attribute` (`code`, `attribute`),
index 3c4b02a..b0c360e 100755 (executable)
@@ -5715,6 +5715,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion ($DBversion);
 }
 
+$DBversion ="3.09.00.038";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do("ALTER TABLE  `borrower_attributes` CHANGE  `attribute`  `attribute` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL");
+    print "Upgrade to $DBversion done (Increase the maximum size of a borrower attribute value)\n";
+    SetVersion($DBversion);
+}
+
 =head1 FUNCTIONS
 
 =head2 TableExists($table)