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

(-)a/installer/data/mysql/atomicupdate/bug_30565.pl (-1 / +19 lines)
Line 0 Link Here
0
- 
1
use Modern::Perl;
2
3
return {
4
    bug_number => 30565,
5
    description => "Update table stockrotationrotas",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        if( !unique_key_exists('stockrotationrotas', 'stockrotationrotas_title') ) {
10
            $dbh->do( q|
11
ALTER TABLE stockrotationrotas ADD CONSTRAINT UNIQUE KEY stockrotationrotas_title (title)
12
            |);
13
        }
14
        # Make sure that description is NOT NULL
15
        $dbh->do( q|
16
ALTER TABLE stockrotationrotas MODIFY COLUMN description text NOT NULL COMMENT 'Description for this rota'
17
        |);
18
    },
19
};

Return to bug 30565