-- Reset post-Gratipocalypse values
UPDATE paydays p
   SET nactive = (SELECT DISTINCT count(*) FROM (
        SELECT participant FROM payments WHERE payday=p.id
       ) AS foo)
     , volume = (SELECT COALESCE(sum(amount), 0) FROM payments WHERE payday=p.id)
 WHERE ts_start > '2015-05-07'::timestamptz;

-- Reset post-Gratipocalypse values
UPDATE paydays p
   SET nactive = (SELECT DISTINCT count(*) FROM (
        SELECT participant FROM payments WHERE payday=p.id
       ) AS foo)
     , volume = (SELECT COALESCE(sum(amount), 0)
                   FROM payments
                  WHERE payday=p.id AND direction='to-team')
 WHERE ts_start > '2015-05-07'::timestamptz;

Make the volume stats accurate
Make the volume stats accurate

They were doubled because we were counting both sides, payment and
payroll. We should just count payment.
