Bug 14783: Update atomicupdate syntax
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
ef37acfb73
commit
3da8a25253
|
|
@ -1,10 +0,0 @@
|
|||
|
||||
|
||||
$DBversion = 'XXX'; # will be replaced by the RM
|
||||
if( CheckVersion( $DBversion ) ) {
|
||||
$dbh->do( "INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('OPACAllowUserToChangeBranch','','Pending, In-Transit, Suspended','Allow users to change the library to pick up a hold for these statuses:','multiple');" );
|
||||
$dbh->do( "UPDATE systempreferences set value = (SELECT CASE WHEN value = 1 THEN 'intransit' ELSE '' END FROM systempreferences WHERE variable = 'OPACInTransitHoldPickupLocationChange')");
|
||||
$dbh->do( "DELETE FROM systempreferences WHERE variable = 'OPACInTransitHoldPickupLocationChange' ");
|
||||
# Always end with this (adjust the bug info)
|
||||
NewVersion( $DBversion, 14783, "Allow patrons to change pickup location for non-waiting holds");
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
use Modern::Perl;
|
||||
|
||||
return {
|
||||
bug_number => "14783",
|
||||
description => "Allow patrons to change pickup location for non-waiting holds",
|
||||
up => sub {
|
||||
my ($args) = @_;
|
||||
my ($dbh, $out) = @$args{qw(dbh out)};
|
||||
|
||||
$dbh->do(q{
|
||||
INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type)
|
||||
VALUES ('OPACAllowUserToChangeBranch','','Pending, In-Transit, Suspended','Allow users to change the library to pick up a hold for these statuses:','multiple');
|
||||
});
|
||||
|
||||
$dbh->do(q{
|
||||
UPDATE systempreferences SET value = (SELECT CASE WHEN value = 1 THEN 'intransit' ELSE '' END
|
||||
FROM systempreferences
|
||||
WHERE variable = 'OPACInTransitHoldPickupLocationChange')
|
||||
});
|
||||
|
||||
say $out "Added new system preference 'OPACAllowUserToChangeBranch'";
|
||||
|
||||
$dbh->do(q{
|
||||
DELETE FROM systempreferences
|
||||
WHERE variable = 'OPACInTransitHoldPickupLocationChange'
|
||||
});
|
||||
|
||||
say $out "Removed system preference 'OPACInTransitHoldPickupLocationChange'";
|
||||
},
|
||||
};
|
||||
Loading…
Reference in New Issue