afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
afuna ([personal profile] afuna) wrote in [site community profile] changelog2009-08-05 03:10 am

[dw-free] Overeager offer to delete old S2 layers owned by system

[commit: http://hg.dwscoalition.org/dw-free/rev/9b56de6b1222]

http://bugs.dwscoalition.org/show_bug.cgi?id=1234

Don't offer to delete user layers (dev environments).

Patch by [personal profile] kaisa.

Files modified:
  • bin/upgrading/update-db.pl
--------------------------------------------------------------------------------
diff -r 8f74130e5b2d -r 9b56de6b1222 bin/upgrading/update-db.pl
--- a/bin/upgrading/update-db.pl	Tue Aug 04 21:37:44 2009 -0500
+++ b/bin/upgrading/update-db.pl	Wed Aug 05 03:10:20 2009 +0000
@@ -421,7 +421,7 @@ sub populate_s2 {
     if ($LJ::IS_DEV_SERVER) {
         # now, delete any system layers that don't below (from previous imports?)
         my @del_ids;
-        my $sth = $dbh->prepare("SELECT s2lid FROM s2layers WHERE userid=?");
+        my $sth = $dbh->prepare("SELECT s2lid FROM s2layers WHERE userid=? AND NOT type='user'");
         $sth->execute($sysid);
         while (my $id = $sth->fetchrow_array) {
             next if $known_id{$id};
--------------------------------------------------------------------------------