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

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