You are here

function ldap_query_update_7100 in Lightweight Directory Access Protocol (LDAP) 8.2

Same name and namespace in other branches
  1. 7.2 ldap_query/ldap_query.install \ldap_query_update_7100()
  2. 7 ldap_query/ldap_query.install \ldap_query_update_7100()

Add scope field to ldap_query table.

File

ldap_query/ldap_query.install, line 70
Install, update and uninstall functions for the LDAP API module.

Code

function ldap_query_update_7100() {
  module_load_include('inc', 'ldap_servers', 'ldap_servers.functions');
  ldap_servers_module_load_include('module', 'ldap_servers', 'ldap_servers');

  // get LDAP_SCOPE_SUBTREE constant
  // make sure 'create_consumers' field is there for old 7.x-1.x-dev versions
  if (!db_field_exists('ldap_query', 'scope')) {
    db_add_field('ldap_query', 'scope', array(
      'type' => 'int',
      'size' => 'small',
      'not null' => FALSE,
      'default' => LDAP_SCOPE_SUBTREE,
    ));
    return t('"scope" field added to ldap_query table');
  }
  else {
    return t('No database changes made.');
  }
}