From f1a1a4ef4b589b5c7507d7f36a5a8c4e661bc1af Mon Sep 17 00:00:00 2001
From: David Cook <dcook@prosentient.com.au>
Date: Wed, 21 Oct 2020 04:49:31 +0000
Subject: [PATCH] Bug 26684: Fix atomic update

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
---
 .../001-26684-drop_marc_column_from_auth_header.perl        | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/installer/data/mysql/atomicupdate/001-26684-drop_marc_column_from_auth_header.perl b/installer/data/mysql/atomicupdate/001-26684-drop_marc_column_from_auth_header.perl
index 7dd8148208..bf4500c442 100755
--- a/installer/data/mysql/atomicupdate/001-26684-drop_marc_column_from_auth_header.perl
+++ b/installer/data/mysql/atomicupdate/001-26684-drop_marc_column_from_auth_header.perl
@@ -1,6 +1,8 @@
 $DBversion = 'XXX'; # will be replaced by the RM
 if( CheckVersion( $DBversion ) ) {
-     $dbh->do( "ALTER TABLE auth_header DROP COLUMN marc" );
+    if( column_exists( 'auth_header', 'marc' ) ) {
+        $dbh->do( "ALTER TABLE auth_header DROP COLUMN marc" );
+    }
 
-    NewVersion( $DBversion, XXXXX, "Drop marc column from auth_header");
+    NewVersion( $DBversion, 26684, "Drop marc column from auth_header");
 }
-- 
2.39.5