You are here

function system_update_7065 in Drupal 7

Remove the default value for sid.

Related topics

File

modules/system/system.install, line 3081
Install, update and uninstall functions for the system module.

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();
}