Bug 32745: DBRev 22.12.00.025
[koha.git] / installer / data / mysql / db_revs / 220600004.pl
1 use Modern::Perl;
2
3 return {
4     bug_number  => "12446",
5     description => "Ability to allow guarantor relationship for all patron category types",
6     up => sub {
7         my ($args) = @_;
8         my ($dbh,$out) = @$args{qw(dbh out)};
9
10         unless ( column_exists( 'categories', 'can_be_guarantee' ) ) {
11             $dbh->do(q{
12                 ALTER TABLE categories
13                     ADD COLUMN `can_be_guarantee` tinyint(1) NOT NULL default 0 COMMENT 'if patrons of this category can be guarantees'
14                     AFTER `checkprevcheckout`
15             });
16             say $out "Added column 'categories.can_be_guarantee'";
17         }
18
19         $dbh->do(q{
20             UPDATE categories
21             SET can_be_guarantee = 1
22             WHERE category_type = 'P' OR category_type = 'C'
23         });
24     },
25 };