public function DataTable::dropUniqueKey in Data 6
Same name and namespace in other branches
- 7 includes/DataTable.inc \DataTable::dropUniqueKey()
Drop a unique key from a table.
Throws
File
- includes/
DataTable.inc, line 332 - Contains class definition for DataTable.
Class
- DataTable
- Manages data access and manipulation for a single data table. Use data_create_table() or data_get_table() to instantiate an object from this class.
Code
public function dropUniqueKey($field) {
$ret = array();
db_drop_unique_key($ret, $this->name, $field);
if ($ret[0]['success']) {
$schema = $this->table_schema;
unset($schema['unique keys'][$field]);
$this
->update(array(
'table_schema' => $schema,
));
drupal_get_schema($this->name, TRUE);
return;
}
throw new DataException(t('Error dropping unique key.'));
}