You are here

function invite_update_2 in Invite 5.2

Same name and namespace in other branches
  1. 5 invite.install \invite_update_2()

Drop duplicate index on reg_code. Add index for uid.

File

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

Code

function invite_update_2() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("ALTER TABLE {invite} DROP INDEX reg_code_idx");
      $ret[] = update_sql("ALTER TABLE {invite} ADD INDEX (uid)");
      break;
    case 'pgsql':
      $ret[] = update_sql("DROP INDEX reg_code_idx");
      $ret[] = update_sql("CREATE INDEX {invite}_uid_idx ON {invite} (uid)");
      break;
  }
  return $ret;
}