diff -u b/core/lib/Drupal/Core/Database/Schema.php b/core/lib/Drupal/Core/Database/Schema.php --- b/core/lib/Drupal/Core/Database/Schema.php +++ b/core/lib/Drupal/Core/Database/Schema.php @@ -428,11 +428,11 @@ /** * Validates whether the index is valid. * - * This method ensures that the table exists, that the new index was specified - * and that there is no index with the same name yet. + * This method ensures that the table exists and that there is no index with + * the same name yet. * * @param string $table - * The table of the index name. + * The name of the table the index will be added to. * @param string $name * The name of the index. * diff -u b/core/modules/system/src/Tests/Database/SchemaTest.php b/core/modules/system/src/Tests/Database/SchemaTest.php --- b/core/modules/system/src/Tests/Database/SchemaTest.php +++ b/core/modules/system/src/Tests/Database/SchemaTest.php @@ -302,7 +302,6 @@ $table_specification_with_new_index['indexes']['test_separate'] = [['test_field_text', 200]]; // Ensure that the exceptions of addIndex are thrown as expected. - try { $schema_object->addIndex('test_table_index_length', 'test_separate', [['test_field_text', 200]], $table_specification); $this->fail('\Drupal\Core\Database\SchemaObjectExistsException exception missed.');