You are here

function geshinode_update_6001 in GeSHi Filter for syntax highlighting 6

Implementation of hook_update_N().

Fix the primary key and indices on the geshinode table. See http://drupal.org/node/363770 .

File

./geshinode.install, line 65
Installation and uninstallation functions for the GeSHi node module.

Code

function geshinode_update_6001() {
  $ret = array();

  // Drop unique key on 'vid'.
  db_drop_unique_key($ret, 'geshinode', 'vid');

  // Change the 'nid' field to 'int' (from 'serial').
  db_change_field($ret, 'geshinode', 'nid', 'nid', array(
    'description' => t('The primary identifier for a node.'),
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
  ));

  // Drop primary key ('nid').
  db_drop_primary_key($ret, 'geshinode');

  // Add primary key on 'vid'.
  db_add_primary_key($ret, 'geshinode', array(
    'vid',
  ));

  // Add an index on 'nid'.
  db_add_index($ret, 'geshinode', 'nid', array(
    'nid',
  ));
  return $ret;
}