From 38eb0d6f6abe9fc4fb71927ebee4712c9e464285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Fri, 27 Feb 2015 12:31:01 +0100 Subject: [PATCH] Bug 13766 Set biblioitems.ean type to MEDIUMTEXT biblioitems.ean field is too short. It's a VARCHAR(13) type. EAN can be longer, especially if it's repeated in the biblio record. When biblio records are imported, and 073 (Unimarc) or 024 (MARC21) field is repeated, their content can't be stored in biblioitems.ean field: it stops the biblio record import. This field should be aligned to biblioitems.isbn type: MEDIUMTEXT. --- installer/data/mysql/kohastructure.sql | 4 ++-- installer/data/mysql/updatedatabase.pl | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 08ef9ee..a818c18 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -155,7 +155,7 @@ CREATE TABLE `biblioitems` ( -- information related to bibliographic records in `itemtype` varchar(10) default NULL, -- biblio level item type (MARC21 942$c) `isbn` mediumtext, -- ISBN (MARC21 020$a) `issn` mediumtext, -- ISSN (MARC21 022$a) - `ean` varchar(13) default NULL, + `ean` mediumtext default NULL, `publicationyear` text, `publishercode` varchar(255) default NULL, -- publisher (MARC21 260$b) `volumedate` date default NULL, @@ -786,7 +786,7 @@ CREATE TABLE `deletedbiblioitems` ( -- information about bibliographic records t `itemtype` varchar(10) default NULL, -- biblio level item type (MARC21 942$c) `isbn` mediumtext default NULL, -- ISBN (MARC21 020$a) `issn` mediumtext default NULL, -- ISSN (MARC21 022$a) - `ean` varchar(13) default NULL, + `ean` mediumtext default NULL, `publicationyear` text, `publishercode` varchar(255) default NULL, -- publisher (MARC21 260$b) `volumedate` date default NULL, diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 0ed56c6..275da5f 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -9793,6 +9793,20 @@ if(CheckVersion($DBversion)) { SetVersion($DBversion); } +$DBversion = "3.19.00.XXX"; +if(CheckVersion($DBversion)) { + $dbh->do(q{ + ALTER TABLE biblioitems MODIFY COLUMN ean MEDIUMTEXT default NULL + }); + + $dbh->do(q{ + ALTER TABLE deletedbiblioitems MODIFY COLUMN ean MEDIUMTEXT default NULL + }); + + print "Upgrade to $DBversion done (Bug 13766 - Align biblioitems.ean type to biblioitems.isbn)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) -- 2.3.0