Bug 16223: (QA follow-up) Adjust DB changes
[koha.git] / installer / data / mysql / atomicupdate / bug_16223.pl
1 use Modern::Perl;
2
3 return {
4     bug_number  => "16223",
5     description => "Add new columns lift_after_payment and fee_limit to table restriction_types",
6     up          => sub {
7         my ($args) = @_;
8         my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10         if ( !column_exists( 'restriction_types', 'lift_after_payment' ) ) {
11             $dbh->do(
12                 q{
13                 ALTER TABLE restriction_types
14                     ADD COLUMN `lift_after_payment` tinyint(1) NOT NULL DEFAULT 0
15                     AFTER `is_default`
16             }
17             );
18
19             say $out "Added column 'restriction_types.lift_after_payment'";
20         }
21
22         if ( !column_exists( 'restriction_types', 'fee_limit' ) ) {
23             $dbh->do(
24                 q{
25                 ALTER TABLE restriction_types
26                     ADD COLUMN `fee_limit` decimal(28,6) DEFAULT NULL
27                     AFTER `lift_after_payment`
28             }
29             );
30
31             say $out "Added column 'restriction_types.fee_limit'";
32         }
33     },
34 };