From f4f57550bc90d77d1d469f8c683e02668b94b1a4 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 8 Jun 2023 09:45:18 -0400 Subject: [PATCH] Bug 27424: (QA follow-up) Make db update idempotent Signed-off-by: Tomas Cohen Arazi (cherry picked from commit f9002b96cd9e052a9332107cf05c43dadff8af78) Signed-off-by: Martin Renvoize --- installer/data/mysql/db_revs/221200002.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/db_revs/221200002.pl b/installer/data/mysql/db_revs/221200002.pl index 07d4ac56e6..86ed85db9f 100755 --- a/installer/data/mysql/db_revs/221200002.pl +++ b/installer/data/mysql/db_revs/221200002.pl @@ -6,6 +6,8 @@ return { up => sub { my ($args) = @_; my ($dbh, $out) = @$args{qw(dbh out)}; - $dbh->do(q{ALTER TABLE smtp_servers ADD COLUMN `is_default` tinyint(1) NOT NULL DEFAULT 0 AFTER debug}); + unless ( column_exists( 'smtp_servers', 'is_default' ) ) { + $dbh->do(q{ALTER TABLE smtp_servers ADD COLUMN `is_default` tinyint(1) NOT NULL DEFAULT 0 AFTER debug}); + } }, }; -- 2.39.5