You are here

function acl_update_4 in ACL 5

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

Put back acl_node(nid) index for deleting nodes and clean up {acl_node}.

File

./acl.install, line 149

Code

function acl_update_4() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'mysqli':
    case 'mysql':
      $ret[] = update_sql("ALTER TABLE {acl_node} ADD INDEX (nid)");
      break;
    case 'pgsql':
      $ret[] = update_sql('CREATE INDEX {acl_node}_nid_index ON {acl_node} (nid)');
      break;
  }
  db_query("DELETE FROM {acl_node} WHERE nid NOT IN (SELECT nid FROM {node})");
  return $ret;
}