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

(-)a/installer/data/mysql/atomicupdate/bug_27945.perl (-15 lines)
Lines 1-15 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    # you can use $dbh here like:
4
    # $dbh->do( "ALTER TABLE biblio ADD COLUMN badtaste int" );
5
6
    # or perform some test and warn
7
    if( !column_exists( 'categories', 'article_request_limit' ) ) {
8
      $dbh->do(q{
9
        ALTER TABLE `categories` ADD COLUMN `article_request_limit` tinyint(4) DEFAULT NULL COMMENT 'Limit article scan requests per day' AFTER `article_request_fee`
10
      });
11
    }
12
13
    # Always end with this (adjust the bug info)
14
    NewVersion( $DBversion, 27945, "Add article_request_limit to categories table");
15
}
(-)a/installer/data/mysql/atomicupdate/bug_27945.pl (-1 / +17 lines)
Line 0 Link Here
0
- 
1
use Modern::Perl;
2
3
return {
4
    bug_number => "27945",
5
    description => "Add article_request_limit to categories table",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        # Do you stuffs here
10
        if( !column_exists( 'categories', 'article_request_limit' ) ) {
11
          $dbh->do(q{
12
            ALTER TABLE `categories`
13
              ADD COLUMN `article_request_limit` tinyint(4) DEFAULT NULL COMMENT 'Limit article scan requests per day' AFTER `exclude_from_local_holds_priority`
14
          });
15
        }
16
    },
17
}

Return to bug 27945