Lines 4-13
return {
Link Here
|
4 |
bug_number => "32450", |
4 |
bug_number => "32450", |
5 |
description => "Create a database flag for whether a debit type should be included in the noissuescharge block on circulation and remove redundant sysprefs.", |
5 |
description => "Create a database flag for whether a debit type should be included in the noissuescharge block on circulation and remove redundant sysprefs.", |
6 |
up => sub { |
6 |
up => sub { |
7 |
my ($args) = @_; |
7 |
my ($args) = @_; |
8 |
my ($dbh, $out) = @$args{qw(dbh out)}; |
8 |
my ($dbh, $out) = @$args{qw(dbh out)}; |
9 |
|
9 |
|
10 |
if( !column_exists( 'account_debit_types', 'restricts_checkouts' ) ) { |
10 |
if( !column_exists( 'account_debit_types', 'restricts_checkouts' ) ) { |
11 |
$dbh->do(q{ |
11 |
$dbh->do(q{ |
12 |
ALTER TABLE account_debit_types ADD COLUMN `restricts_checkouts` tinyint(1) NOT NULL DEFAULT 1 AFTER `archived` |
12 |
ALTER TABLE account_debit_types ADD COLUMN `restricts_checkouts` tinyint(1) NOT NULL DEFAULT 1 AFTER `archived` |
13 |
}); |
13 |
}); |
Lines 35-41
return {
Link Here
|
35 |
$sth->execute; |
35 |
$sth->execute; |
36 |
my $exists = $sth->fetchrow(); |
36 |
my $exists = $sth->fetchrow(); |
37 |
$sth->finish; |
37 |
$sth->finish; |
38 |
|
38 |
|
39 |
if($exists) { |
39 |
if($exists) { |
40 |
# If it exists, retrieve its value |
40 |
# If it exists, retrieve its value |
41 |
my $find_syspref_value = "SELECT value FROM systempreferences WHERE variable = '$_'"; |
41 |
my $find_syspref_value = "SELECT value FROM systempreferences WHERE variable = '$_'"; |
Lines 66-72
return {
Link Here
|
66 |
# Delete syspref as it is no longer required and the value has been transferred to account_debit_types |
66 |
# Delete syspref as it is no longer required and the value has been transferred to account_debit_types |
67 |
my $delete_redundant_syspref = "DELETE FROM systempreferences WHERE variable = '$_'"; |
67 |
my $delete_redundant_syspref = "DELETE FROM systempreferences WHERE variable = '$_'"; |
68 |
$dbh->do($delete_redundant_syspref); |
68 |
$dbh->do($delete_redundant_syspref); |
69 |
|
69 |
|
70 |
} else { |
70 |
} else { |
71 |
# If it doesn't exist then revert to default value in the database schema |
71 |
# If it doesn't exist then revert to default value in the database schema |
72 |
say $out "$_ was not found in this Koha instance, default value has been applied."; |
72 |
say $out "$_ was not found in this Koha instance, default value has been applied."; |