From b79f8feed2daa71318d511b4c340db4db285bd89 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 11 May 2009 12:22:46 -0500 Subject: [PATCH] bug 2872: fix width of columns in branch_transfer_limits (DB rev 031) change itemtype, tobranch, and frombranch from varchar(4) to varchar(10) Signed-off-by: Galen Charlton --- 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 ec1a0fdde9..cb5068f691 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 56fcf2fee5..15e1c085b6 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 c590834d10..d5c0203d17 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 -- 2.39.5