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

(-)a/installer/data/mysql/atomicupdate/bug_18177.perl (-4 / +12 lines)
Lines 3-12 if( CheckVersion( $DBversion ) ) { Link Here
3
3
4
    for my $column ( qw(othersupplier booksellerfax booksellerurl bookselleremail currency) ) {
4
    for my $column ( qw(othersupplier booksellerfax booksellerurl bookselleremail currency) ) {
5
        if( column_exists( 'aqbooksellers', $column ) ) {
5
        if( column_exists( 'aqbooksellers', $column ) ) {
6
            $dbh->do(qq|
6
            my ($count) = $dbh->selectrow_array(qq|
7
                ALTER TABLE aqbooksellers
7
                SELECT COUNT(*)
8
                DROP COLUMN $column
8
                FROM aqbooksellers
9
                WHERE $column IS NOT NULL AND $column <> ""
9
            |);
10
            |);
11
            if ( $count ) {
12
                warn "Warning - Cannot remove column aqbooksellers.$column. At least one value exists";
13
            } else {
14
                $dbh->do(qq|
15
                    ALTER TABLE aqbooksellers
16
                    DROP COLUMN $column
17
                |);
18
            }
10
        }
19
        }
11
    }
20
    }
12
21
13
- 

Return to bug 18177