Code cleanup. Remove one-time change, which was meant to be temporary.
Patch by kareila.
diffs (65 lines):
diff -r c65fc2c8f8f5 -r bc538355bea2 bin/maint/clean_caches.pl
--- a/bin/maint/clean_caches.pl Wed Jun 02 11:23:12 2010 +0800
+++ b/bin/maint/clean_caches.pl Wed Jun 02 11:27:50 2010 +0800
@@ -331,32 +331,12 @@
# nothing to insert, why bother?
next unless %counts;
- # TEMPORARY
- # We want to move from using one letter, or prefixed with _ to
- # mean local, to actual readable strings. Instead of fighting
- # a race when modifying the recentactions table, do it here instead.
- # This could should be removable after the code is pushed live and this
- # job has run.
- # David (1/11/06);
- my %whatmap = (
- 'P' => 'post',
- 'post' => 'post',
- '_F' => 'phonepost',
- 'phonepost' => 'phonepost',
- '_M' => 'phonepost_mp3',
- 'phonepost_mp3' => 'phonepost_mp3',
- );
-
# insert summary into global actionhistory table
my @bind = ();
my @vals = ();
while (my ($what, $ct) = each %counts) {
push @bind, "(UNIX_TIMESTAMP(),?,?,?)";
-
- # TEMPORARY
- my $cwhat = defined $whatmap{$what} ? $whatmap{$what} : $what;
-
- push @vals, $cid, $cwhat, $ct;
+ push @vals, $cid, $what, $ct;
}
my $bind = join(",", @bind);
diff -r c65fc2c8f8f5 -r bc538355bea2 bin/upgrading/update-db-general.pl
--- a/bin/upgrading/update-db-general.pl Wed Jun 02 11:23:12 2010 +0800
+++ b/bin/upgrading/update-db-general.pl Wed Jun 02 11:27:50 2010 +0800
@@ -3413,24 +3413,11 @@ register_alter(sub {
"ALTER TABLE includetext MODIFY COLUMN inctext MEDIUMTEXT");
}
- # These table are both livejournal tables, although could have ljcom values
- # that we need to update. Not trying to be lazy, but running the updates
in
- # update-db-local.pl would cause us to have to do a select on the table
everytime
- # to see if it still has old values, which is lame. The updates also
can't run
- # before the alter so and if on if the alter has happened also isn't really
- # useful. So here they live. :-\
foreach my $table (qw(recentactions actionhistory)) {
if (column_type($table, "what") =~ /^char/i) {
do_alter($table,
"ALTER TABLE $table MODIFY COLUMN what VARCHAR(20) NOT
NULL");
-
- next if $table eq 'recentactions';
-
- # Since actionhistory is updated nightly, is alright to do updates
now
- do_sql("UPDATE actionhistory SET what='post' WHERE what='P'");
- do_sql("UPDATE actionhistory SET what='phonepost' WHERE
what='_F'");
- do_sql("UPDATE actionhistory SET what='phonepost_mp3' WHERE
what='_M'");
}
}
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog