Index: trunk/extensions/ReaderFeedback/ReaderFeedback.php |
— | — | @@ -140,13 +140,23 @@ |
141 | 141 | # Schema changes |
142 | 142 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'efReaderFeedbackSchemaUpdates'; |
143 | 143 | |
144 | | -function efReaderFeedbackSchemaUpdates() { |
145 | | - global $wgDBtype, $wgExtNewTables; |
146 | | - $base = dirname(__FILE__); |
147 | | - if( $wgDBtype == 'mysql' ) { |
148 | | - $wgExtNewTables[] = array( 'reader_feedback', "$base/ReaderFeedback.sql" ); // Initial install tables |
149 | | - } elseif( $wgDBtype == 'postgres' ) { |
150 | | - $wgExtNewTables[] = array( 'reader_feedback', "$base/ReaderFeedback.pg.sql" ); // Initial install tables |
| 144 | +function efReaderFeedbackSchemaUpdates( $updater = null ) { |
| 145 | + $base = dirname( __FILE__ ); |
| 146 | + if ( $updater === null ) { |
| 147 | + global $wgDBtype, $wgExtNewTables; |
| 148 | + if( $wgDBtype == 'mysql' ) { |
| 149 | + $wgExtNewTables[] = array( 'reader_feedback', "$base/ReaderFeedback.sql" ); // Initial install tables |
| 150 | + } elseif( $wgDBtype == 'postgres' ) { |
| 151 | + $wgExtNewTables[] = array( 'reader_feedback', "$base/ReaderFeedback.pg.sql" ); // Initial install tables |
| 152 | + } |
| 153 | + } else { |
| 154 | + if( $updater->getDB()->getType() == 'mysql' ) { |
| 155 | + $updater->addExtensionUpdate( array( 'addTable', 'reader_feedback', |
| 156 | + "$base/ReaderFeedback.sql", true ) ); // Initial install tables |
| 157 | + } elseif( $updater->getDB()->getType() == 'postgres' ) { |
| 158 | + $updater->addExtensionUpdate( array( 'addTable', 'reader_feedback', |
| 159 | + "$base/ReaderFeedback.pg.sql", true ) ); // Initial install tables |
| 160 | + } |
151 | 161 | } |
152 | 162 | return true; |
153 | 163 | } |