Skip to content

Commit 195308d

Browse files
authored
fix(SubPlat): Only generate "Mozilla Account Change" and "Plan Change" events for active subscriptions (DENG-9770). (#8176)
1 parent aa6bc04 commit 195308d

File tree

2 files changed

+4
-0
lines changed
  • sql/moz-fx-data-shared-prod/subscription_platform_derived
    • logical_subscription_events_v1_live
    • service_subscription_events_v1_live

2 files changed

+4
-0
lines changed

sql/moz-fx-data-shared-prod/subscription_platform_derived/logical_subscription_events_v1_live/view.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ mozilla_account_change_events AS (
6060
WHERE
6161
old_subscription IS NOT NULL
6262
AND subscription.mozilla_account_id_sha256 IS DISTINCT FROM old_subscription.mozilla_account_id_sha256
63+
AND subscription.ended_at IS NULL
6364
),
6465
plan_change_events AS (
6566
SELECT
@@ -91,6 +92,7 @@ plan_change_events AS (
9192
subscription_changes
9293
WHERE
9394
subscription.provider_plan_id != old_subscription.provider_plan_id
95+
AND subscription.ended_at IS NULL
9496
),
9597
trial_change_events AS (
9698
SELECT

sql/moz-fx-data-shared-prod/subscription_platform_derived/service_subscription_events_v1_live/view.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ mozilla_account_change_events AS (
6464
WHERE
6565
old_subscription IS NOT NULL
6666
AND subscription.mozilla_account_id_sha256 IS DISTINCT FROM old_subscription.mozilla_account_id_sha256
67+
AND subscription.ended_at IS NULL
6768
),
6869
plan_change_events AS (
6970
SELECT
@@ -105,6 +106,7 @@ plan_change_events AS (
105106
subscription_changes
106107
WHERE
107108
subscription.provider_plan_id != old_subscription.provider_plan_id
109+
AND subscription.ended_at IS NULL
108110
),
109111
trial_change_events AS (
110112
SELECT

0 commit comments

Comments
 (0)