[Koha-patches] [PATCH] Bug 2945: increase size of labels_conf.formatstring (DB update)
Joe Atzberger
joe.atzberger at liblime.com
Wed Feb 4 20:55:03 CET 2009
---
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 670539a..b4662db 100644
--- a/installer/data/mysql/kohastructure.sql
+++ b/installer/data/mysql/kohastructure.sql
@@ -1248,7 +1248,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 964bd85..003cdd3 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'");
@@ -2184,6 +2182,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
--
1.5.5.GIT
More information about the Koha-patches
mailing list