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

(-)a/installer/data/mysql/atomicupdate/bug_36453.pl (-1 / +29 lines)
Line 0 Link Here
0
- 
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_failure say_success say_info);
3
4
return {
5
    bug_number  => "36453",
6
    description => "Update BlockExpiredPatronOpacActions where 240600002.pl was already run",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
        my $sth = $dbh->prepare(
12
            q{
13
            SELECT DATA_TYPE 
14
                FROM INFORMATION_SCHEMA.COLUMNS 
15
                WHERE TABLE_NAME = 'categories' and COLUMN_NAME = 'BlockExpiredPatronOpacActions'
16
        }
17
        );
18
        $sth->execute;
19
        my $data_type = $sth->fetchrow();
20
21
        if( $data_type eq 'mediumtext' ) {
22
            $dbh->do(
23
                "ALTER TABLE categories MODIFY BlockExpiredPatronOpacActions varchar(128) NOT NULL DEFAULT 'follow_syspref_BlockExpiredPatronOpacActions' COMMENT 'specific actions expired patrons of this category are blocked from performing or if the BlockExpiredPatronOpacActions system preference is to be followed'"
24
            ) and say_success( $out, "Updated categories.BlockExpiredPatronOpacActions to varchar(128)" );
25
        }else{
26
            say_info( $out, "categories.BlockExpiredPatronOpacActions already varchar(128)" );
27
        }
28
    },
29
};

Return to bug 36453