[livejournal] r23426: LJSUP-13388: Don't change style info on ...
Committer: wisest-owl
LJSUP-13388: Don't change style info on already created one.U trunk/bin/upgrading/update-db.pl
Modified: trunk/bin/upgrading/update-db.pl
===================================================================
--- trunk/bin/upgrading/update-db.pl 2012-12-06 09:12:58 UTC (rev 23425)
+++ trunk/bin/upgrading/update-db.pl 2012-12-06 09:45:23 UTC (rev 23426)
@@ -480,11 +480,13 @@
my @s2_theme_cats = $s2_theme->cats;
my $theme_shop = LJ::Pay::Theme->load_by_s2lid ($id);
print "Create/modify $base($id) in shop table\n";
- $theme_shop = LJ::Pay::Theme->new () unless $theme_shop;
- $theme_shop->name ($th_hash{$id}{'name'});
- $theme_shop->s2tid ($id);
- $theme_shop->save_to_db;
- $theme_shop->add_cat ($_) foreach @s2_theme_cats;
+ unless ($theme_shop) {
+ $theme_shop = LJ::Pay::Theme->new ();
+ $theme_shop->name ($th_hash{$id}{'name'});
+ $theme_shop->s2tid ($id);
+ $theme_shop->save_to_db;
+ $theme_shop->add_cat ($_) foreach @s2_theme_cats;
+ }
## Clear the memcache key after adding shop theme
$existing = LJ::S2::get_public_layers({ force => 1 }, $sysid);
}
