View | Details | Raw Unified | Return to bug 16223
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_16223.pl (-13 / +23 lines)
Lines 1-24 Link Here
1
use Modern::Perl;
1
use Modern::Perl;
2
2
3
return {
3
return {
4
    bug_number => "16223",
4
    bug_number  => "16223",
5
    description => "Add new columns lift_after_payment and fee_limit to table restriction_types",
5
    description => "Add new columns lift_after_payment and fee_limit to table restriction_types",
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( 'restriction_types', 'lift_after_payment' ) ) {
10
        if ( !column_exists( 'restriction_types', 'lift_after_payment' ) ) {
11
            $dbh->do(q{
11
            $dbh->do(
12
                ALTER TABLE restriction_types ADD COLUMN `lift_after_payment` tinyint(1) NOT NULL DEFAULT 0
12
                q{
13
            });
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'";
14
        }
20
        }
15
        say $out "Added column lift_after_payment";
16
21
17
        if( !column_exists( 'restriction_types', 'fee_limit' ) ) {
22
        if ( !column_exists( 'restriction_types', 'fee_limit' ) ) {
18
            $dbh->do(q{
23
            $dbh->do(
19
                ALTER TABLE restriction_types ADD COLUMN `fee_limit` decimal(28,6) DEFAULT NULL
24
                q{
20
            });
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'";
21
        }
32
        }
22
        say $out "Added column fee_limit";
23
    },
33
    },
24
};
34
};
(-)a/installer/data/mysql/kohastructure.sql (-1 / +2 lines)
Lines 5048-5053 CREATE TABLE `restriction_types` ( Link Here
5048
  `display_text` text NOT NULL,
5048
  `display_text` text NOT NULL,
5049
  `is_system` tinyint(1) NOT NULL DEFAULT 0,
5049
  `is_system` tinyint(1) NOT NULL DEFAULT 0,
5050
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
5050
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
5051
  `lift_after_payment` tinyint(1) NOT NULL DEFAULT 0,
5052
  `fee_limit` decimal(28,6) DEFAULT NULL,
5051
  PRIMARY KEY (`code`)
5053
  PRIMARY KEY (`code`)
5052
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
5054
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
5053
/*!40101 SET character_set_client = @saved_cs_client */;
5055
/*!40101 SET character_set_client = @saved_cs_client */;
5054
- 

Return to bug 16223