Update user mover and expunge tool to work for Dreamwidth.

        Patch by mark. 

diffs (34 lines):

diff -r c92b1f233edf -r 9c1befb01566 bin/moveucluster.pl
--- a/bin/moveucluster.pl       Fri Apr 02 03:40:35 2010 +0000
+++ b/bin/moveucluster.pl       Fri Apr 02 03:46:01 2010 +0000
@@ -529,8 +529,7 @@ sub moveUser {
             $dbh->do("DELETE FROM syndicated WHERE userid = ?", undef, $u->id);
             $dbh->do("DELETE FROM supportnotify WHERE userid = ?", undef, 
$u->id);
             $dbh->do("DELETE FROM reluser WHERE userid = ?", undef, $u->id);
-            $dbh->do("DELETE FROM friends WHERE userid = ?", undef, $u->id);
-            $dbh->do("DELETE FROM phonepostlogin WHERE userid = ?", undef, 
$u->id);
+            $dbh->do("DELETE FROM wt_edges WHERE from_userid = ?", undef, 
$u->id);
 
             # no need for other users to ban this user any more
             while ($dbh->do("DELETE FROM reluser WHERE targetid = ? AND type = 
'B' LIMIT 1000", undef, $u->id) > 0) {
@@ -1030,7 +1029,7 @@ sub fetchTableInfo
     my $memkey = "moveucluster:" . Digest::MD5::md5_hex(join(",",@tables));
     my $tinfo = LJ::MemCache::get($memkey) || {};
     foreach my $table (@tables) {
-        next if grep { $_ eq $table } qw(events cmdbuffer captcha_session 
recentactions pendcomments active_user random_user_set);
+        next if grep { $_ eq $table } qw(events cmdbuffer captcha_session 
recentactions pendcomments active_user random_user_set blobcache);
         next if $tinfo->{$table};  # no need to load this one
 
         # find the index we'll use
diff -r c92b1f233edf -r 9c1befb01566 bin/worker/expunge-users
--- a/bin/worker/expunge-users  Fri Apr 02 03:40:35 2010 +0000
+++ b/bin/worker/expunge-users  Fri Apr 02 03:46:01 2010 +0000
@@ -99,7 +99,7 @@ sub load_expungable_users {
     unless (@uids) {
         debug("querying within $days_before_expunge days");
         my $sth = $dbr->prepare
-            ("SELECT userid FROM user WHERE clusterid>0 AND statusvis='D' " .
+            ("SELECT userid FROM user WHERE clusterid>0 AND statusvis='D' AND 
journaltype IN ('P','C') " .
              "AND statusvisdate < NOW() - INTERVAL $days_before_expunge DAY 
LIMIT $target_queue_depth");
         $sth->execute;
         die "Error selecting users for expunge: " . $dbr->errstr if $dbr->err;
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to