Bug 5377: (follow-up) alter deletedbiblioitems to match biblioitems
authorKyle M Hall <kyle@bywatersolutions.com>
Thu, 20 Feb 2014 11:26:25 +0000 (06:26 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 5 May 2014 17:56:30 +0000 (17:56 +0000)
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
installer/data/mysql/kohastructure.sql
installer/data/mysql/updatedatabase.pl

index 3e7eb79..92ab713 100644 (file)
@@ -757,8 +757,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)
@@ -790,7 +790,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;
 
index 5d0a26e..7a01014 100755 (executable)
@@ -8425,6 +8425,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);
 }