Bug 22532: Database update
authorJosef Moravec <josef.moravec@gmail.com>
Mon, 18 Mar 2019 16:48:51 +0000 (16:48 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 18 Apr 2019 10:48:11 +0000 (10:48 +0000)
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

installer/data/mysql/atomicupdate/Bug22532_remove_import_records_z39random.perl [new file with mode: 0644]
installer/data/mysql/kohastructure.sql

diff --git a/installer/data/mysql/atomicupdate/Bug22532_remove_import_records_z39random.perl b/installer/data/mysql/atomicupdate/Bug22532_remove_import_records_z39random.perl
new file mode 100644 (file)
index 0000000..553fb94
--- /dev/null
@@ -0,0 +1,10 @@
+$DBversion = 'XXX'; # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+    if( column_exists( 'import_records', 'z3950random' ) ) {
+        $dbh->do( "ALTER TABLE import_records DROP COLUMN z3950random" );
+    }
+
+    # Always end with this (adjust the bug info)
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 22532 - Remove import_records z3950random column)\n";
+}
index be047ff..7b78a87 100644 (file)
@@ -741,7 +741,6 @@ CREATE TABLE `import_records` (
   `status` enum('error', 'staged', 'imported', 'reverted', 'items_reverted', 'ignored') NOT NULL default 'staged',
   `import_error` LONGTEXT,
   `encoding` varchar(40) NOT NULL default '',
-  `z3950random` varchar(40) default NULL,
   PRIMARY KEY (`import_record_id`),
   CONSTRAINT `import_records_ifbk_1` FOREIGN KEY (`import_batch_id`)
              REFERENCES `import_batches` (`import_batch_id`) ON DELETE CASCADE ON UPDATE CASCADE,