Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLHelpers.php |
— | — | @@ -260,11 +260,11 @@ |
261 | 261 | $typeold = ( $notnullposold > 0 ) ? substr( $currentFields[$name], 0, $notnullposold ) : $currentFields[$name]; |
262 | 262 | |
263 | 263 | if ( $typeold != $type ) { |
264 | | - $db->query( "ALTER TABLE \"" . $tableName . "\" ALTER COLUMN \"" . $name . "\" ENGINE " . $type, __METHOD__ ); |
| 264 | + $db->query( "ALTER TABLE " . $tableName . " ALTER COLUMN \"" . $name . "\" ENGINE " . $type, __METHOD__ ); |
265 | 265 | } |
266 | 266 | |
267 | 267 | if ( $notnullposold != $notnullposnew ) { |
268 | | - $db->query( "ALTER TABLE \"" . $tableName . "\" ALTER COLUMN \"" . $name . "\" " . ( $notnullposnew > 0 ? 'SET' : 'DROP' ) . " NOT NULL", __METHOD__ ); |
| 268 | + $db->query( "ALTER TABLE " . $tableName . " ALTER COLUMN \"" . $name . "\" " . ( $notnullposnew > 0 ? 'SET' : 'DROP' ) . " NOT NULL", __METHOD__ ); |
269 | 269 | } |
270 | 270 | |
271 | 271 | self::reportProgress( "done.\n", $reportTo ); |
— | — | @@ -357,7 +357,9 @@ |
358 | 358 | $column = $index; |
359 | 359 | } |
360 | 360 | |
361 | | - $db->query( "CREATE $type {$rawTableName}_index{$key} ON $tableName USING btree(" . $column . ")", __METHOD__ ); |
| 361 | + if ( $db->indexInfo( $rawTableName, "{$rawTableName}_index{$key}" ) === false ) { |
| 362 | + $db->query( "CREATE $type {$rawTableName}_index{$key} ON $tableName USING btree(" . $column . ")", __METHOD__ ); |
| 363 | + } |
362 | 364 | } |
363 | 365 | } |
364 | 366 | } else { // MySQL |