You are here

public function DataTable::dropPrimaryKey in Data 7

Same name and namespace in other branches
  1. 6 includes/DataTable.inc \DataTable::dropPrimaryKey()

Drop all primary keys from a table.

Throws

DataException

1 call to DataTable::dropPrimaryKey()
DataTable::changePrimaryKey in includes/DataTable.inc
Change the primary keys of a table.

File

includes/DataTable.inc, line 419
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 dropPrimaryKey() {
  db_drop_primary_key($this->name);
  $schema = $this->table_schema;
  $schema['primary key'] = array();
  $this
    ->update(array(
    'table_schema' => $schema,
  ));
  drupal_get_schema($this->name, TRUE);
  return;
}