From b52d2eb09b75a9fd47d83fa64e69c96599e80cc6 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 27 Nov 2020 13:15:28 +0100 Subject: [PATCH] Fix some updatedatabase.pl issues Signed-off-by: Jonathan Druart --- installer/data/mysql/updatedatabase.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index a7d215e5c1..8aee16b3f9 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -23023,7 +23023,7 @@ if( CheckVersion( $DBversion ) ) { $DBversion = '20.06.00.049'; if( CheckVersion( $DBversion ) ) { - if( !column_exists( 'biblioimages', 'itemnumber' ) ) { + if( TableExists('biblioimages') && !column_exists( 'biblioimages', 'itemnumber' ) ) { $dbh->do(q| ALTER TABLE biblioimages ADD COLUMN itemnumber INT(11) DEFAULT NULL @@ -23280,13 +23280,13 @@ if ( CheckVersion($DBversion) ) { $DBversion = '20.06.00.065'; if( CheckVersion( $DBversion ) ) { - if( !column_exists( 'issues', 'issuer' ) ) { + if( !column_exists( 'issues', 'issuer_id' ) ) { $dbh->do( q| ALTER TABLE issues ADD issuer_id INT(11) DEFAULT NULL AFTER borrowernumber | ); } if (!foreign_key_exists( 'issues', 'issues_ibfk_borrowers_borrowernumber' )) { $dbh->do( q| ALTER TABLE issues ADD CONSTRAINT `issues_ibfk_borrowers_borrowernumber` FOREIGN KEY (`issuer_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE | ); } - if( !column_exists( 'old_issues', 'issuer' ) ) { + if( !column_exists( 'old_issues', 'issuer_id' ) ) { $dbh->do( q| ALTER TABLE old_issues ADD issuer_id INT(11) DEFAULT NULL AFTER borrowernumber | ); } if (!foreign_key_exists( 'old_issues', 'old_issues_ibfk_borrowers_borrowernumber' )) { -- 2.39.5