Fixes #73 Delete indexes if the exist before creating them.

This commit is contained in:
Tim-Hinnerk Heuer 2017-07-27 15:46:15 +12:00
parent bddbdde5de
commit e536a8b85a

View File

@ -1124,7 +1124,8 @@ class PostgreSQLDatabase extends SS_Database {
default:
$spec = "create index \"$tableCol\" ON \"$tableName\" (" . $indexSpec['value'] . ") $fillfactor $where";
}
return trim($spec) . ';';
$deleteStatement = "drop index if exists \"$tableCol\";";
return $deleteStatement . ' '. trim($spec) . ';';
}
function getDbSqlDefinition($tableName, $indexName, $indexSpec) {