Koha/installer/data/mysql/db_revs/220600007.pl
Jonathan Druart 027e1e1862
Bug 34684: Prevent 220600007.pl to fail if run twice
The error is
  ERROR 1292 (22007): Truncated incorrect DECIMAL value: 'no'

Happens on MariaDB 10.5.22, not MySQL 8

Test plan:
update systempreferences set value="0" where variable="DisplayClearScreenButton";
play installer/data/mysql/db_revs/220600007.pl
select value from systempreferences where variable="DisplayClearScreenButton";
=> "no"

update systempreferences set value="1" where variable="DisplayClearScreenButton";
play installer/data/mysql/db_revs/220600007.pl
select value from systempreferences where variable="DisplayClearScreenButton";
=> "issueslip"

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-06 15:05:20 -03:00

22 lines
675 B
Perl
Executable file

use Modern::Perl;
return {
bug_number => "29129",
description => "Update the DisplayClearnScreenButton system pref to allow for a choice between ISSUESLIP and ISSUEQSLIP",
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
$dbh->do(q{
UPDATE systempreferences
SET
options = 'no|issueslip|issueqslip',
type = 'Choice',
value = CASE value
WHEN "1" THEN 'issueslip'
ELSE 'no'
END
WHERE variable = 'DisplayClearScreenButton';
});
},
};