You are here

function user_update_7005 in Drupal 7

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

Related topics

File

modules/user/user.install, line 579
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);
}