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

(-)a/installer/data/mysql/atomicupdate/bug_21066.perl (-6 / +12 lines)
Lines 1-9 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q|
3
    if( column_exists( 'opac_news', 'timestamp' ) ) {
4
        ALTER TABLE opac_news
4
        $dbh->do(q|
5
        CHANGE COLUMN timestamp publicationdate date DEFAULT NULL,
5
            ALTER TABLE opac_news
6
        ADD COLUMN updated_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
6
            CHANGE COLUMN timestamp publicationdate date DEFAULT NULL
7
    |);
7
        |);
8
    }
9
    if( !column_exists( 'opac_news', 'updated_on' ) ) {
10
        $dbh->do(q|
11
            ALTER TABLE opac_news
12
            ADD COLUMN updated_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER publicationdate
13
        |);
14
    }
8
    NewVersion( $DBversion, 21066, "Update table opac_news");
15
    NewVersion( $DBversion, 21066, "Update table opac_news");
9
}
16
}
10
- 

Return to bug 21066