Index: trunk/extensions/METIS/METIS.php |
— | — | @@ -50,13 +50,20 @@ |
51 | 51 | return true; |
52 | 52 | } |
53 | 53 | |
54 | | -function efMetisSchemaUpdate() { |
55 | | - global $wgDBtype, $wgExtNewTables; |
56 | | - |
57 | | - if ( $wgDBtype == 'mysql' ) { |
58 | | - $wgExtNewTables[] = array( 'metis', dirname( __FILE__ ) . '/METIS.sql' ); |
59 | | - } elseif( $wgDBtype == 'postgres' ) { |
60 | | - $wgExtNewTables[] = array( 'metis', dirname( __FILE__ ) . '/METIS.pg.sql' ); |
| 54 | +function efMetisSchemaUpdate( $updater = null ) { |
| 55 | + if ( $updater === null ) { |
| 56 | + global $wgDBtype, $wgExtNewTables; |
| 57 | + if ( $wgDBtype == 'mysql' ) { |
| 58 | + $wgExtNewTables[] = array( 'metis', dirname( __FILE__ ) . '/METIS.sql' ); |
| 59 | + } elseif ( $wgDBtype == 'postgres' ) { |
| 60 | + $wgExtNewTables[] = array( 'metis', dirname( __FILE__ ) . '/METIS.pg.sql' ); |
| 61 | + } |
| 62 | + } else { |
| 63 | + if ( $updater->getDB()->getType() == 'mysql' ) { |
| 64 | + $updater->addExtensionUpdate( array( 'addTable', 'metis', dirname( __FILE__ ) . '/METIS.sql', true ) ); |
| 65 | + } elseif ( $updater->getDB()->getType() == 'postgres' ) { |
| 66 | + $updater->addExtensionUpdate( array( 'addTable', 'metis', dirname( __FILE__ ) . '/METIS.pg.sql', true ) ); |
| 67 | + } |
61 | 68 | } |
62 | 69 | return true; |
63 | 70 | } |