From 0bd5a3070811a499869e433a572e5541e313dc6e Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Wed, 4 Feb 2009 13:55:03 -0600 Subject: [PATCH] Bug 2945: increase size of labels_conf.formatstring (DB update) Signed-off-by: Galen Charlton --- installer/data/mysql/kohastructure.sql | 2 +- installer/data/mysql/updatedatabase.pl | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 27a587522b..ec0f45d0b0 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1249,7 +1249,7 @@ CREATE TABLE `labels_conf` ( `isbn` int(1) default '0', `startlabel` int(2) NOT NULL default '1', `printingtype` char(32) default 'BAR', - `formatstring` varchar(64) default NULL, + `formatstring` mediumtext default NULL, `layoutname` char(20) NOT NULL default 'TEST', `guidebox` int(1) default '0', `active` tinyint(1) default '1', diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 2d51d77155..9193ad6a78 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -1324,7 +1324,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $DBversion = "3.00.00.072"; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { - $dbh->do("ALTER TABLE labels_conf ADD COLUMN formatstring VARCHAR(64) DEFAULT NULL AFTER printingtype"); + $dbh->do("ALTER TABLE labels_conf ADD COLUMN formatstring mediumtext DEFAULT NULL AFTER printingtype"); print "Upgrade to $DBversion done ( Adding format string to labels generator. )\n"; SetVersion ($DBversion); } @@ -1501,8 +1501,6 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } - - $DBversion = "3.00.00.080"; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $dbh->do("ALTER TABLE subscription CHANGE monthlength monthlength int(11) default '0'"); @@ -2327,6 +2325,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = '3.01.00.020'; +if ( C4::Context->preference('Version') < TransformToNum($DBversion) ) { + $dbh->do("ALTER TABLE `labels_conf` MODIFY COLUMN `formatstring` mediumtext DEFAULT NULL"); + print "Upgrade to $DBversion done (bug 2945: increase size of labels_conf.formatstring)\n"; + SetVersion ($DBversion); +} + =item DropAllForeignKeys($table) Drop all foreign keys of the table $table -- 2.39.5