@@ -, +, @@ --- .../data/mysql/atomicupdate/bug_20472a.perl | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) --- a/installer/data/mysql/atomicupdate/bug_20472a.perl +++ a/installer/data/mysql/atomicupdate/bug_20472a.perl @@ -1,9 +1,16 @@ $DBversion = 'XXX'; # will be replaced by the RM if( CheckVersion( $DBversion ) ) { - $dbh->do(q| - ALTER TABLE article_requests - ADD COLUMN `format` enum('PHOTOCOPY', 'SCAN') NOT NULL DEFAULT 'PHOTOCOPY' AFTER notes, - ADD COLUMN `urls` MEDIUMTEXT AFTER format - |); + unless ( column_exists('article_requests', 'format') ) { + $dbh->do(q| + ALTER TABLE article_requests + ADD COLUMN `format` enum('PHOTOCOPY', 'SCAN') NOT NULL DEFAULT 'PHOTOCOPY' AFTER notes + |); + } + unless ( column_exists('article_requests', 'urls') ) { + $dbh->do(q| + ALTER TABLE article_requests + ADD COLUMN `urls` MEDIUMTEXT AFTER format + |); + } NewVersion( $DBversion, 20472, "Add columns format and urls in article_requests table"); } --