public function DatabaseSchemaInterface::addIndex in Schema 8
Add an index.
Parameters
$table: The table to be altered.
$name: The name of the index.
$fields: An array of field names.
Throws
\Drupal\Core\Database\SchemaObjectDoesNotExistException If the specified table doesn't exist.
\Drupal\Core\Database\SchemaObjectExistsException If the specified table already has an index by that name.
File
- src/
DatabaseSchemaInterface.php, line 245 - Contains Drupal\schema\DatabaseSchemaInterface.
Class
- DatabaseSchemaInterface
- This interface describes public methods of \Drupal\Core\Database\Schema.
Namespace
Drupal\schemaCode
public function addIndex($table, $name, $fields, array $spec);