From 471dbfe7fe808004f3c98ad8587870a7180567be Mon Sep 17 00:00:00 2001 From: Chris Nighswonger Date: Thu, 13 Mar 2008 17:18:01 -0500 Subject: [PATCH] Fix for Bug 1927 Signed-off-by: Joshua Ferraro --- installer/data/mysql/kohastructure.sql | 6 ++++-- installer/data/mysql/updatedatabase.pl | 13 +++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 788bd913e1..aff3c6c5ea 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -807,7 +807,7 @@ CREATE TABLE `deleteditems` ( `biblioitemnumber` int(11) NOT NULL default 0, `barcode` varchar(20) default NULL, `dateaccessioned` date default NULL, - `booksellerid` varchar(10) default NULL, + `booksellerid` mediumtext default NULL, `homebranch` varchar(10) default NULL, `price` decimal(8,2) default NULL, `replacementprice` decimal(8,2) default NULL, @@ -838,6 +838,7 @@ CREATE TABLE `deleteditems` ( `itype` varchar(10) default NULL, `more_subfields_xml` longtext default NULL, `marc` longblob, + `copynumber` smallint(6) default NULL, PRIMARY KEY (`itemnumber`), KEY `delitembarcodeidx` (`barcode`), KEY `delitembinoidx` (`biblioitemnumber`), @@ -1021,7 +1022,7 @@ CREATE TABLE `items` ( `biblioitemnumber` int(11) NOT NULL default 0, `barcode` varchar(20) default NULL, `dateaccessioned` date default NULL, - `booksellerid` varchar(10) default NULL, + `booksellerid` mediumtext default NULL, `homebranch` varchar(10) default NULL, `price` decimal(8,2) default NULL, `replacementprice` decimal(8,2) default NULL, @@ -1052,6 +1053,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, 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 89de88e629..ef4c033334 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -1175,6 +1175,19 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.00.00.063"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE deleteditems + CHANGE COLUMN booksellerid booksellerid MEDIUMTEXT, + ADD COLUMN copynumber SMALLINT(6);"); + $dbh->do("ALTER TABLE items + CHANGE COLUMN booksellerid booksellerid MEDIUMTEXT, + ADD COLUMN copynumber SMALLINT(6);"); + print "Upgrade to $DBversion done ( Changed items.booksellerid and deleteditems.booksellerid to MEDIUMTEXT and added missing items.copynumber and deleteditems.copynumber to fix Bug 1927)\n"; + SetVersion ($DBversion); +} + + =item DropAllForeignKeys($table) Drop all foreign keys of the table $table -- 2.39.5