You are here

function ip_geoloc_update_7125 in IP Geolocation Views & Maps 7

Allow for the storage of ipv6 as well as standard IP addresses.

File

./ip_geoloc.install, line 289
Install and uninstall hooks for IP Geolocation Views & Maps.

Code

function ip_geoloc_update_7125() {
  db_drop_index('ip_geoloc', 'ip_address');
  $spec = array(
    'description' => 'IP address',
    'type' => 'varchar',
    // Support IPv6 as well as standard IPv4 addresses.
    'length' => '64',
    'not null' => TRUE,
  );
  $index = array(
    'indexes' => array(
      'ip_address' => array(
        'ip_address',
      ),
    ),
  );
  db_change_field('ip_geoloc', 'ip_address', 'ip_address', $spec, $index);

  // db_add_index('ip_geoloc', 'ip_address', array('ip_address'));
  return t('ip_address column updated.');
}