Bug 35906: (QA follow-up) Remove use of IF NOT EXISTS

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Tomas Cohen Arazi 2024-11-01 18:06:08 -03:00
parent 86060310d4
commit adfd70b1be
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 8 additions and 6 deletions

View File

@ -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{