function user_update_7005

7.x user.install user_update_7005(&$sandbox)

Changes the users table to allow longer e-mail addresses.

Related topics

File

drupal-7.x/modules/user/user.install, line 574
Install, update and uninstall functions for the user module.

Code

function user_update_7005(&$sandbox) {
  $mail_field = array(
    'type' => 'varchar',
    'length' => 254,
    'not null' => FALSE,
    'default' => '',
    'description' => "User's e-mail address.",
  );
  $init_field = array(
    'type' => 'varchar',
    'length' => 254,
    'not null' => FALSE,
    'default' => '',
    'description' => 'E-mail address used for initial account creation.',
  );
  db_drop_index('users', 'mail');
  db_change_field('users', 'mail', 'mail', $mail_field, array('indexes' => array('mail' => array('mail'))));
  db_change_field('users', 'init', 'init', $init_field);
}