SqlContentEntityStorageSchema::addIndex

protected SqlContentEntityStorageSchema::addIndex($table, $name, array $specifier, array $schema)

Creates an index, dropping it if already existing.

Parameters

string $table: The table name.

string $name: The index name.

array $specifier: The fields to index.

array $schema: The table specification.

See also

\Drupal\Core\Database\Schema::addIndex()

File

core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php, line 1998

Class

SqlContentEntityStorageSchema
Defines a schema handler that supports revisionable, translatable entities.

Namespace

Drupal\Core\Entity\Sql

Code

protected function addIndex($table, $name, array $specifier, array $schema) {
  $schema_handler = $this->database->schema();
  $schema_handler->dropIndex($table, $name);
  $schema_handler->addIndex($table, $name, $specifier, $schema);
}
doc_Drupal
2016-10-29 09:43:34
Comments
Leave a Comment

Please login to continue.