From 33e6256619bdb572ea61fddf82c7bbfcf23c8359 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 23 Jun 2022 15:50:34 -0300 Subject: [PATCH] Bug 24239: (QA follow-up) Make dbrev idempotent Signed-off-by: Tomas Cohen Arazi --- .../bug_24239-add_date_due_to_illrequests.pl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_24239-add_date_due_to_illrequests.pl b/installer/data/mysql/atomicupdate/bug_24239-add_date_due_to_illrequests.pl index bdbbe404d3..de4f543139 100755 --- a/installer/data/mysql/atomicupdate/bug_24239-add_date_due_to_illrequests.pl +++ b/installer/data/mysql/atomicupdate/bug_24239-add_date_due_to_illrequests.pl @@ -1,15 +1,18 @@ use Modern::Perl; return { - bug_number => "24239", + bug_number => "24239", description => "Add due_date to illrequests", up => sub { my ($args) = @_; my ($dbh, $out) = @$args{qw(dbh out)}; - # Do you stuffs here - $dbh->do(q{ - ALTER TABLE `illrequests` - ADD `due_date` datetime DEFAULT NULL AFTER `biblio_id` - }); + + unless ( column_exists( 'illrequests', 'due_date' ) ) { + $dbh->do(q{ + ALTER TABLE `illrequests` + ADD COLUMN `due_date` datetime DEFAULT NULL COMMENT 'Custom date due specified by backend, leave NULL for default date_due calculation' + AFTER `biblio_id` + }); + } }, }; -- 2.34.1