From c522e99e20b6c7355b9321416f77db8fa31701a3 Mon Sep 17 00:00:00 2001 From: Ryan Higgins Date: Fri, 20 Jun 2008 17:48:38 -0500 Subject: [PATCH] DATABASE UPDATE: change copynumber column to allow free text - [ bug 2223 ] - WARNING, will take some time for large db. Signed-off-by: Joshua Ferraro --- installer/data/mysql/kohastructure.sql | 4 ++-- installer/data/mysql/updatedatabase.pl | 8 ++++++++ kohaversion.pl | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 4785667dd7..c48d3ec63c 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -917,7 +917,7 @@ CREATE TABLE `deleteditems` ( `itype` varchar(10) default NULL, `more_subfields_xml` longtext default NULL, `enumchron` varchar(80) default NULL, - `copynumber` smallint(6) default NULL, + `copynumber` varchar(32) default NULL, `marc` longblob, PRIMARY KEY (`itemnumber`), KEY `delitembarcodeidx` (`barcode`), @@ -1135,7 +1135,7 @@ CREATE TABLE `items` ( `itype` varchar(10) default NULL, `more_subfields_xml` longtext default NULL, `enumchron` varchar(80) default NULL, - `copynumber` smallint(6) default NULL, + `copynumber` varchar(32) default NULL, PRIMARY KEY (`itemnumber`), UNIQUE KEY `itembarcodeidx` (`barcode`), KEY `itembinoidx` (`biblioitemnumber`), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 352507d9e0..7d095bf930 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -1800,6 +1800,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.00.00.093"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE `items` MODIFY COLUMN `copynumber` VARCHAR(32) DEFAULT NULL"); + $dbh->do("ALTER TABLE `deleteditems` MODIFY COLUMN `copynumber` VARCHAR(32) DEFAULT NULL"); + print "Upgrade to $DBversion done (Change data type of items.copynumber to allow free text)\n"; + SetVersion ($DBversion); +} + =item DropAllForeignKeys($table) Drop all foreign keys of the table $table diff --git a/kohaversion.pl b/kohaversion.pl index 340b88b4ac..f0e7806935 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -10,7 +10,7 @@ use strict; sub kohaversion { - our $VERSION = "3.00.00.092"; + our $VERSION = "3.00.00.093"; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install -- 2.39.5