You are here

function invite_update_202 in Invite 5.2

Same name and namespace in other branches
  1. 6.2 invite.install \invite_update_202()
  2. 7.2 invite.install \invite_update_202()

Optimize index of notification table.

File

./invite.install, line 442
Installation file for invite module.

Code

function invite_update_202() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("ALTER TABLE {invite_notifications} DROP INDEX uid,  ADD UNIQUE uid_invitee (uid, invitee)");
      break;
    case 'pgsql':
      $ret[] = update_sql("DROP INDEX {invite_notifications}_uid_idx");
      $ret[] = update_sql("CREATE UNIQUE INDEX {invite_notifications}_uid_invitee_key ON {invite_notifications}(uid, invitee)");
      break;
  }
  return $ret;
}