From 966b02dfa534755faa44d322a76944ab3fcfa186 Mon Sep 17 00:00:00 2001
From: Kyle M Hall <kyle@bywatersolutions.com>
Date: Thu, 20 Feb 2014 06:26:25 -0500
Subject: [PATCH] Bug 5377 [QA Followup] - Alter deletedbiblioitems to match biblioitems

---
 installer/data/mysql/kohastructure.sql |    6 +++---
 installer/data/mysql/updatedatabase.pl |   11 +++++++++++
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql
index 834925a..0591716 100644
--- a/installer/data/mysql/kohastructure.sql
+++ b/installer/data/mysql/kohastructure.sql
@@ -755,8 +755,8 @@ CREATE TABLE `deletedbiblioitems` ( -- information about bibliographic records t
   `volume` mediumtext,
   `number` mediumtext,
   `itemtype` varchar(10) default NULL, -- biblio level item type (MARC21 942$c)
-  `isbn` varchar(30) default NULL, -- ISBN (MARC21 020$a)
-  `issn` varchar(9) default NULL, -- ISSN (MARC21 022$a)
+  `isbn` mediumtext default NULL, -- ISBN (MARC21 020$a)
+  `issn` mediumtext default NULL, -- ISSN (MARC21 022$a)
   `ean` varchar(13) default NULL,
   `publicationyear` text,
   `publishercode` varchar(255) default NULL, -- publisher (MARC21 260$b)
@@ -788,7 +788,7 @@ CREATE TABLE `deletedbiblioitems` ( -- information about bibliographic records t
   KEY `bibinoidx` (`biblioitemnumber`),
   KEY `bibnoidx` (`biblionumber`),
   KEY `itemtype_idx` (`itemtype`),
-  KEY `isbn` (`isbn`),
+  KEY `isbn` (`isbn`(255)),
   KEY `publishercode` (`publishercode`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index 93060aa..4fc318f 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -7965,6 +7965,17 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
               ADD INDEX isbn ( isbn ( 255 ) ),
               ADD INDEX issn ( issn ( 255 ) )
     ");
+
+    $dbh->do("ALTER TABLE deletedbiblioitems DROP INDEX isbn");
+    $dbh->do("ALTER TABLE deletedbiblioitems DROP INDEX issn");
+    $dbh->do("ALTER TABLE deletedbiblioitems
+              CHANGE isbn isbn MEDIUMTEXT NULL DEFAULT NULL,
+              CHANGE issn issn MEDIUMTEXT NULL DEFAULT NULL
+    ");
+    $dbh->do("ALTER TABLE deletedbiblioitems 
+              ADD INDEX isbn ( isbn ( 255 ) )
+    ");
+
     print "Upgrade to $DBversion done (Bug 11268 - Biblioitems URL field is too small for some URLs)\n";
     SetVersion($DBversion);
 }
-- 
1.7.2.5