Skip to content

Commit ef04921

Browse files
committed
Add logging for fulltext index errors
1 parent 0343a0a commit ef04921

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

modules/datastore/src/DataDictionary/AlterTableQuery/MySQLQuery.php

+9-4
Original file line numberDiff line numberDiff line change
@@ -538,10 +538,15 @@ protected function buildAddIndexOptions(array $indexes, string $table, array $ty
538538
* Description of the index.
539539
*/
540540
protected function executeFulltextAlter(string $table, string $name, string $formatted_field_options, string $comment): void {
541-
// Innodb only allows adding one fulltext index at a time.
542-
$command = $this->connection->prepareStatement("ALTER TABLE {{$table}} ADD FULLTEXT INDEX {$name} ({$formatted_field_options}) COMMENT '{$comment}';", []);
543-
// Execute alter command.
544-
$command->execute();
541+
try {
542+
// Innodb only allows adding one fulltext index at a time.
543+
$command = $this->connection->prepareStatement("ALTER TABLE {{$table}} ADD FULLTEXT INDEX {$name} ({$formatted_field_options}) COMMENT '{$comment}';", []);
544+
// Execute alter command.
545+
$command->execute();
546+
}
547+
catch (\Exception) {
548+
\Drupal::logger('Data Dictionary')->error("Error applying fulltext index to dataset {$comment}");
549+
}
545550
}
546551

547552
/**

0 commit comments

Comments
 (0)