From b6f5768145bf21085ecd5024d6e021e4d3c64e15 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 5 Aug 2020 16:27:06 +0200 Subject: [PATCH] Bug 26145: Refactoring - Rename table biblioimages to cover_images Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- installer/data/mysql/atomicupdate/bug_xxxxx.perl | 9 +++++++++ installer/data/mysql/kohastructure.sql | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_xxxxx.perl b/installer/data/mysql/atomicupdate/bug_xxxxx.perl index 46e0614381..7e56febb5c 100644 --- a/installer/data/mysql/atomicupdate/bug_xxxxx.perl +++ b/installer/data/mysql/atomicupdate/bug_xxxxx.perl @@ -17,4 +17,13 @@ if( CheckVersion( $DBversion ) ) { } NewVersion( $DBversion, 'XXXXX', "Add the biblioimages.itemnumber column"); + + if( !TableExists('cover_images') ) { + $dbh->do(q| + ALTER TABLE biblioimages RENAME cover_images + |); + } + + # Always end with this (adjust the bug info) + NewVersion( $DBversion, "XXXXX", "Rename table biblioimages with cover_images"); } diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 88161de710..37a51a0d3b 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3367,12 +3367,12 @@ CREATE TABLE transport_cost ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- --- Table structure for table `biblioimages` +-- Table structure for table `cover_images` -- -DROP TABLE IF EXISTS `biblioimages`; +DROP TABLE IF EXISTS `cover_images`; -CREATE TABLE `biblioimages` ( -- local cover images +CREATE TABLE `cover_images` ( -- local cover images `imagenumber` int(11) NOT NULL AUTO_INCREMENT, -- unique identifier for the image `biblionumber` int(11) DEFAULT NULL, -- foreign key from biblio table to link to biblionumber `itemnumber` int(11) DEFAULT NULL, -- foreign key from item table to link to itemnumber -- 2.39.5