From adfd70b1beb5c6ec83bed6b05edd55ba8c5ad3bb Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 1 Nov 2024 18:06:08 -0300 Subject: [PATCH] Bug 35906: (QA follow-up) Remove use of IF NOT EXISTS Signed-off-by: Tomas Cohen Arazi --- installer/data/mysql/db_revs/240600045.pl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/installer/data/mysql/db_revs/240600045.pl b/installer/data/mysql/db_revs/240600045.pl index fa3423fc77c..414d0301872 100755 --- a/installer/data/mysql/db_revs/240600045.pl +++ b/installer/data/mysql/db_revs/240600045.pl @@ -8,13 +8,15 @@ return { my ($args) = @_; my ( $dbh, $out ) = @$args{qw(dbh out)}; - $dbh->do( - q{ - ALTER TABLE itemtypes ADD IF NOT EXISTS bookable INT(1) DEFAULT 0 AFTER automatic_checkin + if ( !column_exists( 'itemtypes', 'bookable' ) ) { + $dbh->do( + q{ + ALTER TABLE itemtypes ADD COLUMN bookable INT(1) DEFAULT 0 AFTER automatic_checkin + } + ); + + say_success( $out, "Added column 'itemtypes.bookable'" ); } - ); - - say_success( $out, "Added column 'itemtypes.bookable'" ); $dbh->do( q{ -- 2.47.0