BUGFIX MSSQLDatabase::getIndexSqlDefinition() should check a primary key exists before trying to use an empty variable and causing dev/build failures

This commit is contained in:
Sean Harvey 2011-10-13 13:57:04 +13:00
parent 4b933d7e73
commit c1ba0fafc9

View File

@ -851,7 +851,9 @@ class MSSQLDatabase extends SS_Database {
if($this->fullTextIndexExists($tableName)) {
$query .= "\nDROP FULLTEXT INDEX ON \"$tableName\";";
}
$query .= "CREATE FULLTEXT INDEX ON \"$tableName\" ({$indexSpec['value']}) KEY INDEX $primary_key WITH CHANGE_TRACKING AUTO;";
if($primary_key) {
$query .= "CREATE FULLTEXT INDEX ON \"$tableName\" ({$indexSpec['value']}) KEY INDEX $primary_key WITH CHANGE_TRACKING AUTO;";
}
return $query;
}
}