Line 0
Link Here
|
|
|
1 |
use Modern::Perl; |
2 |
use Koha::Installer::Output qw(say_warning say_failure say_success say_info); |
3 |
|
4 |
return { |
5 |
bug_number => "35635", |
6 |
description => "Add opac_mandatory column to borrower_attribute_type table", |
7 |
up => sub { |
8 |
my ($args) = @_; |
9 |
my ( $dbh, $out ) = @$args{qw(dbh out)}; |
10 |
|
11 |
if ( !column_exists( 'borrower_attribute_types', 'opac_mandatory' ) ) { |
12 |
$dbh->do( |
13 |
q{ |
14 |
ALTER TABLE borrower_attribute_types |
15 |
ADD COLUMN `opac_mandatory` tinyint(1) DEFAULT 0 COMMENT 'defines if the attribute is mandatory or not on the OPAC' |
16 |
AFTER `mandatory` |
17 |
} |
18 |
); |
19 |
|
20 |
say $out "Added column 'borrower_attribute_types.opac_mandatory'"; |
21 |
|
22 |
$dbh->do( |
23 |
q{ |
24 |
UPDATE borrower_attribute_types |
25 |
SET opac_mandatory = 1 WHERE mandatory = 1; |
26 |
} |
27 |
); |
28 |
say $out "Update opac_mandatory to match mandatory column"; |
29 |
} |
30 |
}, |
31 |
|
32 |
}; |