function system_update_7065

Remove the default value for sid.

Related topics

File

modules/system/system.install, line 3121

Code

function system_update_7065() {
  $spec = array(
    'description' => "A session ID. The value is generated by Drupal's session handlers.",
    'type' => 'varchar',
    'length' => 128,
    'not null' => TRUE,
  );
  db_drop_primary_key('sessions');
  db_change_field('sessions', 'sid', 'sid', $spec, array(
    'primary key' => array(
      'sid',
      'ssid',
    ),
  ));
  // Delete any sessions with empty session ID.
  db_delete('sessions')->condition('sid', '')
    ->execute();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.