Skip to content

Commit

Permalink
Add indeces to the userLoginLog to help with cleanup. Fixes bug #12008
Browse files Browse the repository at this point in the history
  • Loading branch information
perlDreamer committed Jan 10, 2011
1 parent 702d00b commit 727e45c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/changelog/7.x.x.txt
Expand Up @@ -26,6 +26,7 @@
- fixed #11975: Cannot paste threads: "Cannot call method isa()"
- fixed #11976: Use Container URL in search gives user Permission Denied
- fixed #11985: Search.pl should warn on bad assets
- fixed #12008: Activity CleanLoginHistory is too slow

7.10.6
- fixed #11974: Toolbar icons unclickable in Webkit using HTML5
Expand Down
20 changes: 20 additions & 0 deletions docs/upgrades/upgrade_7.10.6-7.10.7.pl
Expand Up @@ -32,6 +32,7 @@ BEGIN

# upgrade functions go here
addEmailIndexToProfile( $session );
addIndecesToUserLoginLog($session);

finish($session); # this line required

Expand All @@ -55,6 +56,25 @@ sub addEmailIndexToProfile {
print "DONE!\n" unless $quiet;
}

#----------------------------------------------------------------------------
sub addIndecesToUserLoginLog {
my $session = shift;
print "\tAdd indeces to userLoginLog to speed cleanup... " unless $quiet;
# and here's our code
my $sth = $session->db->read('SHOW CREATE TABLE userLoginLog');
my ($field,$stmt) = $sth->array;
$sth->finish;
unless ($stmt =~ m/KEY `userId`/i) {
$session->db->write("ALTER TABLE userLoginLog ADD INDEX userId (userId)");
}
unless ($stmt =~ m/KEY `timeStamp`/i) {
$session->db->write("ALTER TABLE userLoginLog ADD INDEX timeStamp (timeStamp)");
}

print "DONE!\n" unless $quiet;
}


# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------

#----------------------------------------------------------------------------
Expand Down

0 comments on commit 727e45c

Please sign in to comment.