You are here

function acl_update_2 in ACL 6

Same name and namespace in other branches
  1. 5 acl.install \acl_update_2()
  2. 7 acl.install \acl_update_2()

Fixes primary keys

File

./acl.install, line 135
Install, update and uninstall functions for the acl module.

Code

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

  // drop the previously created indexes (except for acl_user.uid)
  db_drop_index($ret, 'acl', 'acl_id');
  db_drop_index($ret, 'acl_user', 'acl_id');
  db_drop_index($ret, 'acl_node', 'acl_id');
  db_drop_index($ret, 'acl_node', 'nid');

  // create new indexes (as primary keys this time)
  db_add_primary_key($ret, 'acl', array(
    'acl_id',
  ));
  db_add_primary_key($ret, 'acl_user', array(
    'acl_id',
    'uid',
  ));
  db_add_primary_key($ret, 'acl_node', array(
    'acl_id',
    'nid',
  ));
  return $ret;
}