diff --git a/server/services/triggers.js b/server/services/triggers.js index e4b98b6f..c8c0077e 100644 --- a/server/services/triggers.js +++ b/server/services/triggers.js @@ -52,8 +52,8 @@ async function run() { .where(function () { addSegmentQuery(this); }) + .whereNull('related_trigger_messages.id') // This means only those campaigns where one of their triggers has not fired yet somewhen in the past .where(subsTable + '.status', SubscriptionStatus.SUBSCRIBED) - .whereNull('related_trigger_messages.id') // This means only those where the trigger has not fired yet somewhen in the past .select(subsTable + '.id'); let column;