[Koha-patches] [PATCH] bug 2872: fix width of columns in branch_transfer_limits (DB rev 031)

Galen Charlton galen.charlton at liblime.com
Mon May 11 19:23:38 CEST 2009


change itemtype, tobranch, and frombranch from varchar(4)
to varchar(10)
---
 installer/data/mysql/kohastructure.sql |    6 +++---
 installer/data/mysql/updatedatabase.pl |   10 ++++++++++
 kohaversion.pl                         |    2 +-
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql
index ec1a0fd..cb5068f 100644
--- a/installer/data/mysql/kohastructure.sql
+++ b/installer/data/mysql/kohastructure.sql
@@ -2338,9 +2338,9 @@ CREATE TABLE `borrower_message_transport_preferences` (
 DROP TABLE IF EXISTS `branch_transfer_limits`;
 CREATE TABLE branch_transfer_limits (
     limitId int(8) NOT NULL auto_increment,
-    toBranch varchar(4) NOT NULL,
-    fromBranch varchar(4) NOT NULL,
-    itemtype varchar(4) NULL,
+    toBranch varchar(10) NOT NULL,
+    fromBranch varchar(10) NOT NULL,
+    itemtype varchar(10) NULL,
     ccode varchar(10) NULL,  
     PRIMARY KEY  (limitId)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index 56fcf2f..15e1c08 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -2396,6 +2396,16 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion ($DBversion);
 }
 
+$DBversion = "3.01.00.031";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("ALTER TABLE branch_transfer_limits
+              MODIFY toBranch   varchar(10) NOT NULL,
+              MODIFY fromBranch varchar(10) NOT NULL,
+              MODIFY itemtype   varchar(10) NULL");
+    print "Upgrade to $DBversion done (fix column widths in branch_transfer_limits)\n";
+    SetVersion ($DBversion);
+}
+
 =item DropAllForeignKeys($table)
 
   Drop all foreign keys of the table $table
diff --git a/kohaversion.pl b/kohaversion.pl
index c590834..d5c0203 100644
--- a/kohaversion.pl
+++ b/kohaversion.pl
@@ -10,7 +10,7 @@
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.01.00.030';
+    our $VERSION = '3.01.00.031';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install
-- 
1.5.6.5




More information about the Koha-patches mailing list