You are here

function quotes_update_3 in Quotes 5

Implementation of hook_update_N(). Fixes the primary key on the quotes table, adds indexes on the nid and promote columns, and deletes the quotes_version variable.

File

./quotes.install, line 180
Handles installation and updates for the quotes module.

Code

function quotes_update_3() {
  global $db_type;
  $items = array();
  if ($db_type == 'pgsql') {
    $items[] = update_sql('ALTER TABLE {quotes} DROP CONSTRAINT {quotes}_pkey');
  }
  else {
    $items[] = update_sql('ALTER TABLE {quotes} DROP PRIMARY KEY');
  }
  $items[] = update_sql('ALTER TABLE {quotes} ADD PRIMARY KEY (vid)');
  $items[] = update_sql('CREATE INDEX {quotes}_nid ON {quotes} (nid)');
  $items[] = update_sql('CREATE INDEX {quotes}_promote ON {quotes} (promote)');
  variable_del('quotes_version');
  return $items;
}