You are here

function privatemsg_update_6007 in Privatemsg 6

Update indexes on {pm_index} and {pm_message}.

File

./privatemsg.install, line 495
Install file for privatemsg.module

Code

function privatemsg_update_6007() {
  $ret = array();

  // Delete unecessary indexes.
  db_drop_index($ret, 'pm_index', 'mid');
  db_drop_index($ret, 'pm_index', 'thread_id');
  db_drop_index($ret, 'pm_index', 'uid');
  db_drop_index($ret, 'pm_message', 'author');
  db_drop_index($ret, 'pm_message', 'subject');
  db_drop_index($ret, 'pm_message', 'timestamp');

  // Add new indexes.
  db_add_index($ret, 'pm_index', 'list', array(
    'uid',
    'deleted',
    'is_new',
  ));
  db_add_index($ret, 'pm_index', 'messages', array(
    'mid',
    'uid',
  ));
  db_add_index($ret, 'pm_index', 'participants', array(
    'thread_id',
    'uid',
    'deleted',
  ));
  return $ret;
}