$this->changePrefix( $wgDBtype != 'oracle' ? 'parsertest_' : 'pt_' );
$newTableName = $db->tableName( $tbl );
- if ( $db->tableExists( $tbl ) && $wgDBtype != 'postgres' && $wgDBtype != 'oracle' ) {
+ if ( $wgDBtype == 'mysql' ) {
+ $db->query( "DROP TABLE IF EXISTS $newTableName" );
+ } elseif ( in_array( $wgDBtype, array( 'postgres', 'oracle' ) ) ) {
+ /* DROPs wouldn't work due to Foreign Key Constraints (bug 14990, r58669)
+ * Use "DROP TABLE IF EXISTS $newTableName CASCADE" for postgres? That
+ * syntax would also work for mysql.
+ */
+ } elseif ( $db->tableExists( $tbl ) ) {
$db->query( "DROP TABLE $newTableName" );
}
# Create new table