function DatabaseSchema_pgsql::addIndex
Overrides DatabaseSchema::addIndex
1 call to DatabaseSchema_pgsql::addIndex()
- DatabaseSchema_pgsql::_createKeys in includes/
database/ pgsql/ schema.inc
File
-
includes/
database/ pgsql/ schema.inc, line 683
Class
Code
public function addIndex($table, $name, $fields) {
if (!$this->tableExists($table)) {
throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot add index @name to table @table: table doesn't exist.", array(
'@table' => $table,
'@name' => $name,
)));
}
if ($this->indexExists($table, $name)) {
throw new DatabaseSchemaObjectExistsException(t("Cannot add index @name to table @table: index already exists.", array(
'@table' => $table,
'@name' => $name,
)));
}
$this->connection
->query($this->_createIndexSql($table, $name, $fields));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.