Bug 12446: (QA follow-up) Minor kohastructure.sql fix
[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) = @$args{qw(dbh)};
9
10         unless ( column_exists( 'categories', 'canbeguarantee' ) ) {
11             $dbh->do(q{
12                 ALTER TABLE categories
13                     ADD COLUMN `canbeguarantee` tinyint(1) NOT NULL default 0 COMMENT 'if patrons of this category can be guarantees'
14                     AFTER `checkprevcheckout`
15             });
16         }
17
18         $dbh->do(q{
19             UPDATE categories
20             SET canbeguarantee = 1
21             WHERE category_type = 'P' OR category_type = 'C'
22         });
23     },
24 };