public function DataTable::dropPrimaryKey

cis7 DataTable.inc public DataTable::dropPrimaryKey()

Drop all primary keys from a table.

Throws

DataException

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

File

sites/all/modules/local_contrib/data/includes/DataTable.inc, line 430
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;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.