Skip to content

Commit

Permalink
Don't include test mailing events in the summary table.
Browse files Browse the repository at this point in the history
  • Loading branch information
GraylinKim committed Feb 1, 2013
1 parent 17a900c commit 0d762d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions resources/rebuild_summary.sql
@@ -1,4 +1,4 @@

-- Just change the dt_created time to adjust the window that is rebuilt
REPLACE INTO summary (
SELECT mailing_id, instance_name, install_class, event_type, category, count(*), min(dt_created), max(dt_created)
FROM archive JOIN (
Expand All @@ -7,11 +7,11 @@ REPLACE INTO summary (
JOIN instance ON message.instance_id=instance.id
JOIN archive ON archive.message_id=message.id
WHERE archive.dt_created > '2012-07-24 12:00:00'

AND archive.queue_id != 0
AND mailing_id != 0
AND instance.servername != ''
) AS affected_messages USING (message_id)
WHERE queue_id != 0
WHERE queue_id != 0 AND is_test != 0
GROUP BY instance_name, install_class, mailing_id, event_type
);

5 changes: 3 additions & 2 deletions resources/schema.sql
Expand Up @@ -103,7 +103,7 @@ DELIMITER |

-- If queue_id=0 we don't process the event
-- we need to exclude these from summaries.
IF NEW.queue_id <> 0 THEN
IF NEW.queue_id <> 0 AND NEW.is_test <> 0 THEN

INSERT INTO summary(
mailing_id, instance, install_class, event, category, count, dt_first, dt_last
Expand Down Expand Up @@ -272,4 +272,5 @@ DELIMITER |
END
|

DELIMITER ;
DELIMITER ;

0 comments on commit 0d762d0

Please sign in to comment.