Index: trunk/extensions/FBConnect/FBConnectHooks.php |
— | — | @@ -154,13 +154,23 @@ |
155 | 155 | * is set, then the table 'user_fbconnect' will be prefixed accordingly. Make |
156 | 156 | * sure that fbconnect_table.sql is updated with the database prefix beforehand. |
157 | 157 | */ |
158 | | - static function LoadExtensionSchemaUpdates() { |
159 | | - global $wgDBtype, $wgDBprefix, $wgExtNewTables; |
| 158 | + static function LoadExtensionSchemaUpdates( $updater = null ) { |
160 | 159 | $base = dirname( __FILE__ ); |
161 | | - if ( $wgDBtype == 'mysql' ) { |
162 | | - $wgExtNewTables[] = array( "{$wgDBprefix}user_fbconnect", "$base/fbconnect_table.sql" ); |
163 | | - } elseif ( $wgDBtype == 'postgres' ) { |
164 | | - $wgExtNewTables[] = array( "{$wgDBprefix}user_fbconnect", "$base/fbconnect_table.pg.sql" ); |
| 160 | + if ( $updater === null ) { |
| 161 | + global $wgDBtype, $wgDBprefix, $wgExtNewTables; |
| 162 | + if ( $wgDBtype == 'mysql' ) { |
| 163 | + $wgExtNewTables[] = array( "{$wgDBprefix}user_fbconnect", "$base/fbconnect_table.sql" ); |
| 164 | + } elseif ( $wgDBtype == 'postgres' ) { |
| 165 | + $wgExtNewTables[] = array( "{$wgDBprefix}user_fbconnect", "$base/fbconnect_table.pg.sql" ); |
| 166 | + } |
| 167 | + } else { |
| 168 | + if ( $updater->getDB()->getType() == 'mysql' ) { |
| 169 | + $updater->addExtensionUpdate( array( 'addTable', 'user_fbconnect', |
| 170 | + "$base/fbconnect_table.sql", true ) ); |
| 171 | + } elseif ( $updater->getDB()->getType() == 'postgres' ) { |
| 172 | + $updater->addExtensionUpdate( array( 'addTable', 'user_fbconnect', |
| 173 | + "$base/fbconnect_table.pg.sql", true ) ); |
| 174 | + } |
165 | 175 | } |
166 | 176 | return true; |
167 | 177 | } |