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

(-)a/installer/data/mysql/atomicupdate/bug_23260.pl (-1 / +25 lines)
Line 0 Link Here
0
- 
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_success say_info);
3
4
return {
5
    bug_number  => "23260",
6
    description =>
7
        "Make borrowernumber from items_last_borrower nullable, and add AnonymizeLastBorrower and AnonymizeLastBorrowerDays preferences",
8
    up => sub {
9
        my ($args) = @_;
10
        my ( $dbh, $out ) = @$args{qw(dbh out)};
11
12
        # Do you stuffs here
13
        $dbh->do("ALTER TABLE items_last_borrower MODIFY COLUMN `borrowernumber` int(11) NULL");
14
        say_success( $out, "items_last_borrower updated to allow NULL borrowernumbers" );
15
16
        $dbh->do(
17
            q{
18
            INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
19
            ('AnonymizeLastBorrower','0',NULL,'If enabled, anonymize item\'s last borrower','YesNo'),
20
            ('AnonymizeLastBorrowerDays','0',NULL,'Item\'s last borrower older than this preference will be anonymized','Integer')
21
        }
22
        );
23
        say_success( $out, "Added new system preferences 'AnonymizeLastBorrower' and 'AnonymizeLastBorrowerDays'" );
24
    },
25
};

Return to bug 23260