Bug 30588: Add missing atomic update

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2022-07-28 10:05:03 +02:00 committed by Tomas Cohen Arazi
parent 76c7f857e5
commit c98b623313
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -0,0 +1,17 @@
use Modern::Perl;
return {
bug_number => "30588",
description => "Add an 'enforce' option for TwoFactorAuthentication",
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
$dbh->do(q{
UPDATE systempreferences
SET options="enforced|enabled|disabled",
value=CASE value WHEN '1' THEN 'enabled' ELSE 'disabled' END,
type="Choice"
WHERE variable="TwoFactorAuthentication"
});
},
};