Skip to content

Instantly share code, notes, and snippets.

@andymckay
Created April 12, 2011 16:35
Show Gist options
  • Save andymckay/915856 to your computer and use it in GitHub Desktop.
Save andymckay/915856 to your computer and use it in GitHub Desktop.
Cope with deleted addons
Index: maintenance.py
===================================================================
--- maintenance.py (revision 87210)
+++ maintenance.py (working copy)
@@ -61,6 +61,7 @@
REPLACE INTO stats_share_counts_totals (addon_id, service, count)
(SELECT addon_id, service, SUM(count)
FROM stats_share_counts
+ RIGHT JOIN addons ON addon_id = addons.id
WHERE service IN (%s)
GROUP BY addon_id, service)""" %
','.join('"%s"' % x for x in LINK_SHARING_SERVICES))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment