Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(team): load team configs per team instance, not per process (#118777)

Phil Haack4925b050fe58
diff --git a/posthog/api/team/team_config.py b/posthog/api/team/team_config.py
index 248054e8de42..285bacb1a4f1 100644
--- a/posthog/api/team/team_config.py
+++ b/posthog/api/team/team_config.py
@@ -324,14 +324,9 @@ class TeamWorkflowsConfigSerializer(serializers.ModelSerializer, UserAccessContr
if self.parent:
return value
# Support raises a project past the ceiling in Django admin; clients that echo the whole
- # config must be able to send that value back unchanged. Read the row fresh: the
- # `Team.workflows_config` accessor is cached per process and can be stale.
+ # config must be able to send that value back unchanged.
if value is not None and value > ceiling:
- stored = (
- TeamWorkflowsConfig.objects.filter(pk=self.instance.pk).values_list(field, flat=True).first()
- if self.instance is not None
- else None
- )
+ stored = getattr(self.instance, field, None)
if stored != value:
raise serializers.ValidationError(f"Contact support to go above {ceiling} tasks a day.")
return value
@@ -378,10 +373,7 @@ class TeamWorkflowsConfigSerializer(serializers.ModelSerializer, UserAccessContr
cap_fields = ("marketing_frequency_cap_max_messages", "marketing_frequency_cap_window_days")
cap = {field: attrs[field] for field in cap_fields if field in attrs}
if len(cap) == 1 and self.instance is not None:
- # Read the stored row, because `Team.workflows_config` is a cached_property on the Team instance
- # and can hold values from before an earlier update.
- stored = TeamWorkflowsConfig.objects.filter(pk=self.instance.pk).values(*cap_fields).first() or {}
- cap = {**stored, **cap}
+ cap = {field: cap.get(field, getattr(self.instance, field)) for field in cap_fields}
# The worker treats either null as no cap, so a half-set cap would save but never apply.
if cap:
missing = [field for field in cap_fields if cap.get(field) is None]
diff --git a/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr b/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr
index 464cd4800de7..0d1396f5c000 100644
--- a/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr
+++ b/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr
@@ -654,6 +654,52 @@
'''
# ---
# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.21
+ '''
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.22
+ '''
+ SELECT "posthog_teammarketinganalyticsconfig"."team_id",
+ "posthog_teammarketinganalyticsconfig"."attribution_window_days",
+ "posthog_teammarketinganalyticsconfig"."attribution_mode",
+ "posthog_teammarketinganalyticsconfig"."filter_test_accounts",
+ "posthog_teammarketinganalyticsconfig"."sources_map",
+ "posthog_teammarketinganalyticsconfig"."conversion_goals",
+ "posthog_teammarketinganalyticsconfig"."campaign_name_mappings",
+ "posthog_teammarketinganalyticsconfig"."custom_source_mappings",
+ "posthog_teammarketinganalyticsconfig"."campaign_field_preferences"
+ FROM "posthog_teammarketinganalyticsconfig"
+ WHERE "posthog_teammarketinganalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.23
+ '''
+ SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
+ "customer_analytics_teamcustomeranalyticsconfig"."activity_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."signup_pageview_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."signup_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."subscription_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."payment_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_group_type_index",
+ "customer_analytics_teamcustomeranalyticsconfig"."default_pinned_properties",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules_enabled_at"
+ FROM "customer_analytics_teamcustomeranalyticsconfig"
+ WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.24
'''
SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
FROM "posthog_dashboardtile"
@@ -664,7 +710,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.22
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.25
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -697,7 +743,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.23
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.26
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -706,7 +752,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.24
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.27
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -752,7 +798,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.25
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.28
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -798,7 +844,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.26
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.29
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -937,7 +983,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.27
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.3
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -992,30 +1038,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.28
- '''
- SELECT "ee_accesscontrol"."id",
- "ee_accesscontrol"."team_id",
- "ee_accesscontrol"."access_level",
- "ee_accesscontrol"."resource",
- "ee_accesscontrol"."resource_id",
- "ee_accesscontrol"."organization_member_id",
- "ee_accesscontrol"."role_id",
- "ee_accesscontrol"."created_by_id",
- "ee_accesscontrol"."created_at",
- "ee_accesscontrol"."updated_at"
- FROM "ee_accesscontrol"
- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")
- WHERE (("ee_accesscontrol"."organization_member_id" IS NULL
- AND "ee_accesscontrol"."role_id" IS NULL
- AND "ee_accesscontrol"."team_id" = 99999)
- OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_organizationmembership"."user_id" = 99999
- AND "ee_accesscontrol"."role_id" IS NULL
- AND "ee_accesscontrol"."team_id" = 99999))
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.29
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.30
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1065,10 +1088,35 @@
"posthog_organization"."is_platform"
FROM "posthog_organizationmembership"
INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
- WHERE "posthog_organizationmembership"."user_id" = 99999
+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_organizationmembership"."user_id" = 99999)
+ LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.3
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.31
+ '''
+ SELECT "ee_accesscontrol"."id",
+ "ee_accesscontrol"."team_id",
+ "ee_accesscontrol"."access_level",
+ "ee_accesscontrol"."resource",
+ "ee_accesscontrol"."resource_id",
+ "ee_accesscontrol"."organization_member_id",
+ "ee_accesscontrol"."role_id",
+ "ee_accesscontrol"."created_by_id",
+ "ee_accesscontrol"."created_at",
+ "ee_accesscontrol"."updated_at"
+ FROM "ee_accesscontrol"
+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")
+ WHERE (("ee_accesscontrol"."organization_member_id" IS NULL
+ AND "ee_accesscontrol"."role_id" IS NULL
+ AND "ee_accesscontrol"."team_id" = 99999)
+ OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_organizationmembership"."user_id" = 99999
+ AND "ee_accesscontrol"."role_id" IS NULL
+ AND "ee_accesscontrol"."team_id" = 99999))
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.32
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1118,12 +1166,10 @@
"posthog_organization"."is_platform"
FROM "posthog_organizationmembership"
INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_organizationmembership"."user_id" = 99999)
- LIMIT 21
+ WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.30
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.33
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -1135,7 +1181,7 @@
OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.31
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.34
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -1157,7 +1203,7 @@
AND "ee_accesscontrol"."role_id" IS NULL)))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.32
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.35
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -1260,7 +1306,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.33
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.36
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -1283,7 +1329,7 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.34
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.37
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -1646,7 +1692,7 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.35
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.38
'''
SELECT ("posthog_dashboardtile"."insight_id") AS "_prefetch_related_val_insight_id",
"posthog_dashboard"."id",
@@ -1688,7 +1734,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.36
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.39
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -1721,7 +1767,30 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.37
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.4
+ '''
+ SELECT "ee_accesscontrol"."id",
+ "ee_accesscontrol"."team_id",
+ "ee_accesscontrol"."access_level",
+ "ee_accesscontrol"."resource",
+ "ee_accesscontrol"."resource_id",
+ "ee_accesscontrol"."organization_member_id",
+ "ee_accesscontrol"."role_id",
+ "ee_accesscontrol"."created_by_id",
+ "ee_accesscontrol"."created_at",
+ "ee_accesscontrol"."updated_at"
+ FROM "ee_accesscontrol"
+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")
+ WHERE (("ee_accesscontrol"."organization_member_id" IS NULL
+ AND "ee_accesscontrol"."role_id" IS NULL
+ AND "ee_accesscontrol"."team_id" = 99999)
+ OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_organizationmembership"."user_id" = 99999
+ AND "ee_accesscontrol"."role_id" IS NULL
+ AND "ee_accesscontrol"."team_id" = 99999))
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.40
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -1750,7 +1819,7 @@
2)/* ... */)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.38
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.41
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -1771,7 +1840,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.39
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.42
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1870,30 +1939,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.4
- '''
- SELECT "ee_accesscontrol"."id",
- "ee_accesscontrol"."team_id",
- "ee_accesscontrol"."access_level",
- "ee_accesscontrol"."resource",
- "ee_accesscontrol"."resource_id",
- "ee_accesscontrol"."organization_member_id",
- "ee_accesscontrol"."role_id",
- "ee_accesscontrol"."created_by_id",
- "ee_accesscontrol"."created_at",
- "ee_accesscontrol"."updated_at"
- FROM "ee_accesscontrol"
- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")
- WHERE (("ee_accesscontrol"."organization_member_id" IS NULL
- AND "ee_accesscontrol"."role_id" IS NULL
- AND "ee_accesscontrol"."team_id" = 99999)
- OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_organizationmembership"."user_id" = 99999
- AND "ee_accesscontrol"."role_id" IS NULL
- AND "ee_accesscontrol"."team_id" = 99999))
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.40
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.43
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -1918,7 +1964,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.41
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.44
'''
SELECT "posthog_filesystemshortcut"."id",
"posthog_filesystemshortcut"."team_id",
@@ -1941,7 +1987,7 @@
AND "posthog_filesystemshortcut"."href" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.42
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.45
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -1961,7 +2007,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.43
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.46
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -2325,7 +2371,7 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.44
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.47
'''
SELECT ("posthog_dashboardtile"."insight_id") AS "_prefetch_related_val_insight_id",
"posthog_dashboard"."id",
@@ -2367,7 +2413,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.45
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.48
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -2400,7 +2446,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.46
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.49
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -2429,7 +2475,60 @@
2)/* ... */)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.47
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.5
+ '''
+ SELECT "posthog_organizationmembership"."id",
+ "posthog_organizationmembership"."organization_id",
+ "posthog_organizationmembership"."user_id",
+ "posthog_organizationmembership"."level",
+ "posthog_organizationmembership"."joined_at",
+ "posthog_organizationmembership"."updated_at",
+ "posthog_organizationmembership"."invited_by_id",
+ "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_organizationmembership"
+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
+ WHERE "posthog_organizationmembership"."user_id" = 99999
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.50
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -2450,7 +2549,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.48
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.51
'''
SELECT "posthog_alertconfiguration"."created_by_id",
"posthog_alertconfiguration"."created_at",
@@ -2533,7 +2632,53 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.49
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.52
+ '''
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.53
+ '''
+ SELECT "posthog_teammarketinganalyticsconfig"."team_id",
+ "posthog_teammarketinganalyticsconfig"."attribution_window_days",
+ "posthog_teammarketinganalyticsconfig"."attribution_mode",
+ "posthog_teammarketinganalyticsconfig"."filter_test_accounts",
+ "posthog_teammarketinganalyticsconfig"."sources_map",
+ "posthog_teammarketinganalyticsconfig"."conversion_goals",
+ "posthog_teammarketinganalyticsconfig"."campaign_name_mappings",
+ "posthog_teammarketinganalyticsconfig"."custom_source_mappings",
+ "posthog_teammarketinganalyticsconfig"."campaign_field_preferences"
+ FROM "posthog_teammarketinganalyticsconfig"
+ WHERE "posthog_teammarketinganalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.54
+ '''
+ SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
+ "customer_analytics_teamcustomeranalyticsconfig"."activity_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."signup_pageview_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."signup_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."subscription_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."payment_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_group_type_index",
+ "customer_analytics_teamcustomeranalyticsconfig"."default_pinned_properties",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules_enabled_at"
+ FROM "customer_analytics_teamcustomeranalyticsconfig"
+ WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.55
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -2566,60 +2711,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.5
- '''
- SELECT "posthog_organizationmembership"."id",
- "posthog_organizationmembership"."organization_id",
- "posthog_organizationmembership"."user_id",
- "posthog_organizationmembership"."level",
- "posthog_organizationmembership"."joined_at",
- "posthog_organizationmembership"."updated_at",
- "posthog_organizationmembership"."invited_by_id",
- "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organizationmembership"
- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
- WHERE "posthog_organizationmembership"."user_id" = 99999
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.6
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.6
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -3428,6 +3520,52 @@
'''
# ---
# name: TestDashboard.test_listing_dashboards_is_not_nplus1.20
+ '''
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.21
+ '''
+ SELECT "posthog_teammarketinganalyticsconfig"."team_id",
+ "posthog_teammarketinganalyticsconfig"."attribution_window_days",
+ "posthog_teammarketinganalyticsconfig"."attribution_mode",
+ "posthog_teammarketinganalyticsconfig"."filter_test_accounts",
+ "posthog_teammarketinganalyticsconfig"."sources_map",
+ "posthog_teammarketinganalyticsconfig"."conversion_goals",
+ "posthog_teammarketinganalyticsconfig"."campaign_name_mappings",
+ "posthog_teammarketinganalyticsconfig"."custom_source_mappings",
+ "posthog_teammarketinganalyticsconfig"."campaign_field_preferences"
+ FROM "posthog_teammarketinganalyticsconfig"
+ WHERE "posthog_teammarketinganalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.22
+ '''
+ SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
+ "customer_analytics_teamcustomeranalyticsconfig"."activity_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."signup_pageview_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."signup_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."subscription_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."payment_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_group_type_index",
+ "customer_analytics_teamcustomeranalyticsconfig"."default_pinned_properties",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules_enabled_at"
+ FROM "customer_analytics_teamcustomeranalyticsconfig"
+ WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.23
'''
SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
FROM "posthog_dashboardtile"
@@ -3438,7 +3576,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.21
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.24
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -3471,7 +3609,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.22
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.25
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -3480,7 +3618,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.23
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.26
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -3526,7 +3664,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.24
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.27
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -3572,7 +3710,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.25
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.28
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -3711,7 +3849,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.26
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.29
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -3766,30 +3904,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.27
- '''
- SELECT "ee_accesscontrol"."id",
- "ee_accesscontrol"."team_id",
- "ee_accesscontrol"."access_level",
- "ee_accesscontrol"."resource",
- "ee_accesscontrol"."resource_id",
- "ee_accesscontrol"."organization_member_id",
- "ee_accesscontrol"."role_id",
- "ee_accesscontrol"."created_by_id",
- "ee_accesscontrol"."created_at",
- "ee_accesscontrol"."updated_at"
- FROM "ee_accesscontrol"
- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")
- WHERE (("ee_accesscontrol"."organization_member_id" IS NULL
- AND "ee_accesscontrol"."role_id" IS NULL
- AND "ee_accesscontrol"."team_id" = 99999)
- OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_organizationmembership"."user_id" = 99999
- AND "ee_accesscontrol"."role_id" IS NULL
- AND "ee_accesscontrol"."team_id" = 99999))
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.28
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.3
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -3839,24 +3954,35 @@
"posthog_organization"."is_platform"
FROM "posthog_organizationmembership"
INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
- WHERE "posthog_organizationmembership"."user_id" = 99999
+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_organizationmembership"."user_id" = 99999)
+ LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.29
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.30
'''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_dashboard"
- INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
- LEFT OUTER JOIN "posthog_filesystemviewlog" recent_dashboard_views ON ("posthog_team"."id" = recent_dashboard_views."team_id"
- AND ((recent_dashboard_views."user_id" = 99999
- AND recent_dashboard_views."type" = 'dashboard'
- AND recent_dashboard_views."ref" = ("posthog_dashboard"."id")::varchar)))
- WHERE ("posthog_team"."project_id" = 99999
- AND NOT ("posthog_dashboard"."deleted")
- AND NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))
+ SELECT "ee_accesscontrol"."id",
+ "ee_accesscontrol"."team_id",
+ "ee_accesscontrol"."access_level",
+ "ee_accesscontrol"."resource",
+ "ee_accesscontrol"."resource_id",
+ "ee_accesscontrol"."organization_member_id",
+ "ee_accesscontrol"."role_id",
+ "ee_accesscontrol"."created_by_id",
+ "ee_accesscontrol"."created_at",
+ "ee_accesscontrol"."updated_at"
+ FROM "ee_accesscontrol"
+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")
+ WHERE (("ee_accesscontrol"."organization_member_id" IS NULL
+ AND "ee_accesscontrol"."role_id" IS NULL
+ AND "ee_accesscontrol"."team_id" = 99999)
+ OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_organizationmembership"."user_id" = 99999
+ AND "ee_accesscontrol"."role_id" IS NULL
+ AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.3
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.31
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -3906,12 +4032,24 @@
"posthog_organization"."is_platform"
FROM "posthog_organizationmembership"
INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_organizationmembership"."user_id" = 99999)
- LIMIT 21
+ WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.30
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.32
+ '''
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_dashboard"
+ INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
+ LEFT OUTER JOIN "posthog_filesystemviewlog" recent_dashboard_views ON ("posthog_team"."id" = recent_dashboard_views."team_id"
+ AND ((recent_dashboard_views."user_id" = 99999
+ AND recent_dashboard_views."type" = 'dashboard'
+ AND recent_dashboard_views."ref" = ("posthog_dashboard"."id")::varchar)))
+ WHERE ("posthog_team"."project_id" = 99999
+ AND NOT ("posthog_dashboard"."deleted")
+ AND NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.33
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -4017,7 +4155,7 @@
LIMIT 300
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.31
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.34
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -4040,7 +4178,7 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.32
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.35
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -4335,121 +4473,283 @@
# ---
# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.100
'''
- SELECT "posthog_team"."id",
- "posthog_team"."uuid",
- "posthog_team"."organization_id",
- "posthog_team"."parent_team_id",
- "posthog_team"."project_id",
- "posthog_team"."api_token",
- "posthog_team"."app_urls",
- "posthog_team"."name",
- "posthog_team"."slack_incoming_webhook",
- "posthog_team"."created_at",
- "posthog_team"."updated_at",
- "posthog_team"."anonymize_ips",
- "posthog_team"."completed_snippet_onboarding",
- "posthog_team"."has_completed_onboarding_for",
- "posthog_team"."onboarding_tasks",
- "posthog_team"."ingested_event",
- "posthog_team"."ingested_production_event",
- "posthog_team"."ingested_production_event_last_checked_at",
- "posthog_team"."person_processing_opt_out",
- "posthog_team"."secret_api_token",
- "posthog_team"."secret_api_token_backup",
- "posthog_team"."session_recording_opt_in",
- "posthog_team"."session_recording_sample_rate",
- "posthog_team"."session_recording_minimum_duration_milliseconds",
- "posthog_team"."session_recording_linked_flag",
- "posthog_team"."session_recording_network_payload_capture_config",
- "posthog_team"."session_recording_masking_config",
- "posthog_team"."session_recording_url_trigger_config",
- "posthog_team"."session_recording_url_blocklist_config",
- "posthog_team"."session_recording_event_trigger_config",
- "posthog_team"."session_recording_trigger_match_type_config",
- "posthog_team"."session_recording_trigger_groups",
- "posthog_team"."session_replay_config",
- "posthog_team"."session_recording_retention_period",
- "posthog_team"."event_retention_months",
- "posthog_team"."conversations_enabled",
- "posthog_team"."conversations_settings",
- "posthog_team"."proactive_tasks_enabled",
- "posthog_team"."survey_config",
- "posthog_team"."surveys_opt_in",
- "posthog_team"."product_tours_opt_in",
- "posthog_team"."capture_console_log_opt_in",
- "posthog_team"."capture_performance_opt_in",
- "posthog_team"."capture_dead_clicks",
- "posthog_team"."autocapture_opt_out",
- "posthog_team"."autocapture_web_vitals_opt_in",
- "posthog_team"."autocapture_web_vitals_allowed_metrics",
- "posthog_team"."autocapture_exceptions_opt_in",
- "posthog_team"."autocapture_exceptions_errors_to_ignore",
- "posthog_team"."logs_settings",
- "posthog_team"."llm_gateway_enabled_at",
- "posthog_team"."llm_gateway_revoked_at",
- "posthog_team"."llm_gateway_overspend_allowance_usd",
- "posthog_team"."heatmaps_opt_in",
- "posthog_team"."receive_org_level_activity_logs",
- "posthog_team"."web_analytics_pre_aggregated_tables_enabled",
- "posthog_team"."web_analytics_pre_aggregated_tables_version",
- "posthog_team"."flags_persistence_default",
- "posthog_team"."feature_flag_confirmation_enabled",
- "posthog_team"."feature_flag_confirmation_message",
- "posthog_team"."default_evaluation_environments_enabled",
- "posthog_team"."require_evaluation_environment_tags",
- "posthog_team"."default_evaluation_contexts_enabled",
- "posthog_team"."require_evaluation_contexts",
- "posthog_team"."session_recording_version",
- "posthog_team"."signup_token",
- "posthog_team"."is_demo",
- "posthog_team"."access_control",
- "posthog_team"."week_start_day",
- "posthog_team"."inject_web_apps",
- "posthog_team"."test_account_filters",
- "posthog_team"."test_account_filters_default_checked",
- "posthog_team"."path_cleaning_filters",
- "posthog_team"."timezone",
- "posthog_team"."data_attributes",
- "posthog_team"."person_display_name_properties",
- "posthog_team"."live_events_columns",
- "posthog_team"."recording_domains",
- "posthog_team"."human_friendly_comparison_periods",
- "posthog_team"."cookieless_server_hash_mode",
- "posthog_team"."primary_dashboard_id",
- "posthog_team"."default_data_theme",
- "posthog_team"."extra_settings",
- "posthog_team"."modifiers",
- "posthog_team"."correlation_config",
- "posthog_team"."session_recording_retention_period_days",
- "posthog_team"."external_data_workspace_id",
- "posthog_team"."external_data_workspace_last_synced_at",
- "posthog_team"."api_query_rate_limit",
- "posthog_team"."drop_events_older_than",
- "posthog_team"."base_currency",
- "posthog_team"."business_model",
- "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
+ SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
+ "customer_analytics_teamcustomeranalyticsconfig"."activity_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."signup_pageview_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."signup_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."subscription_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."payment_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_group_type_index",
+ "customer_analytics_teamcustomeranalyticsconfig"."default_pinned_properties",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules_enabled_at"
+ FROM "customer_analytics_teamcustomeranalyticsconfig"
+ WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.101
+ '''
+ SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
+ FROM "posthog_dashboardtile"
+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
+ WHERE (NOT ("posthog_dashboardtile"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL)
+ AND NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboardtile"."insight_id" = 99999)
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.102
+ '''
+ SELECT "posthog_dashboard"."id",
+ "posthog_dashboard"."name",
+ "posthog_dashboard"."description",
+ "posthog_dashboard"."team_id",
+ "posthog_dashboard"."pinned",
+ "posthog_dashboard"."created_at",
+ "posthog_dashboard"."created_by_id",
+ "posthog_dashboard"."deleted",
+ "posthog_dashboard"."last_accessed_at",
+ "posthog_dashboard"."last_refresh",
+ "posthog_dashboard"."filters",
+ "posthog_dashboard"."variables",
+ "posthog_dashboard"."breakdown_colors",
+ "posthog_dashboard"."data_color_theme_id",
+ "posthog_dashboard"."creation_mode",
+ "posthog_dashboard"."restriction_level",
+ "posthog_dashboard"."quick_filter_ids",
+ "posthog_dashboard"."customization",
+ "posthog_dashboard"."deprecated_tags",
+ "posthog_dashboard"."tags",
+ "posthog_dashboard"."share_token",
+ "posthog_dashboard"."is_shared"
+ FROM "posthog_dashboard"
+ WHERE (NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboard"."id" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.103
+ '''
+ SELECT "posthog_tag"."name" AS "tag__name"
+ FROM "posthog_taggeditem"
+ INNER JOIN "posthog_tag" ON ("posthog_taggeditem"."tag_id" = "posthog_tag"."id")
+ WHERE ("posthog_taggeditem"."content_type_id" = 99999
+ AND "posthog_taggeditem"."object_id" = 99999)
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.104
+ '''
+ SELECT "posthog_user"."id",
+ "posthog_user"."password",
+ "posthog_user"."last_login",
+ "posthog_user"."first_name",
+ "posthog_user"."last_name",
+ "posthog_user"."is_staff",
+ "posthog_user"."date_joined",
+ "posthog_user"."uuid",
+ "posthog_user"."current_organization_id",
+ "posthog_user"."current_team_id",
+ "posthog_user"."email",
+ "posthog_user"."pending_email",
+ "posthog_user"."distinct_id",
+ "posthog_user"."is_email_verified",
+ "posthog_user"."credentials_reviewed_at",
+ "posthog_user"."requested_2fa_reset_at",
+ "posthog_user"."has_seen_product_intro_for",
+ "posthog_user"."strapi_id",
+ "posthog_user"."is_active",
+ "posthog_user"."role_at_organization",
+ "posthog_user"."theme_mode",
+ "posthog_user"."partial_notification_settings",
+ "posthog_user"."anonymize_data",
+ "posthog_user"."allow_impersonation",
+ "posthog_user"."toolbar_mode",
+ "posthog_user"."hedgehog_config",
+ "posthog_user"."allow_sidebar_suggestions",
+ "posthog_user"."shortcut_position",
+ "posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
+ "posthog_user"."ui_configuration",
+ "posthog_user"."onboarding_skipped_at",
+ "posthog_user"."onboarding_skipped_reason",
+ "posthog_user"."onboarding_skipped_organization_id",
+ "posthog_user"."onboarding_delegated_to_invite_id",
+ "posthog_user"."onboarding_delegated_to_organization_id",
+ "posthog_user"."onboarding_delegation_accepted_at",
+ "posthog_user"."events_column_config",
+ "posthog_user"."email_opt_in"
+ FROM "posthog_user"
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.105
+ '''
+ SELECT "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_organization"
+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.106
+ '''
+ SELECT "posthog_team"."id",
+ "posthog_team"."uuid",
+ "posthog_team"."organization_id",
+ "posthog_team"."parent_team_id",
+ "posthog_team"."project_id",
+ "posthog_team"."api_token",
+ "posthog_team"."app_urls",
+ "posthog_team"."name",
+ "posthog_team"."slack_incoming_webhook",
+ "posthog_team"."created_at",
+ "posthog_team"."updated_at",
+ "posthog_team"."anonymize_ips",
+ "posthog_team"."completed_snippet_onboarding",
+ "posthog_team"."has_completed_onboarding_for",
+ "posthog_team"."onboarding_tasks",
+ "posthog_team"."ingested_event",
+ "posthog_team"."ingested_production_event",
+ "posthog_team"."ingested_production_event_last_checked_at",
+ "posthog_team"."person_processing_opt_out",
+ "posthog_team"."secret_api_token",
+ "posthog_team"."secret_api_token_backup",
+ "posthog_team"."session_recording_opt_in",
+ "posthog_team"."session_recording_sample_rate",
+ "posthog_team"."session_recording_minimum_duration_milliseconds",
+ "posthog_team"."session_recording_linked_flag",
+ "posthog_team"."session_recording_network_payload_capture_config",
+ "posthog_team"."session_recording_masking_config",
+ "posthog_team"."session_recording_url_trigger_config",
+ "posthog_team"."session_recording_url_blocklist_config",
+ "posthog_team"."session_recording_event_trigger_config",
+ "posthog_team"."session_recording_trigger_match_type_config",
+ "posthog_team"."session_recording_trigger_groups",
+ "posthog_team"."session_replay_config",
+ "posthog_team"."session_recording_retention_period",
+ "posthog_team"."event_retention_months",
+ "posthog_team"."conversations_enabled",
+ "posthog_team"."conversations_settings",
+ "posthog_team"."proactive_tasks_enabled",
+ "posthog_team"."survey_config",
+ "posthog_team"."surveys_opt_in",
+ "posthog_team"."product_tours_opt_in",
+ "posthog_team"."capture_console_log_opt_in",
+ "posthog_team"."capture_performance_opt_in",
+ "posthog_team"."capture_dead_clicks",
+ "posthog_team"."autocapture_opt_out",
+ "posthog_team"."autocapture_web_vitals_opt_in",
+ "posthog_team"."autocapture_web_vitals_allowed_metrics",
+ "posthog_team"."autocapture_exceptions_opt_in",
+ "posthog_team"."autocapture_exceptions_errors_to_ignore",
+ "posthog_team"."logs_settings",
+ "posthog_team"."llm_gateway_enabled_at",
+ "posthog_team"."llm_gateway_revoked_at",
+ "posthog_team"."llm_gateway_overspend_allowance_usd",
+ "posthog_team"."heatmaps_opt_in",
+ "posthog_team"."receive_org_level_activity_logs",
+ "posthog_team"."web_analytics_pre_aggregated_tables_enabled",
+ "posthog_team"."web_analytics_pre_aggregated_tables_version",
+ "posthog_team"."flags_persistence_default",
+ "posthog_team"."feature_flag_confirmation_enabled",
+ "posthog_team"."feature_flag_confirmation_message",
+ "posthog_team"."default_evaluation_environments_enabled",
+ "posthog_team"."require_evaluation_environment_tags",
+ "posthog_team"."default_evaluation_contexts_enabled",
+ "posthog_team"."require_evaluation_contexts",
+ "posthog_team"."session_recording_version",
+ "posthog_team"."signup_token",
+ "posthog_team"."is_demo",
+ "posthog_team"."access_control",
+ "posthog_team"."week_start_day",
+ "posthog_team"."inject_web_apps",
+ "posthog_team"."test_account_filters",
+ "posthog_team"."test_account_filters_default_checked",
+ "posthog_team"."path_cleaning_filters",
+ "posthog_team"."timezone",
+ "posthog_team"."data_attributes",
+ "posthog_team"."person_display_name_properties",
+ "posthog_team"."live_events_columns",
+ "posthog_team"."recording_domains",
+ "posthog_team"."human_friendly_comparison_periods",
+ "posthog_team"."cookieless_server_hash_mode",
+ "posthog_team"."primary_dashboard_id",
+ "posthog_team"."default_data_theme",
+ "posthog_team"."extra_settings",
+ "posthog_team"."modifiers",
+ "posthog_team"."correlation_config",
+ "posthog_team"."session_recording_retention_period_days",
+ "posthog_team"."external_data_workspace_id",
+ "posthog_team"."external_data_workspace_last_synced_at",
+ "posthog_team"."api_query_rate_limit",
+ "posthog_team"."drop_events_older_than",
+ "posthog_team"."base_currency",
+ "posthog_team"."business_model",
+ "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
"posthog_organization"."read_only_mcp_access",
"posthog_organization"."default_role_id",
"posthog_organization"."plugins_access_level",
@@ -4472,7 +4772,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.101
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.107
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -4527,7 +4827,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.102
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.108
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -4550,7 +4850,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.103
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.109
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -4603,7 +4903,19 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.104
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.11
+ '''
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_dashboardtile"
+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
+ WHERE (NOT ("posthog_dashboardtile"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL)
+ AND NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboardtile"."dashboard_id" = 99999
+ AND NOT ("posthog_dashboardtile"."insight_id" IS NULL))
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.110
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -4615,7 +4927,7 @@
OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.105
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.111
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -4637,7 +4949,7 @@
AND "ee_accesscontrol"."role_id" IS NULL)))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.106
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.112
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -4657,7 +4969,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.107
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.113
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -4670,7 +4982,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.108
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.114
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -4683,7 +4995,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.109
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.115
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -4716,19 +5028,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.11
- '''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."dashboard_id" = 99999
- AND NOT ("posthog_dashboardtile"."insight_id" IS NULL))
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.110
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.116
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -4827,7 +5127,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.111
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.117
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -4873,7 +5173,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.112
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.118
'''
SELECT 1 AS "a"
FROM "posthog_sharingconfiguration"
@@ -4885,7 +5185,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.113
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.119
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -4984,7 +5284,26 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.114
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.12
+ '''
+ SELECT "posthog_sharingconfiguration"."id",
+ "posthog_sharingconfiguration"."team_id",
+ "posthog_sharingconfiguration"."dashboard_id",
+ "posthog_sharingconfiguration"."insight_id",
+ "posthog_sharingconfiguration"."recording_id",
+ "posthog_sharingconfiguration"."notebook_id",
+ "posthog_sharingconfiguration"."interviewee_context_id",
+ "posthog_sharingconfiguration"."created_at",
+ "posthog_sharingconfiguration"."enabled",
+ "posthog_sharingconfiguration"."access_token",
+ "posthog_sharingconfiguration"."expires_at",
+ "posthog_sharingconfiguration"."settings",
+ "posthog_sharingconfiguration"."password_required"
+ FROM "posthog_sharingconfiguration"
+ WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.120
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -5009,7 +5328,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.115
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.121
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -5027,7 +5346,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.116
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.122
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -5073,7 +5392,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.117
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.123
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -5172,7 +5491,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.118
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.124
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -5201,7 +5520,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.119
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.125
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -5215,41 +5534,22 @@
"posthog_dashboardtile"."filters_hash",
"posthog_dashboardtile"."last_refresh",
"posthog_dashboardtile"."refreshing",
- "posthog_dashboardtile"."refresh_attempt",
- "posthog_dashboardtile"."filters_overrides",
- "posthog_dashboardtile"."show_description",
- "posthog_dashboardtile"."transparent_background",
- "posthog_dashboardtile"."group_key",
- "posthog_dashboardtile"."badge",
- "posthog_dashboardtile"."deleted"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.12
- '''
- SELECT "posthog_sharingconfiguration"."id",
- "posthog_sharingconfiguration"."team_id",
- "posthog_sharingconfiguration"."dashboard_id",
- "posthog_sharingconfiguration"."insight_id",
- "posthog_sharingconfiguration"."recording_id",
- "posthog_sharingconfiguration"."notebook_id",
- "posthog_sharingconfiguration"."interviewee_context_id",
- "posthog_sharingconfiguration"."created_at",
- "posthog_sharingconfiguration"."enabled",
- "posthog_sharingconfiguration"."access_token",
- "posthog_sharingconfiguration"."expires_at",
- "posthog_sharingconfiguration"."settings",
- "posthog_sharingconfiguration"."password_required"
- FROM "posthog_sharingconfiguration"
- WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
+ "posthog_dashboardtile"."refresh_attempt",
+ "posthog_dashboardtile"."filters_overrides",
+ "posthog_dashboardtile"."show_description",
+ "posthog_dashboardtile"."transparent_background",
+ "posthog_dashboardtile"."group_key",
+ "posthog_dashboardtile"."badge",
+ "posthog_dashboardtile"."deleted"
+ FROM "posthog_dashboardtile"
+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
+ WHERE (NOT ("posthog_dashboardtile"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL)
+ AND NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.120
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.126
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -5269,7 +5569,61 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.121
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.127
+ '''
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.128
+ '''
+ SELECT "posthog_teammarketinganalyticsconfig"."team_id",
+ "posthog_teammarketinganalyticsconfig"."attribution_window_days",
+ "posthog_teammarketinganalyticsconfig"."attribution_mode",
+ "posthog_teammarketinganalyticsconfig"."filter_test_accounts",
+ "posthog_teammarketinganalyticsconfig"."sources_map",
+ "posthog_teammarketinganalyticsconfig"."conversion_goals",
+ "posthog_teammarketinganalyticsconfig"."campaign_name_mappings",
+ "posthog_teammarketinganalyticsconfig"."custom_source_mappings",
+ "posthog_teammarketinganalyticsconfig"."campaign_field_preferences"
+ FROM "posthog_teammarketinganalyticsconfig"
+ WHERE "posthog_teammarketinganalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.129
+ '''
+ SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
+ "customer_analytics_teamcustomeranalyticsconfig"."activity_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."signup_pageview_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."signup_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."subscription_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."payment_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_group_type_index",
+ "customer_analytics_teamcustomeranalyticsconfig"."default_pinned_properties",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules_enabled_at"
+ FROM "customer_analytics_teamcustomeranalyticsconfig"
+ WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.13
+ '''
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_taggeditem"
+ WHERE ("posthog_taggeditem"."content_type_id" = 99999
+ AND "posthog_taggeditem"."object_id" = 99999)
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.130
'''
SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
FROM "posthog_dashboardtile"
@@ -5280,7 +5634,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.122
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.131
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -5313,7 +5667,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.123
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.132
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -5322,7 +5676,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.124
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.133
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -5368,7 +5722,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.125
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.134
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -5414,7 +5768,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.126
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.135
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -5553,7 +5907,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.127
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.136
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -5608,7 +5962,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.128
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.137
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -5631,7 +5985,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.129
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.138
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -5684,15 +6038,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.13
- '''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_taggeditem"
- WHERE ("posthog_taggeditem"."content_type_id" = 99999
- AND "posthog_taggeditem"."object_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.130
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.139
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -5704,7 +6050,23 @@
OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.131
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.14
+ '''
+ SELECT "posthog_filesystem"."id" AS "id",
+ "posthog_filesystem"."path" AS "path"
+ FROM "posthog_filesystem"
+ WHERE (("posthog_filesystem"."surface" IS NULL
+ OR "posthog_filesystem"."surface" = 'web')
+ AND "posthog_filesystem"."ref" = '0001'
+ AND "posthog_filesystem"."team_id" = 99999
+ AND "posthog_filesystem"."type" = 'dashboard'
+ AND NOT ("posthog_filesystem"."shortcut"
+ AND "posthog_filesystem"."shortcut" IS NOT NULL))
+ ORDER BY 1 ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.140
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -5726,7 +6088,7 @@
AND "ee_accesscontrol"."role_id" IS NULL)))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.132
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.141
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -5746,7 +6108,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.133
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.142
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -5759,7 +6121,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.134
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.143
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -5772,7 +6134,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.135
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.144
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -5805,7 +6167,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.136
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.145
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -5904,7 +6266,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.137
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.146
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -5950,7 +6312,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.138
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.147
'''
SELECT 1 AS "a"
FROM "posthog_sharingconfiguration"
@@ -5962,7 +6324,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.139
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.148
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -6061,23 +6423,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.14
- '''
- SELECT "posthog_filesystem"."id" AS "id",
- "posthog_filesystem"."path" AS "path"
- FROM "posthog_filesystem"
- WHERE (("posthog_filesystem"."surface" IS NULL
- OR "posthog_filesystem"."surface" = 'web')
- AND "posthog_filesystem"."ref" = '0001'
- AND "posthog_filesystem"."team_id" = 99999
- AND "posthog_filesystem"."type" = 'dashboard'
- AND NOT ("posthog_filesystem"."shortcut"
- AND "posthog_filesystem"."shortcut" IS NOT NULL))
- ORDER BY 1 ASC
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.140
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.149
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -6102,7 +6448,23 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.141
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.15
+ '''
+ SELECT "posthog_filesystem"."id" AS "id",
+ "posthog_filesystem"."path" AS "path"
+ FROM "posthog_filesystem"
+ WHERE (("posthog_filesystem"."surface" IS NULL
+ OR "posthog_filesystem"."surface" = 'web')
+ AND "posthog_filesystem"."ref" = '0001'
+ AND "posthog_filesystem"."team_id" = 99999
+ AND "posthog_filesystem"."type" = 'dashboard'
+ AND NOT ("posthog_filesystem"."shortcut"
+ AND "posthog_filesystem"."shortcut" IS NOT NULL))
+ ORDER BY 1 ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.150
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -6120,7 +6482,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.142
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.151
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -6166,7 +6528,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.143
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.152
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -6265,7 +6627,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.144
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.153
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -6294,7 +6656,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.145
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.154
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -6323,7 +6685,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.146
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.155
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -6343,7 +6705,53 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.147
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.156
+ '''
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.157
+ '''
+ SELECT "posthog_teammarketinganalyticsconfig"."team_id",
+ "posthog_teammarketinganalyticsconfig"."attribution_window_days",
+ "posthog_teammarketinganalyticsconfig"."attribution_mode",
+ "posthog_teammarketinganalyticsconfig"."filter_test_accounts",
+ "posthog_teammarketinganalyticsconfig"."sources_map",
+ "posthog_teammarketinganalyticsconfig"."conversion_goals",
+ "posthog_teammarketinganalyticsconfig"."campaign_name_mappings",
+ "posthog_teammarketinganalyticsconfig"."custom_source_mappings",
+ "posthog_teammarketinganalyticsconfig"."campaign_field_preferences"
+ FROM "posthog_teammarketinganalyticsconfig"
+ WHERE "posthog_teammarketinganalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.158
+ '''
+ SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
+ "customer_analytics_teamcustomeranalyticsconfig"."activity_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."signup_pageview_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."signup_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."subscription_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."payment_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_group_type_index",
+ "customer_analytics_teamcustomeranalyticsconfig"."default_pinned_properties",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules_enabled_at"
+ FROM "customer_analytics_teamcustomeranalyticsconfig"
+ WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.159
'''
SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
FROM "posthog_dashboardtile"
@@ -6354,7 +6762,23 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.148
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.16
+ '''
+ SELECT "posthog_filesystem"."id" AS "id",
+ "posthog_filesystem"."path" AS "path"
+ FROM "posthog_filesystem"
+ WHERE (("posthog_filesystem"."surface" IS NULL
+ OR "posthog_filesystem"."surface" = 'web')
+ AND "posthog_filesystem"."ref" = '0001'
+ AND "posthog_filesystem"."team_id" = 99999
+ AND "posthog_filesystem"."type" = 'dashboard'
+ AND NOT ("posthog_filesystem"."shortcut"
+ AND "posthog_filesystem"."shortcut" IS NOT NULL))
+ ORDER BY 1 ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.160
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -6387,7 +6811,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.149
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.161
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -6396,23 +6820,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.15
- '''
- SELECT "posthog_filesystem"."id" AS "id",
- "posthog_filesystem"."path" AS "path"
- FROM "posthog_filesystem"
- WHERE (("posthog_filesystem"."surface" IS NULL
- OR "posthog_filesystem"."surface" = 'web')
- AND "posthog_filesystem"."ref" = '0001'
- AND "posthog_filesystem"."team_id" = 99999
- AND "posthog_filesystem"."type" = 'dashboard'
- AND NOT ("posthog_filesystem"."shortcut"
- AND "posthog_filesystem"."shortcut" IS NOT NULL))
- ORDER BY 1 ASC
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.150
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.162
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -6458,7 +6866,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.151
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.163
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -6504,7 +6912,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.152
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.164
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -6643,7 +7051,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.153
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.165
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -6698,7 +7106,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.154
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.166
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -6721,7 +7129,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.155
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.167
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -6774,7 +7182,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.156
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.168
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -6786,7 +7194,7 @@
OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.157
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.169
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -6808,7 +7216,26 @@
AND "ee_accesscontrol"."role_id" IS NULL)))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.158
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.17
+ '''
+ SELECT "posthog_sharingconfiguration"."id",
+ "posthog_sharingconfiguration"."team_id",
+ "posthog_sharingconfiguration"."dashboard_id",
+ "posthog_sharingconfiguration"."insight_id",
+ "posthog_sharingconfiguration"."recording_id",
+ "posthog_sharingconfiguration"."notebook_id",
+ "posthog_sharingconfiguration"."interviewee_context_id",
+ "posthog_sharingconfiguration"."created_at",
+ "posthog_sharingconfiguration"."enabled",
+ "posthog_sharingconfiguration"."access_token",
+ "posthog_sharingconfiguration"."expires_at",
+ "posthog_sharingconfiguration"."settings",
+ "posthog_sharingconfiguration"."password_required"
+ FROM "posthog_sharingconfiguration"
+ WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.170
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -6911,7 +7338,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.159
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.171
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -6934,23 +7361,7 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.16
- '''
- SELECT "posthog_filesystem"."id" AS "id",
- "posthog_filesystem"."path" AS "path"
- FROM "posthog_filesystem"
- WHERE (("posthog_filesystem"."surface" IS NULL
- OR "posthog_filesystem"."surface" = 'web')
- AND "posthog_filesystem"."ref" = '0001'
- AND "posthog_filesystem"."team_id" = 99999
- AND "posthog_filesystem"."type" = 'dashboard'
- AND NOT ("posthog_filesystem"."shortcut"
- AND "posthog_filesystem"."shortcut" IS NOT NULL))
- ORDER BY 1 ASC
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.160
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.172
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -7313,7 +7724,7 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.161
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.173
'''
SELECT ("posthog_dashboardtile"."insight_id") AS "_prefetch_related_val_insight_id",
"posthog_dashboard"."id",
@@ -7355,7 +7766,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.162
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.174
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -7388,7 +7799,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.163
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.175
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -7417,7 +7828,7 @@
2)/* ... */)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.164
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.176
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -7438,7 +7849,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.165
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.177
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -7537,7 +7948,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.166
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.178
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -7562,7 +7973,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.167
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.179
'''
SELECT "posthog_filesystemshortcut"."id",
"posthog_filesystemshortcut"."team_id",
@@ -7585,7 +7996,7 @@
AND "posthog_filesystemshortcut"."href" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.168
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.18
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -7605,7 +8016,27 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.169
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.180
+ '''
+ SELECT "posthog_insightvariable"."id",
+ "posthog_insightvariable"."name",
+ "posthog_insightvariable"."code_name",
+ "posthog_insightvariable"."type",
+ "posthog_insightvariable"."default_value",
+ "posthog_insightvariable"."is_multi"
+ FROM "posthog_insightvariable"
+ INNER JOIN "posthog_team" ON ("posthog_insightvariable"."team_id" = "posthog_team"."id")
+ WHERE ("posthog_insightvariable"."team_id" =
+ (SELECT U0."parent_team_id" AS "parent_team_id"
+ FROM "posthog_team" U0
+ WHERE U0."id" = 99999
+ LIMIT 1)
+ OR ("posthog_team"."parent_team_id" IS NULL
+ AND "posthog_insightvariable"."team_id" = 99999))
+ ORDER BY "posthog_insightvariable"."name" ASC
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.181
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -7969,26 +8400,7 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.17
- '''
- SELECT "posthog_sharingconfiguration"."id",
- "posthog_sharingconfiguration"."team_id",
- "posthog_sharingconfiguration"."dashboard_id",
- "posthog_sharingconfiguration"."insight_id",
- "posthog_sharingconfiguration"."recording_id",
- "posthog_sharingconfiguration"."notebook_id",
- "posthog_sharingconfiguration"."interviewee_context_id",
- "posthog_sharingconfiguration"."created_at",
- "posthog_sharingconfiguration"."enabled",
- "posthog_sharingconfiguration"."access_token",
- "posthog_sharingconfiguration"."expires_at",
- "posthog_sharingconfiguration"."settings",
- "posthog_sharingconfiguration"."password_required"
- FROM "posthog_sharingconfiguration"
- WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.170
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.182
'''
SELECT ("posthog_dashboardtile"."insight_id") AS "_prefetch_related_val_insight_id",
"posthog_dashboard"."id",
@@ -8030,7 +8442,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.171
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.183
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -8063,7 +8475,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.172
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.184
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -8092,7 +8504,7 @@
2)/* ... */)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.173
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.185
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -8113,7 +8525,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.174
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.186
'''
SELECT "posthog_alertconfiguration"."created_by_id",
"posthog_alertconfiguration"."created_at",
@@ -8196,57 +8608,50 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.175
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.187
'''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
+ LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.18
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.188
'''
- SELECT "posthog_insightvariable"."id",
- "posthog_insightvariable"."name",
- "posthog_insightvariable"."code_name",
- "posthog_insightvariable"."type",
- "posthog_insightvariable"."default_value",
- "posthog_insightvariable"."is_multi"
- FROM "posthog_insightvariable"
- INNER JOIN "posthog_team" ON ("posthog_insightvariable"."team_id" = "posthog_team"."id")
- WHERE ("posthog_insightvariable"."team_id" =
- (SELECT U0."parent_team_id" AS "parent_team_id"
- FROM "posthog_team" U0
- WHERE U0."id" = 99999
- LIMIT 1)
- OR ("posthog_team"."parent_team_id" IS NULL
- AND "posthog_insightvariable"."team_id" = 99999))
- ORDER BY "posthog_insightvariable"."name" ASC
+ SELECT "posthog_teammarketinganalyticsconfig"."team_id",
+ "posthog_teammarketinganalyticsconfig"."attribution_window_days",
+ "posthog_teammarketinganalyticsconfig"."attribution_mode",
+ "posthog_teammarketinganalyticsconfig"."filter_test_accounts",
+ "posthog_teammarketinganalyticsconfig"."sources_map",
+ "posthog_teammarketinganalyticsconfig"."conversion_goals",
+ "posthog_teammarketinganalyticsconfig"."campaign_name_mappings",
+ "posthog_teammarketinganalyticsconfig"."custom_source_mappings",
+ "posthog_teammarketinganalyticsconfig"."campaign_field_preferences"
+ FROM "posthog_teammarketinganalyticsconfig"
+ WHERE "posthog_teammarketinganalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.189
+ '''
+ SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
+ "customer_analytics_teamcustomeranalyticsconfig"."activity_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."signup_pageview_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."signup_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."subscription_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."payment_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_group_type_index",
+ "customer_analytics_teamcustomeranalyticsconfig"."default_pinned_properties",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules_enabled_at"
+ FROM "customer_analytics_teamcustomeranalyticsconfig"
+ WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
+ LIMIT 21
'''
# ---
# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.19
@@ -8607,6 +9012,72 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.190
+ '''
+ SELECT "posthog_dashboard"."id",
+ "posthog_dashboard"."name",
+ "posthog_dashboard"."description",
+ "posthog_dashboard"."team_id",
+ "posthog_dashboard"."pinned",
+ "posthog_dashboard"."created_at",
+ "posthog_dashboard"."created_by_id",
+ "posthog_dashboard"."deleted",
+ "posthog_dashboard"."last_accessed_at",
+ "posthog_dashboard"."last_refresh",
+ "posthog_dashboard"."filters",
+ "posthog_dashboard"."variables",
+ "posthog_dashboard"."breakdown_colors",
+ "posthog_dashboard"."data_color_theme_id",
+ "posthog_dashboard"."creation_mode",
+ "posthog_dashboard"."restriction_level",
+ "posthog_dashboard"."quick_filter_ids",
+ "posthog_dashboard"."customization",
+ "posthog_dashboard"."deprecated_tags",
+ "posthog_dashboard"."tags",
+ "posthog_dashboard"."share_token",
+ "posthog_dashboard"."is_shared"
+ FROM "posthog_dashboard"
+ WHERE (NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboard"."id" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.191
+ '''
+ SELECT "posthog_dashboard"."id",
+ "posthog_dashboard"."name",
+ "posthog_dashboard"."description",
+ "posthog_dashboard"."team_id",
+ "posthog_dashboard"."pinned",
+ "posthog_dashboard"."created_at",
+ "posthog_dashboard"."created_by_id",
+ "posthog_dashboard"."deleted",
+ "posthog_dashboard"."last_accessed_at",
+ "posthog_dashboard"."last_refresh",
+ "posthog_dashboard"."filters",
+ "posthog_dashboard"."variables",
+ "posthog_dashboard"."breakdown_colors",
+ "posthog_dashboard"."data_color_theme_id",
+ "posthog_dashboard"."creation_mode",
+ "posthog_dashboard"."restriction_level",
+ "posthog_dashboard"."quick_filter_ids",
+ "posthog_dashboard"."customization",
+ "posthog_dashboard"."deprecated_tags",
+ "posthog_dashboard"."tags",
+ "posthog_dashboard"."share_token",
+ "posthog_dashboard"."is_shared"
+ FROM "posthog_dashboard"
+ WHERE (NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboard"."id" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
+ '''
+# ---
# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.2
'''
SELECT "posthog_team"."id",
@@ -11096,13 +11567,15 @@
# ---
# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.69
'''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
+ LIMIT 21
'''
# ---
# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.7
@@ -11128,6 +11601,50 @@
'''
# ---
# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.70
+ '''
+ SELECT "posthog_teammarketinganalyticsconfig"."team_id",
+ "posthog_teammarketinganalyticsconfig"."attribution_window_days",
+ "posthog_teammarketinganalyticsconfig"."attribution_mode",
+ "posthog_teammarketinganalyticsconfig"."filter_test_accounts",
+ "posthog_teammarketinganalyticsconfig"."sources_map",
+ "posthog_teammarketinganalyticsconfig"."conversion_goals",
+ "posthog_teammarketinganalyticsconfig"."campaign_name_mappings",
+ "posthog_teammarketinganalyticsconfig"."custom_source_mappings",
+ "posthog_teammarketinganalyticsconfig"."campaign_field_preferences"
+ FROM "posthog_teammarketinganalyticsconfig"
+ WHERE "posthog_teammarketinganalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.71
+ '''
+ SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
+ "customer_analytics_teamcustomeranalyticsconfig"."activity_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."signup_pageview_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."signup_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."subscription_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."payment_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_group_type_index",
+ "customer_analytics_teamcustomeranalyticsconfig"."default_pinned_properties",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules_enabled_at"
+ FROM "customer_analytics_teamcustomeranalyticsconfig"
+ WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.72
+ '''
+ SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
+ FROM "posthog_dashboardtile"
+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
+ WHERE (NOT ("posthog_dashboardtile"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL)
+ AND NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboardtile"."insight_id" = 99999)
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.73
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -11160,7 +11677,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.71
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.74
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -11169,7 +11686,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.72
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.75
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -11215,7 +11732,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.73
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.76
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -11261,7 +11778,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.74
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.77
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -11400,7 +11917,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.75
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.78
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -11455,7 +11972,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.76
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.79
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -11478,7 +11995,23 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.77
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.8
+ '''
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_dashboard"
+ INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
+ WHERE (NOT ("posthog_dashboard"."deleted")
+ AND ("posthog_dashboard"."team_id" =
+ (SELECT U0."parent_team_id" AS "parent_team_id"
+ FROM "posthog_team" U0
+ WHERE U0."id" = 99999
+ LIMIT 1)
+ OR ("posthog_team"."parent_team_id" IS NULL
+ AND "posthog_dashboard"."team_id" = 99999))
+ AND NOT "posthog_dashboard"."deleted")
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.80
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -11531,7 +12064,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.78
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.81
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -11543,7 +12076,7 @@
OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.79
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.82
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -11558,30 +12091,14 @@
FROM "ee_accesscontrol"
INNER JOIN "posthog_team" ON ("ee_accesscontrol"."team_id" = "posthog_team"."id")
LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")
- WHERE ("ee_accesscontrol"."resource" = 'project'
- AND "posthog_team"."organization_id" IN ('00000000-0000-0000-0000-000000000000'::uuid)
- AND ("posthog_organizationmembership"."user_id" = 99999
- OR ("ee_accesscontrol"."organization_member_id" IS NULL
- AND "ee_accesscontrol"."role_id" IS NULL)))
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.8
- '''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_dashboard"
- INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND ("posthog_dashboard"."team_id" =
- (SELECT U0."parent_team_id" AS "parent_team_id"
- FROM "posthog_team" U0
- WHERE U0."id" = 99999
- LIMIT 1)
- OR ("posthog_team"."parent_team_id" IS NULL
- AND "posthog_dashboard"."team_id" = 99999))
- AND NOT "posthog_dashboard"."deleted")
+ WHERE ("ee_accesscontrol"."resource" = 'project'
+ AND "posthog_team"."organization_id" IN ('00000000-0000-0000-0000-000000000000'::uuid)
+ AND ("posthog_organizationmembership"."user_id" = 99999
+ OR ("ee_accesscontrol"."organization_member_id" IS NULL
+ AND "ee_accesscontrol"."role_id" IS NULL)))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.80
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.83
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -11601,7 +12118,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.81
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.84
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -11614,7 +12131,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.82
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.85
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -11627,7 +12144,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.83
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.86
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -11660,7 +12177,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.84
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.87
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -11759,7 +12276,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.85
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.88
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -11805,7 +12322,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.86
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.89
'''
SELECT 1 AS "a"
FROM "posthog_sharingconfiguration"
@@ -11817,7 +12334,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.87
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.9
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -11916,50 +12433,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.88
- '''
- SELECT "posthog_filesystem"."team_id",
- "posthog_filesystem"."id",
- "posthog_filesystem"."path",
- "posthog_filesystem"."depth",
- "posthog_filesystem"."type",
- "posthog_filesystem"."ref",
- "posthog_filesystem"."href",
- "posthog_filesystem"."shortcut",
- "posthog_filesystem"."meta",
- "posthog_filesystem"."created_at",
- "posthog_filesystem"."created_by_id",
- "posthog_filesystem"."surface",
- "posthog_filesystem"."project_id"
- FROM "posthog_filesystem"
- WHERE (("posthog_filesystem"."surface" IS NULL
- OR "posthog_filesystem"."surface" = 'web')
- AND "posthog_filesystem"."ref" = '0001'
- AND "posthog_filesystem"."team_id" = 99999
- AND "posthog_filesystem"."type" = 'insight'
- AND NOT ("posthog_filesystem"."shortcut"
- AND "posthog_filesystem"."shortcut" IS NOT NULL))
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.89
- '''
- SELECT "posthog_insightviewed"."id",
- "posthog_insightviewed"."team_id",
- "posthog_insightviewed"."user_id",
- "posthog_insightviewed"."insight_id",
- "posthog_insightviewed"."last_viewed_at",
- "posthog_insightviewed"."source",
- "posthog_insightviewed"."dashboard_id"
- FROM "posthog_insightviewed"
- WHERE ("posthog_insightviewed"."insight_id" = 99999
- AND "posthog_insightviewed"."team_id" = 99999
- AND "posthog_insightviewed"."user_id" = 99999)
- LIMIT 21
- FOR
- UPDATE
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.9
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.90
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -12058,7 +12532,50 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.90
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.91
+ '''
+ SELECT "posthog_filesystem"."team_id",
+ "posthog_filesystem"."id",
+ "posthog_filesystem"."path",
+ "posthog_filesystem"."depth",
+ "posthog_filesystem"."type",
+ "posthog_filesystem"."ref",
+ "posthog_filesystem"."href",
+ "posthog_filesystem"."shortcut",
+ "posthog_filesystem"."meta",
+ "posthog_filesystem"."created_at",
+ "posthog_filesystem"."created_by_id",
+ "posthog_filesystem"."surface",
+ "posthog_filesystem"."project_id"
+ FROM "posthog_filesystem"
+ WHERE (("posthog_filesystem"."surface" IS NULL
+ OR "posthog_filesystem"."surface" = 'web')
+ AND "posthog_filesystem"."ref" = '0001'
+ AND "posthog_filesystem"."team_id" = 99999
+ AND "posthog_filesystem"."type" = 'insight'
+ AND NOT ("posthog_filesystem"."shortcut"
+ AND "posthog_filesystem"."shortcut" IS NOT NULL))
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.92
+ '''
+ SELECT "posthog_insightviewed"."id",
+ "posthog_insightviewed"."team_id",
+ "posthog_insightviewed"."user_id",
+ "posthog_insightviewed"."insight_id",
+ "posthog_insightviewed"."last_viewed_at",
+ "posthog_insightviewed"."source",
+ "posthog_insightviewed"."dashboard_id"
+ FROM "posthog_insightviewed"
+ WHERE ("posthog_insightviewed"."insight_id" = 99999
+ AND "posthog_insightviewed"."team_id" = 99999
+ AND "posthog_insightviewed"."user_id" = 99999)
+ LIMIT 21
+ FOR
+ UPDATE
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.93
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -12104,7 +12621,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.91
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.94
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -12203,7 +12720,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.92
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.95
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -12232,7 +12749,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.93
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.96
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -12261,7 +12778,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.94
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.97
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -12281,148 +12798,32 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.95
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.96
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.97
- '''
- SELECT "posthog_tag"."name" AS "tag__name"
- FROM "posthog_taggeditem"
- INNER JOIN "posthog_tag" ON ("posthog_taggeditem"."tag_id" = "posthog_tag"."id")
- WHERE ("posthog_taggeditem"."content_type_id" = 99999
- AND "posthog_taggeditem"."object_id" = 99999)
- '''
-# ---
# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.98
'''
- SELECT "posthog_user"."id",
- "posthog_user"."password",
- "posthog_user"."last_login",
- "posthog_user"."first_name",
- "posthog_user"."last_name",
- "posthog_user"."is_staff",
- "posthog_user"."date_joined",
- "posthog_user"."uuid",
- "posthog_user"."current_organization_id",
- "posthog_user"."current_team_id",
- "posthog_user"."email",
- "posthog_user"."pending_email",
- "posthog_user"."distinct_id",
- "posthog_user"."is_email_verified",
- "posthog_user"."credentials_reviewed_at",
- "posthog_user"."requested_2fa_reset_at",
- "posthog_user"."has_seen_product_intro_for",
- "posthog_user"."strapi_id",
- "posthog_user"."is_active",
- "posthog_user"."role_at_organization",
- "posthog_user"."theme_mode",
- "posthog_user"."partial_notification_settings",
- "posthog_user"."anonymize_data",
- "posthog_user"."allow_impersonation",
- "posthog_user"."toolbar_mode",
- "posthog_user"."hedgehog_config",
- "posthog_user"."allow_sidebar_suggestions",
- "posthog_user"."shortcut_position",
- "posthog_user"."passkeys_enabled_for_2fa",
- "posthog_user"."hide_mcp_hints",
- "posthog_user"."ui_configuration",
- "posthog_user"."onboarding_skipped_at",
- "posthog_user"."onboarding_skipped_reason",
- "posthog_user"."onboarding_skipped_organization_id",
- "posthog_user"."onboarding_delegated_to_invite_id",
- "posthog_user"."onboarding_delegated_to_organization_id",
- "posthog_user"."onboarding_delegation_accepted_at",
- "posthog_user"."events_column_config",
- "posthog_user"."email_opt_in"
- FROM "posthog_user"
- WHERE ("posthog_user"."is_active"
- AND "posthog_user"."id" = 99999)
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
+ LIMIT 21
'''
# ---
# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.99
'''
- SELECT "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ SELECT "posthog_teammarketinganalyticsconfig"."team_id",
+ "posthog_teammarketinganalyticsconfig"."attribution_window_days",
+ "posthog_teammarketinganalyticsconfig"."attribution_mode",
+ "posthog_teammarketinganalyticsconfig"."filter_test_accounts",
+ "posthog_teammarketinganalyticsconfig"."sources_map",
+ "posthog_teammarketinganalyticsconfig"."conversion_goals",
+ "posthog_teammarketinganalyticsconfig"."campaign_name_mappings",
+ "posthog_teammarketinganalyticsconfig"."custom_source_mappings",
+ "posthog_teammarketinganalyticsconfig"."campaign_field_preferences"
+ FROM "posthog_teammarketinganalyticsconfig"
+ WHERE "posthog_teammarketinganalyticsconfig"."team_id" = 99999
LIMIT 21
'''
# ---
diff --git a/posthog/api/test/dashboards/test_dashboard.py b/posthog/api/test/dashboards/test_dashboard.py
index eb65191d9eb9..23109f4277bd 100644
--- a/posthog/api/test/dashboards/test_dashboard.py
+++ b/posthog/api/test/dashboards/test_dashboard.py
@@ -1112,17 +1112,18 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):
with self.assertNumQueries(baseline + 11):
self.dashboard_api.get_dashboard(dashboard_id, query_params={"no_items_field": "true"})
- # baseline + 11 + 9 once at least one insight materializes
+ # baseline + 11 + 12 once at least one insight materializes. Three of the 12 read the
+ # revenue, marketing and customer analytics configs that go into the query cache key.
self.dashboard_api.create_insight({"dashboards": [dashboard_id]})
- with self.assertNumQueries(baseline + 11 + 9):
+ with self.assertNumQueries(baseline + 11 + 12):
self.dashboard_api.get_dashboard(dashboard_id, query_params={"no_items_field": "true"})
self.dashboard_api.create_insight({"dashboards": [dashboard_id]})
- with self.assertNumQueries(baseline + 11 + 9):
+ with self.assertNumQueries(baseline + 11 + 12):
self.dashboard_api.get_dashboard(dashboard_id, query_params={"no_items_field": "true"})
self.dashboard_api.create_insight({"dashboards": [dashboard_id]})
- with self.assertNumQueries(baseline + 11 + 9):
+ with self.assertNumQueries(baseline + 11 + 12):
self.dashboard_api.get_dashboard(dashboard_id, query_params={"no_items_field": "true"})
def test_insight_alerts_do_not_nplus1_dashboard_gets(self) -> None:
diff --git a/posthog/api/test/test_person.py b/posthog/api/test/test_person.py
index 82e336cd09e3..51f0dbcccc83 100644
--- a/posthog/api/test/test_person.py
+++ b/posthog/api/test/test_person.py
@@ -2221,8 +2221,9 @@ class TestPerson(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):
# 16 as above, plus the include_total counting queries (was 20); the count runs a second
# HogQL database build, which pays the saved-expressions fetch again. +2 because each of
- # the two HogQL database builds looks up the organization's flag_evaluations mode.
- with self.assertNumQueries(21):
+ # the two HogQL database builds looks up the organization's flag_evaluations mode. +1 for the
+ # revenue analytics config, which each request reads on its own Team instance.
+ with self.assertNumQueries(22):
response_include_total = self.client.get("/api/person/?limit=10&include_total").json()
self.assertEqual(response_include_total["count"], 20) # With `include_total`, the total count is returned too
diff --git a/posthog/api/test/test_team.py b/posthog/api/test/test_team.py
index 35c6acf956f6..cfda223d6f14 100644
--- a/posthog/api/test/test_team.py
+++ b/posthog/api/test/test_team.py
@@ -331,6 +331,45 @@ def team_api_test_factory():
]
)
+ @time_machine.travel("2022-02-08", tick=False)
+ def test_update_revenue_analytics_config_logs_only_the_config_change(self):
+ response = self.client.patch(
+ "/api/environments/@current/",
+ {"revenue_analytics_config": {"filter_test_accounts": True}},
+ format="json",
+ )
+ assert response.status_code == status.HTTP_200_OK, response.json()
+
+ self._assert_activity_log(
+ [
+ {
+ "activity": "updated",
+ "created_at": "2022-02-08T00:00:00Z",
+ "detail": {
+ "changes": [
+ {
+ "action": "changed",
+ "after": {"events": [], "filter_test_accounts": True},
+ "before": {"events": [], "filter_test_accounts": False},
+ "field": "revenue_analytics_config",
+ "type": "Team",
+ },
+ ],
+ "name": "Default project",
+ "short_id": None,
+ "trigger": None,
+ "type": None,
+ },
+ "item_id": str(self.team.pk),
+ "scope": "Team",
+ "user": {
+ "email": "[email protected]",
+ "first_name": "",
+ },
+ },
+ ]
+ )
+
def test_update_test_filter_default_checked(self):
response = self.client.patch(
"/api/environments/@current/", {"test_account_filters_default_checked": "true"}
@@ -1410,18 +1449,18 @@ def team_api_test_factory():
},
)
assert response.status_code == status.HTTP_200_OK, response.json()
- self.team.refresh_from_db()
- assert self.team.workflows_config.workflow_task_rate_limit_per_day == 250
- assert self.team.workflows_config.workflow_task_team_rate_limit_per_day == 1000
+ config = TeamWorkflowsConfig.objects.get(team=self.team)
+ assert config.workflow_task_rate_limit_per_day == 250
+ assert config.workflow_task_team_rate_limit_per_day == 1000
response = self.client.patch(
f"/api/environments/{self.team.id}",
{"workflows_config": {"workflow_task_rate_limit_per_day": None}},
)
assert response.status_code == status.HTTP_200_OK, response.json()
- self.team.refresh_from_db()
- assert self.team.workflows_config.workflow_task_rate_limit_per_day is None
- assert self.team.workflows_config.workflow_task_team_rate_limit_per_day == 1000
+ config = TeamWorkflowsConfig.objects.get(team=self.team)
+ assert config.workflow_task_rate_limit_per_day is None
+ assert config.workflow_task_team_rate_limit_per_day == 1000
def test_support_raised_limit_survives_an_echoed_update(self) -> None:
TeamWorkflowsConfig.objects.update_or_create(
diff --git a/posthog/hogql/database/test/__snapshots__/test_database.ambr b/posthog/hogql/database/test/__snapshots__/test_database.ambr
index 6a46c285b483..3c970de07ee0 100644
--- a/posthog/hogql/database/test/__snapshots__/test_database.ambr
+++ b/posthog/hogql/database/test/__snapshots__/test_database.ambr
@@ -30,6 +30,19 @@
'''
# ---
# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1
+ '''
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.1
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -38,71 +51,45 @@
LIMIT 1
'''
# ---
-# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.1
+# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.10
'''
- SELECT "posthog_datawarehousesavedquery"."created_by_id",
- "posthog_datawarehousesavedquery"."created_at",
- "posthog_datawarehousesavedquery"."updated_at",
- "posthog_datawarehousesavedquery"."deleted",
- "posthog_datawarehousesavedquery"."deleted_at",
- "posthog_datawarehousesavedquery"."id",
- "posthog_datawarehousesavedquery"."name",
- "posthog_datawarehousesavedquery"."team_id",
- "posthog_datawarehousesavedquery"."latest_error",
- "posthog_datawarehousesavedquery"."columns",
- "posthog_datawarehousesavedquery"."column_order",
- "posthog_datawarehousesavedquery"."external_tables",
- "posthog_datawarehousesavedquery"."query",
- "posthog_datawarehousesavedquery"."query_revision",
- "posthog_datawarehousesavedquery"."status",
- "posthog_datawarehousesavedquery"."last_run_at",
- "posthog_datawarehousesavedquery"."sync_frequency_interval",
- "posthog_datawarehousesavedquery"."table_id",
- "posthog_datawarehousesavedquery"."is_materialized",
- "posthog_datawarehousesavedquery"."deleted_name",
- "posthog_datawarehousesavedquery"."managed_viewset_id",
- "posthog_datawarehousesavedquery"."folder_id",
- "posthog_datawarehousesavedquery"."origin",
- "posthog_datawarehousesavedquery"."is_test",
- "posthog_datawarehousesavedquery"."expires_at",
- "posthog_datawarehousesavedquery"."semantic_enrichment_hash",
- "posthog_datawarehousesavedquery"."incremental_config",
- "posthog_datawarehousesavedquery"."incremental_state",
- "posthog_datawarehousetable"."created_by_id",
- "posthog_datawarehousetable"."created_at",
- "posthog_datawarehousetable"."updated_at",
- "posthog_datawarehousetable"."deleted",
- "posthog_datawarehousetable"."deleted_at",
- "posthog_datawarehousetable"."id",
- "posthog_datawarehousetable"."name",
- "posthog_datawarehousetable"."format",
- "posthog_datawarehousetable"."team_id",
- "posthog_datawarehousetable"."url_pattern",
- "posthog_datawarehousetable"."queryable_folder",
- "posthog_datawarehousetable"."credential_id",
- "posthog_datawarehousetable"."external_data_source_id",
- "posthog_datawarehousetable"."created_via",
- "posthog_datawarehousetable"."columns",
- "posthog_datawarehousetable"."column_order",
- "posthog_datawarehousetable"."options",
- "posthog_datawarehousetable"."row_count",
- "posthog_datawarehousetable"."size_in_s3_mib",
- "posthog_datawarehousemanagedviewset"."created_by_id",
- "posthog_datawarehousemanagedviewset"."created_at",
- "posthog_datawarehousemanagedviewset"."updated_at",
- "posthog_datawarehousemanagedviewset"."id",
- "posthog_datawarehousemanagedviewset"."team_id",
- "posthog_datawarehousemanagedviewset"."kind"
- FROM "posthog_datawarehousesavedquery"
- LEFT OUTER JOIN "posthog_datawarehousetable" ON ("posthog_datawarehousesavedquery"."table_id" = "posthog_datawarehousetable"."id")
- LEFT OUTER JOIN "posthog_datawarehousemanagedviewset" ON ("posthog_datawarehousesavedquery"."managed_viewset_id" = "posthog_datawarehousemanagedviewset"."id")
- WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999
- AND NOT ("posthog_datawarehousesavedquery"."deleted"
- AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))
- ORDER BY "posthog_datawarehousesavedquery"."name" ASC
+ SELECT "posthog_externaldatasource"."created_by_id",
+ "posthog_externaldatasource"."created_at",
+ "posthog_externaldatasource"."updated_at",
+ "posthog_externaldatasource"."deleted",
+ "posthog_externaldatasource"."deleted_at",
+ "posthog_externaldatasource"."id",
+ "posthog_externaldatasource"."source_id",
+ "posthog_externaldatasource"."connection_id",
+ "posthog_externaldatasource"."destination_id",
+ "posthog_externaldatasource"."team_id",
+ "posthog_externaldatasource"."sync_frequency",
+ "posthog_externaldatasource"."status",
+ "posthog_externaldatasource"."source_type",
+ "posthog_externaldatasource"."api_version",
+ "posthog_externaldatasource"."job_inputs",
+ "posthog_externaldatasource"."connection_metadata",
+ "posthog_externaldatasource"."are_tables_created",
+ "posthog_externaldatasource"."prefix",
+ "posthog_externaldatasource"."description",
+ "posthog_externaldatasource"."created_via",
+ "posthog_externaldatasource"."access_method",
+ "posthog_externaldatasource"."direct_query_enabled",
+ "posthog_externaldatasource"."auto_sync_new_schemas",
+ "posthog_externaldatasource"."auto_sync_schema_patterns",
+ "posthog_externaldatasource"."revenue_analytics_enabled",
+ "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
+ "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
+ "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"
+ FROM "posthog_externaldatasource"
+ LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")
+ WHERE ("posthog_externaldatasource"."team_id" = 99999
+ AND NOT ("posthog_externaldatasource"."deleted"
+ AND "posthog_externaldatasource"."deleted" IS NOT NULL)
+ AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
-# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.10
+# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.11
'''
SELECT "posthog_datawarehousejoin"."created_by_id",
"posthog_datawarehousejoin"."created_at",
@@ -122,7 +109,7 @@
AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.11
+# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.12
'''
SELECT "data_tools_datawarehouseexpression"."deleted",
"data_tools_datawarehouseexpression"."deleted_at",
@@ -141,7 +128,7 @@
AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
'''
# ---
-# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.12
+# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.13
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -174,7 +161,7 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.13
+# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.14
'''
SELECT "posthog_datawarehousecredential"."created_by_id",
"posthog_datawarehousecredential"."created_at",
@@ -193,6 +180,70 @@
'''
# ---
# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.2
+ '''
+ SELECT "posthog_datawarehousesavedquery"."created_by_id",
+ "posthog_datawarehousesavedquery"."created_at",
+ "posthog_datawarehousesavedquery"."updated_at",
+ "posthog_datawarehousesavedquery"."deleted",
+ "posthog_datawarehousesavedquery"."deleted_at",
+ "posthog_datawarehousesavedquery"."id",
+ "posthog_datawarehousesavedquery"."name",
+ "posthog_datawarehousesavedquery"."team_id",
+ "posthog_datawarehousesavedquery"."latest_error",
+ "posthog_datawarehousesavedquery"."columns",
+ "posthog_datawarehousesavedquery"."column_order",
+ "posthog_datawarehousesavedquery"."external_tables",
+ "posthog_datawarehousesavedquery"."query",
+ "posthog_datawarehousesavedquery"."query_revision",
+ "posthog_datawarehousesavedquery"."status",
+ "posthog_datawarehousesavedquery"."last_run_at",
+ "posthog_datawarehousesavedquery"."sync_frequency_interval",
+ "posthog_datawarehousesavedquery"."table_id",
+ "posthog_datawarehousesavedquery"."is_materialized",
+ "posthog_datawarehousesavedquery"."deleted_name",
+ "posthog_datawarehousesavedquery"."managed_viewset_id",
+ "posthog_datawarehousesavedquery"."folder_id",
+ "posthog_datawarehousesavedquery"."origin",
+ "posthog_datawarehousesavedquery"."is_test",
+ "posthog_datawarehousesavedquery"."expires_at",
+ "posthog_datawarehousesavedquery"."semantic_enrichment_hash",
+ "posthog_datawarehousesavedquery"."incremental_config",
+ "posthog_datawarehousesavedquery"."incremental_state",
+ "posthog_datawarehousetable"."created_by_id",
+ "posthog_datawarehousetable"."created_at",
+ "posthog_datawarehousetable"."updated_at",
+ "posthog_datawarehousetable"."deleted",
+ "posthog_datawarehousetable"."deleted_at",
+ "posthog_datawarehousetable"."id",
+ "posthog_datawarehousetable"."name",
+ "posthog_datawarehousetable"."format",
+ "posthog_datawarehousetable"."team_id",
+ "posthog_datawarehousetable"."url_pattern",
+ "posthog_datawarehousetable"."queryable_folder",
+ "posthog_datawarehousetable"."credential_id",
+ "posthog_datawarehousetable"."external_data_source_id",
+ "posthog_datawarehousetable"."created_via",
+ "posthog_datawarehousetable"."columns",
+ "posthog_datawarehousetable"."column_order",
+ "posthog_datawarehousetable"."options",
+ "posthog_datawarehousetable"."row_count",
+ "posthog_datawarehousetable"."size_in_s3_mib",
+ "posthog_datawarehousemanagedviewset"."created_by_id",
+ "posthog_datawarehousemanagedviewset"."created_at",
+ "posthog_datawarehousemanagedviewset"."updated_at",
+ "posthog_datawarehousemanagedviewset"."id",
+ "posthog_datawarehousemanagedviewset"."team_id",
+ "posthog_datawarehousemanagedviewset"."kind"
+ FROM "posthog_datawarehousesavedquery"
+ LEFT OUTER JOIN "posthog_datawarehousetable" ON ("posthog_datawarehousesavedquery"."table_id" = "posthog_datawarehousetable"."id")
+ LEFT OUTER JOIN "posthog_datawarehousemanagedviewset" ON ("posthog_datawarehousesavedquery"."managed_viewset_id" = "posthog_datawarehousemanagedviewset"."id")
+ WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999
+ AND NOT ("posthog_datawarehousesavedquery"."deleted"
+ AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))
+ ORDER BY "posthog_datawarehousesavedquery"."name" ASC
+ '''
+# ---
+# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.3
'''
SELECT "posthog_externaldatasource"."created_by_id",
"posthog_externaldatasource"."created_at",
@@ -230,7 +281,7 @@
AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
-# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.3
+# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.4
'''
SELECT "posthog_datawarehousejoin"."created_by_id",
"posthog_datawarehousejoin"."created_at",
@@ -250,7 +301,7 @@
AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.4
+# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.5
'''
SELECT "data_tools_datawarehouseexpression"."deleted",
"data_tools_datawarehouseexpression"."deleted_at",
@@ -269,7 +320,7 @@
AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
'''
# ---
-# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.5
+# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.6
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -302,7 +353,7 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.6
+# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.7
'''
SELECT "posthog_datawarehousecredential"."created_by_id",
"posthog_datawarehousecredential"."created_at",
@@ -320,7 +371,7 @@
AND "posthog_datawarehousecredential"."team_id" = 99999)
'''
# ---
-# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.7
+# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.8
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -329,7 +380,7 @@
LIMIT 1
'''
# ---
-# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.8
+# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.9
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -393,44 +444,6 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestDatabase.test_database_with_warehouse_tables_and_saved_queries_n_plus_1.9
- '''
- SELECT "posthog_externaldatasource"."created_by_id",
- "posthog_externaldatasource"."created_at",
- "posthog_externaldatasource"."updated_at",
- "posthog_externaldatasource"."deleted",
- "posthog_externaldatasource"."deleted_at",
- "posthog_externaldatasource"."id",
- "posthog_externaldatasource"."source_id",
- "posthog_externaldatasource"."connection_id",
- "posthog_externaldatasource"."destination_id",
- "posthog_externaldatasource"."team_id",
- "posthog_externaldatasource"."sync_frequency",
- "posthog_externaldatasource"."status",
- "posthog_externaldatasource"."source_type",
- "posthog_externaldatasource"."api_version",
- "posthog_externaldatasource"."job_inputs",
- "posthog_externaldatasource"."connection_metadata",
- "posthog_externaldatasource"."are_tables_created",
- "posthog_externaldatasource"."prefix",
- "posthog_externaldatasource"."description",
- "posthog_externaldatasource"."created_via",
- "posthog_externaldatasource"."access_method",
- "posthog_externaldatasource"."direct_query_enabled",
- "posthog_externaldatasource"."auto_sync_new_schemas",
- "posthog_externaldatasource"."auto_sync_schema_patterns",
- "posthog_externaldatasource"."revenue_analytics_enabled",
- "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
- "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
- "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"
- FROM "posthog_externaldatasource"
- LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")
- WHERE ("posthog_externaldatasource"."team_id" = 99999
- AND NOT ("posthog_externaldatasource"."deleted"
- AND "posthog_externaldatasource"."deleted" IS NOT NULL)
- AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
- '''
-# ---
# name: TestDatabase.test_serialize_database_no_person_on_events
'''
{
diff --git a/posthog/hogql/database/test/test_database.py b/posthog/hogql/database/test/test_database.py
index d416e0d76145..f77df1356265 100644
--- a/posthog/hogql/database/test/test_database.py
+++ b/posthog/hogql/database/test/test_database.py
@@ -960,6 +960,11 @@ class TestDatabase(BaseTest, QueryMatchingTest):
f"SELECT whatever.id AS id FROM s3(%(hogql_val_0_sensitive)s, %(hogql_val_3_sensitive)s, %(hogql_val_4_sensitive)s, %(hogql_val_1)s, %(hogql_val_2)s) AS whatever LIMIT 100 SETTINGS readonly=2, max_execution_time=60, allow_experimental_object_type=1, max_ast_elements=4000000, max_expanded_ast_elements=4000000, max_bytes_before_external_group_by=0, transform_null_in=1, optimize_min_equality_disjunction_chain_length=4294967295, optimize_rewrite_aggregate_function_with_if=0, optimize_min_inequality_conjunction_chain_length=4294967295, allow_experimental_join_condition=1, use_hive_partitioning=0",
)
+ def _load_revenue_analytics_config(self) -> None:
+ # The build reads the revenue analytics config once per Team instance. Load it before counting,
+ # so that the counts cover only the queries that grow with the warehouse rows.
+ _ = self.team.revenue_analytics_config
+
@snapshot_postgres_queries
@patch("posthog.hogql.query.sync_execute", return_value=([], []))
def test_database_with_warehouse_tables_and_saved_queries_n_plus_1(self, patch_execute):
@@ -998,6 +1003,7 @@ class TestDatabase(BaseTest, QueryMatchingTest):
status=DataWarehouseSavedQuery.Status.COMPLETED,
)
+ self._load_revenue_analytics_config()
with self.assertNumQueries(max_queries):
modifiers = create_default_modifiers_for_team(
self.team, modifiers=HogQLQueryModifiers(useMaterializedViews=True)
@@ -1307,10 +1313,6 @@ class TestDatabase(BaseTest, QueryMatchingTest):
config = self.team.revenue_analytics_config
config.events = [REVENUE_ANALYTICS_CONFIG_SAMPLE_EVENT]
config.save()
- # Team.revenue_analytics_config memoizes by team pk in a module-level lru_cache, so the
- # configured object would outlive this test's transaction and leak into later tests
- # in this class, which share the team pk.
- self.addCleanup(Team.__dict__["revenue_analytics_config"].fget.cache_clear)
def test_revenue_views_build_only_on_revenue_table_access(self):
self._configure_revenue_events()
@@ -2337,6 +2339,7 @@ class TestDatabase(BaseTest, QueryMatchingTest):
), query
def test_database_credentials_is_not_n_plus_1(self) -> None:
+ self._load_revenue_analytics_config()
for i in range(10):
# we keep adding credentials and tables, number of queries should be stable
credentials = DataWarehouseCredential.objects.create(
@@ -2363,6 +2366,7 @@ class TestDatabase(BaseTest, QueryMatchingTest):
# +2 vs the pre-bulk baseline: one bulk source fetch and one bulk credential fetch replace the
# per-row source/credential joins (hydrate/decrypt once each, not per table).
num_queries = FuzzyInt(7, 13)
+ self._load_revenue_analytics_config()
for i in range(10):
source = ExternalDataSource.objects.create(
diff --git a/posthog/hogql_queries/query_runner.py b/posthog/hogql_queries/query_runner.py
index 752176afb098..f6b1d2848c8b 100644
--- a/posthog/hogql_queries/query_runner.py
+++ b/posthog/hogql_queries/query_runner.py
@@ -2,7 +2,7 @@ import hashlib
import inspect
import threading
from abc import ABC, abstractmethod
-from collections.abc import Callable, Sequence
+from collections.abc import Sequence
from contextlib import ExitStack, suppress
from datetime import UTC, datetime, timedelta
from enum import StrEnum
@@ -1852,6 +1852,25 @@ def query_node_modifiers(query: BaseModel) -> Optional[HogQLQueryModifiers]:
return getattr(query, "modifiers", None)
+def team_configs_for_cache_key(team: Team) -> dict[str, dict | str]:
+ # The team-extension configs are loaded lazily and can hit the DB. Under connection-pool
+ # saturation these reads can time out (OperationalError); degrade to a stable "unavailable"
+ # marker instead of 500-ing the whole query. Failures then share one cache namespace,
+ # separate from the successfully-loaded key.
+ def read(name: str) -> dict | str:
+ try:
+ return getattr(team, name).to_cache_key_dict()
+ except OperationalError:
+ logger.warning("Failed to read %s for cache key, degrading gracefully", name, exc_info=True)
+ return "unavailable"
+
+ return {
+ "revenue_analytics": read("revenue_analytics_config"),
+ "marketing_analytics": read("marketing_analytics_config"),
+ "customer_analytics": read("customer_analytics_config"),
+ }
+
+
class QueryRunner(ABC, Generic[Q, R, CR]):
query: Q
response: R
@@ -3136,22 +3155,7 @@ class QueryRunner(ABC, Generic[Q, R, CR]):
)
def _products_modifiers_for_cache(self) -> dict:
- # The team-extension configs are loaded lazily and can hit the DB. Under connection-pool
- # saturation these reads can time out (OperationalError); degrade to a stable "unavailable"
- # marker instead of 500-ing the whole query. Failures then share one cache namespace,
- # separate from the successfully-loaded key.
- def read(name: str, fn: Callable[[], Any]) -> dict | str:
- try:
- return fn().to_cache_key_dict()
- except OperationalError:
- logger.warning("Failed to read %s for cache key, degrading gracefully", name, exc_info=True)
- return "unavailable"
-
- return {
- "revenue_analytics": read("revenue_analytics_config", lambda: self.team.revenue_analytics_config),
- "marketing_analytics": read("marketing_analytics_config", lambda: self.team.marketing_analytics_config),
- "customer_analytics": read("customer_analytics_config", lambda: self.team.customer_analytics_config),
- }
+ return team_configs_for_cache_key(self.team)
def _get_property_access_restrictions(self) -> list[dict[str, str | int | None]] | None:
"""Returns sorted restricted property metadata for the current user, or None if unrestricted.
diff --git a/posthog/models/filters/mixins/utils.py b/posthog/models/filters/mixins/utils.py
index 1efce54f1f10..ab64a27f9fb2 100644
--- a/posthog/models/filters/mixins/utils.py
+++ b/posthog/models/filters/mixins/utils.py
@@ -7,7 +7,9 @@ from posthog.utils import str_to_bool
T = TypeVar("T")
-# can't use cached_property directly from functools because of 3.7 compatibilty
+# Each decorated function gets one cache slot. Every instance in the process shares it. The slot keys
+# on the instance's __hash__ and __eq__, so a class that compares by value, such as a Django model,
+# gets the result that another equal instance cached. Use functools.cached_property instead.
def cached_property(func: Callable[..., T]) -> T:
return property(lru_cache(maxsize=1)(func)) # type: ignore
diff --git a/posthog/models/team/extensions.py b/posthog/models/team/extensions.py
index 98d8632d108c..1d618ed19156 100644
--- a/posthog/models/team/extensions.py
+++ b/posthog/models/team/extensions.py
@@ -89,6 +89,10 @@ class TeamExtensionDescriptor:
"""
TRANSITIONAL: Descriptor for lazy-loading Team extension models.
+ The first read on a Team instance loads the extension row. Later reads on that instance
+ return the same object. refresh_from_db() does not reload the row. After code writes the row
+ through another object, read the row directly or load a new Team instance.
+
Exists for backward compatibility with existing `team.<product>_config` accessors.
Do NOT add new descriptors to Team — products should access their config via
`get_or_create_team_extension()` directly. This avoids coupling the core Team model
@@ -105,10 +109,13 @@ class TeamExtensionDescriptor:
self.class_name = class_name
self.defaults = defaults
self._model_class: type[models.Model] | None = None
- self.attr_name = ""
+ self.cache_name = ""
def __set_name__(self, owner: type, name: str) -> None:
- self.attr_name = name
+ # The team update paths diff snapshots of `Team.__dict__` for the activity log.
+ # dict_changes_between skips keys that start with "_". A cache under the public name would
+ # log the config as a team field that changed.
+ self.cache_name = f"_{name}"
@property
def model_class(self) -> type[models.Model]:
@@ -120,6 +127,6 @@ class TeamExtensionDescriptor:
def __get__(self, obj: "Team | None", objtype: type | None = None) -> Any:
if obj is None:
return self
- value = get_or_create_team_extension(obj, self.model_class, self.defaults)
- obj.__dict__[self.attr_name] = value
- return value
+ if self.cache_name not in obj.__dict__:
+ obj.__dict__[self.cache_name] = get_or_create_team_extension(obj, self.model_class, self.defaults)
+ return obj.__dict__[self.cache_name]
diff --git a/posthog/models/team/team.py b/posthog/models/team/team.py
index 59ee15a64d0a..1f0dfe5244b5 100644
--- a/posthog/models/team/team.py
+++ b/posthog/models/team/team.py
@@ -1,7 +1,6 @@
from collections import defaultdict
from datetime import timedelta
from decimal import Decimal
-from functools import lru_cache
from typing import TYPE_CHECKING, Optional, cast
from zoneinfo import ZoneInfo
@@ -21,7 +20,6 @@ import pydantic
from posthog.clickhouse.query_tagging import Feature, Product, tag_queries, tags_context
from posthog.cloud_utils import is_cloud
from posthog.helpers.session_recording_playlist_templates import DEFAULT_PLAYLISTS
-from posthog.models.filters.mixins.utils import cached_property
from posthog.models.filters.utils import GroupTypeIndex
from posthog.models.instance_setting import get_instance_setting
from posthog.models.organization import Organization, OrganizationMembership
@@ -50,7 +48,7 @@ from posthog.week_start_day import WeekStartDay # noqa: F401
from ...hogql.modifiers import set_default_modifier_values
from ...schema_enums import CurrencyCode, PersonsOnEventsMode
-from .extensions import get_or_create_team_extension
+from .extensions import TeamExtensionDescriptor
from .team_caching import get_team_in_cache, set_team_in_cache
if TYPE_CHECKING:
@@ -752,35 +750,21 @@ class Team(UUIDTClassicModel):
# without raising. A config no serializer exposes needs no accessor here, and is reached through
# the helper the way TeamFeatureFlagDefaultsConfig is.
- @cached_property
- def revenue_analytics_config(self):
- from .team_revenue_analytics_config import TeamRevenueAnalyticsConfig
-
- return get_or_create_team_extension(self, TeamRevenueAnalyticsConfig)
-
- @cached_property
- def marketing_analytics_config(self):
- from .team_marketing_analytics_config import TeamMarketingAnalyticsConfig
-
- return get_or_create_team_extension(self, TeamMarketingAnalyticsConfig)
-
- @cached_property
- def customer_analytics_config(self):
- from products.customer_analytics.backend.facade.team_extension import TeamCustomerAnalyticsConfig
-
- return get_or_create_team_extension(self, TeamCustomerAnalyticsConfig)
-
- @cached_property
- def workflows_config(self):
- from products.workflows.backend.facade.team_extension import TeamWorkflowsConfig
-
- return get_or_create_team_extension(self, TeamWorkflowsConfig)
-
- @cached_property
- def feature_flag_policy_config(self):
- from products.feature_flags.backend.models.team_feature_flag_policy_config import TeamFeatureFlagPolicyConfig
-
- return get_or_create_team_extension(self, TeamFeatureFlagPolicyConfig)
+ revenue_analytics_config = TeamExtensionDescriptor(
+ "posthog.models.team.team_revenue_analytics_config", "TeamRevenueAnalyticsConfig"
+ )
+ marketing_analytics_config = TeamExtensionDescriptor(
+ "posthog.models.team.team_marketing_analytics_config", "TeamMarketingAnalyticsConfig"
+ )
+ customer_analytics_config = TeamExtensionDescriptor(
+ "products.customer_analytics.backend.facade.team_extension", "TeamCustomerAnalyticsConfig"
+ )
+ workflows_config = TeamExtensionDescriptor(
+ "products.workflows.backend.facade.team_extension", "TeamWorkflowsConfig"
+ )
+ feature_flag_policy_config = TeamExtensionDescriptor(
+ "products.feature_flags.backend.models.team_feature_flag_policy_config", "TeamFeatureFlagPolicyConfig"
+ )
@property
def default_modifiers(self) -> dict:
@@ -879,10 +863,6 @@ class Team(UUIDTClassicModel):
enabled_teams = get_list(get_instance_setting("STRICT_CACHING_TEAMS"))
return str(self.pk) in enabled_teams or "all" in enabled_teams
- @cached_property
- def persons_seen_so_far(self) -> int:
- return self.count_persons_seen_so_far()
-
def count_persons_seen_so_far(self, database: Optional["Database"] = None) -> int:
from posthog.schema import HogQLQueryModifiers
@@ -905,10 +885,6 @@ class Team(UUIDTClassicModel):
context=HogQLContext(team_id=self.pk, database=database),
).results[0][0]
- @lru_cache(maxsize=5) # noqa: B019 - TODO: refactor to module-level cache
- def groups_seen_so_far(self, group_type_index: GroupTypeIndex) -> int:
- return self.count_groups_seen_so_far(group_type_index)
-
def count_groups_seen_so_far(self, group_type_index: GroupTypeIndex, database: Optional["Database"] = None) -> int:
from posthog.hogql import ast # noqa: PLC0415 — breaks team import cycle
from posthog.hogql.context import HogQLContext # noqa: PLC0415 — breaks team import cycle
diff --git a/posthog/models/team/test/test_extensions.py b/posthog/models/team/test/test_extensions.py
index d434c53959f3..34c7ac440ae4 100644
--- a/posthog/models/team/test/test_extensions.py
+++ b/posthog/models/team/test/test_extensions.py
@@ -1,6 +1,11 @@
+from typing import Any
+
from posthog.test.base import BaseTest
+from parameterized import parameterized
+
from posthog.models.team.extensions import get_or_create_team_extension
+from posthog.models.team.team import Team
from posthog.models.team.team_revenue_analytics_config import TeamRevenueAnalyticsConfig
@@ -16,3 +21,23 @@ class TestGetOrCreateTeamExtension(BaseTest):
with self.assertNumQueries(0):
assert config.team is self.team
config.to_cache_key_dict()
+
+ @parameterized.expand(
+ [
+ ("revenue_analytics_config", "filter_test_accounts", True),
+ ("marketing_analytics_config", "attribution_window_days", 14),
+ ("customer_analytics_config", "account_group_type_index", 2),
+ ("workflows_config", "capture_workflows_engagement_events", True),
+ ("feature_flag_policy_config", "require_tags", True),
+ ]
+ )
+ def test_team_accessor_loads_config_per_team_instance(self, accessor: str, field: str, new_value: Any) -> None:
+ first_team = Team.objects.get(pk=self.team.pk)
+ first_config = getattr(first_team, accessor)
+ type(first_config).objects.filter(team_id=self.team.pk).update(**{field: new_value})
+ second_team = Team.objects.get(pk=self.team.pk)
+
+ second_config = getattr(second_team, accessor)
+
+ assert second_config.team is second_team
+ assert getattr(second_config, field) == new_value
diff --git a/posthog/session_recordings/test/__snapshots__/test_session_recording_playlist.ambr b/posthog/session_recordings/test/__snapshots__/test_session_recording_playlist.ambr
index 06c5798e37e5..72337f8b9d08 100644
--- a/posthog/session_recordings/test/__snapshots__/test_session_recording_playlist.ambr
+++ b/posthog/session_recordings/test/__snapshots__/test_session_recording_playlist.ambr
@@ -1130,6 +1130,19 @@
'''
# ---
# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.30
+ '''
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.31
'''
SELECT "posthog_externaldatasource"."created_by_id",
"posthog_externaldatasource"."created_at",
@@ -1167,7 +1180,7 @@
AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.31
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.32
'''
SELECT "posthog_datawarehousejoin"."created_by_id",
"posthog_datawarehousejoin"."created_at",
@@ -1187,7 +1200,7 @@
AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.32
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.33
'''
SELECT "data_tools_datawarehouseexpression"."deleted",
"data_tools_datawarehouseexpression"."deleted_at",
@@ -1206,7 +1219,7 @@
AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.33
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.34
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -1239,7 +1252,7 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.34
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.35
'''
SELECT "posthog_propertydefinition"."id",
"posthog_propertydefinition"."team_id",
@@ -1263,7 +1276,7 @@
5 /* ... */))
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.35
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.36
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -1309,7 +1322,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.36
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.37
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -1355,7 +1368,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.37
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.38
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1494,7 +1507,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.38
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.39
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1549,29 +1562,6 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.39
- '''
- SELECT "ee_accesscontrol"."id",
- "ee_accesscontrol"."team_id",
- "ee_accesscontrol"."access_level",
- "ee_accesscontrol"."resource",
- "ee_accesscontrol"."resource_id",
- "ee_accesscontrol"."organization_member_id",
- "ee_accesscontrol"."role_id",
- "ee_accesscontrol"."created_by_id",
- "ee_accesscontrol"."created_at",
- "ee_accesscontrol"."updated_at"
- FROM "ee_accesscontrol"
- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")
- WHERE (("ee_accesscontrol"."organization_member_id" IS NULL
- AND "ee_accesscontrol"."role_id" IS NULL
- AND "ee_accesscontrol"."team_id" = 99999)
- OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_organizationmembership"."user_id" = 99999
- AND "ee_accesscontrol"."role_id" IS NULL
- AND "ee_accesscontrol"."team_id" = 99999))
- '''
-# ---
# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.4
'''
SELECT "posthog_organization"."id",
@@ -1619,6 +1609,29 @@
'''
# ---
# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.40
+ '''
+ SELECT "ee_accesscontrol"."id",
+ "ee_accesscontrol"."team_id",
+ "ee_accesscontrol"."access_level",
+ "ee_accesscontrol"."resource",
+ "ee_accesscontrol"."resource_id",
+ "ee_accesscontrol"."organization_member_id",
+ "ee_accesscontrol"."role_id",
+ "ee_accesscontrol"."created_by_id",
+ "ee_accesscontrol"."created_at",
+ "ee_accesscontrol"."updated_at"
+ FROM "ee_accesscontrol"
+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")
+ WHERE (("ee_accesscontrol"."organization_member_id" IS NULL
+ AND "ee_accesscontrol"."role_id" IS NULL
+ AND "ee_accesscontrol"."team_id" = 99999)
+ OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_organizationmembership"."user_id" = 99999
+ AND "ee_accesscontrol"."role_id" IS NULL
+ AND "ee_accesscontrol"."team_id" = 99999))
+ '''
+# ---
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.41
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1671,7 +1684,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.41
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.42
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_sessionrecordingplaylist"
@@ -1682,7 +1695,7 @@
AND NOT "posthog_sessionrecordingplaylist"."deleted")
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.42
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.43
'''
SELECT "posthog_sessionrecordingplaylist"."id",
"posthog_sessionrecordingplaylist"."short_id",
@@ -1894,7 +1907,7 @@
LIMIT 94
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.43
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.44
'''
SELECT "posthog_sessionrecordingplaylistitem"."playlist_id" AS "playlist_id",
COUNT("posthog_sessionrecordingplaylistitem"."id") AS "c"
@@ -1914,7 +1927,7 @@
GROUP BY 1
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.44
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.45
'''
SELECT "posthog_sessionrecordingplaylistitem"."playlist_id" AS "playlist_id",
"posthog_sessionrecordingplaylistitem"."recording_id" AS "recording_id"
@@ -1933,7 +1946,7 @@
AND "posthog_sessionrecording"."start_time" IS NOT NULL))
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.45
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.46
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
FROM "posthog_sessionrecordingviewed"
@@ -1942,7 +1955,7 @@
AND "posthog_sessionrecordingviewed"."session_id" IN ('00000000-0000-0000-0000-000000000000'))
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.46
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.47
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_sessionrecordingviewed"
@@ -1950,7 +1963,7 @@
AND "posthog_sessionrecordingviewed"."user_id" = 99999)
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.47
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.48
'''
SELECT COUNT(*)
FROM
@@ -1962,7 +1975,7 @@
AND NOT ("posthog_comment"."item_id" IS NULL))) subquery
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.48
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.49
'''
SELECT COUNT(*)
FROM
@@ -1973,21 +1986,6 @@
AND NOT ("posthog_sharingconfiguration"."recording_id" IS NULL))) subquery
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.49
- '''
- SELECT COUNT(*)
- FROM
- (SELECT DISTINCT ("posthog_exportedasset"."export_context" -> 'session_recording_id') AS "export_context__session_recording_id"
- FROM "posthog_exportedasset"
- WHERE (("posthog_exportedasset"."expires_after" >= '2025-01-01 12:00:00+00:00'::timestamptz
- OR "posthog_exportedasset"."expires_after" IS NULL)
- AND "posthog_exportedasset"."team_id" = 99999
- AND "posthog_exportedasset"."export_context" ? 'session_recording_id'
- AND NOT (("posthog_exportedasset"."export_context" -> 'session_recording_id') IS NULL)
- AND NOT (("posthog_exportedasset"."export_context" -> 'session_recording_id') = '""'::jsonb
- AND "posthog_exportedasset"."export_context" IS NOT NULL))) subquery
- '''
-# ---
# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.5
'''
SELECT "posthog_team"."id",
@@ -2127,6 +2125,21 @@
LIMIT 21
'''
# ---
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.50
+ '''
+ SELECT COUNT(*)
+ FROM
+ (SELECT DISTINCT ("posthog_exportedasset"."export_context" -> 'session_recording_id') AS "export_context__session_recording_id"
+ FROM "posthog_exportedasset"
+ WHERE (("posthog_exportedasset"."expires_after" >= '2025-01-01 12:00:00+00:00'::timestamptz
+ OR "posthog_exportedasset"."expires_after" IS NULL)
+ AND "posthog_exportedasset"."team_id" = 99999
+ AND "posthog_exportedasset"."export_context" ? 'session_recording_id'
+ AND NOT (("posthog_exportedasset"."export_context" -> 'session_recording_id') IS NULL)
+ AND NOT (("posthog_exportedasset"."export_context" -> 'session_recording_id') = '""'::jsonb
+ AND "posthog_exportedasset"."export_context" IS NOT NULL))) subquery
+ '''
+# ---
# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.6
'''
SELECT "posthog_organizationmembership"."id",
diff --git a/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr b/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr
index a08e700ae3ac..75e984d2e344 100644
--- a/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr
+++ b/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr
@@ -4732,25 +4732,228 @@
# ---
# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.10
'''
- SELECT "posthog_datawarehousejoin"."created_by_id",
- "posthog_datawarehousejoin"."created_at",
- "posthog_datawarehousejoin"."deleted",
- "posthog_datawarehousejoin"."deleted_at",
- "posthog_datawarehousejoin"."id",
- "posthog_datawarehousejoin"."team_id",
- "posthog_datawarehousejoin"."source_table_name",
- "posthog_datawarehousejoin"."source_table_key",
- "posthog_datawarehousejoin"."joining_table_name",
- "posthog_datawarehousejoin"."joining_table_key",
- "posthog_datawarehousejoin"."field_name",
- "posthog_datawarehousejoin"."configuration"
- FROM "posthog_datawarehousejoin"
- WHERE ("posthog_datawarehousejoin"."team_id" = 99999
- AND NOT ("posthog_datawarehousejoin"."deleted"
- AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
+ SELECT "posthog_externaldatasource"."created_by_id",
+ "posthog_externaldatasource"."created_at",
+ "posthog_externaldatasource"."updated_at",
+ "posthog_externaldatasource"."deleted",
+ "posthog_externaldatasource"."deleted_at",
+ "posthog_externaldatasource"."id",
+ "posthog_externaldatasource"."source_id",
+ "posthog_externaldatasource"."connection_id",
+ "posthog_externaldatasource"."destination_id",
+ "posthog_externaldatasource"."team_id",
+ "posthog_externaldatasource"."sync_frequency",
+ "posthog_externaldatasource"."status",
+ "posthog_externaldatasource"."source_type",
+ "posthog_externaldatasource"."api_version",
+ "posthog_externaldatasource"."job_inputs",
+ "posthog_externaldatasource"."connection_metadata",
+ "posthog_externaldatasource"."are_tables_created",
+ "posthog_externaldatasource"."prefix",
+ "posthog_externaldatasource"."description",
+ "posthog_externaldatasource"."created_via",
+ "posthog_externaldatasource"."access_method",
+ "posthog_externaldatasource"."direct_query_enabled",
+ "posthog_externaldatasource"."auto_sync_new_schemas",
+ "posthog_externaldatasource"."auto_sync_schema_patterns",
+ "posthog_externaldatasource"."revenue_analytics_enabled",
+ "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
+ "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
+ "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"
+ FROM "posthog_externaldatasource"
+ LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")
+ WHERE ("posthog_externaldatasource"."team_id" = 99999
+ AND NOT ("posthog_externaldatasource"."deleted"
+ AND "posthog_externaldatasource"."deleted" IS NOT NULL)
+ AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.100
+ '''
+ SELECT "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_organization"
+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ LIMIT 21
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.101
+ '''
+ SELECT "posthog_team"."id",
+ "posthog_team"."uuid",
+ "posthog_team"."organization_id",
+ "posthog_team"."parent_team_id",
+ "posthog_team"."project_id",
+ "posthog_team"."api_token",
+ "posthog_team"."app_urls",
+ "posthog_team"."name",
+ "posthog_team"."slack_incoming_webhook",
+ "posthog_team"."created_at",
+ "posthog_team"."updated_at",
+ "posthog_team"."anonymize_ips",
+ "posthog_team"."completed_snippet_onboarding",
+ "posthog_team"."has_completed_onboarding_for",
+ "posthog_team"."onboarding_tasks",
+ "posthog_team"."ingested_event",
+ "posthog_team"."ingested_production_event",
+ "posthog_team"."ingested_production_event_last_checked_at",
+ "posthog_team"."person_processing_opt_out",
+ "posthog_team"."secret_api_token",
+ "posthog_team"."secret_api_token_backup",
+ "posthog_team"."session_recording_opt_in",
+ "posthog_team"."session_recording_sample_rate",
+ "posthog_team"."session_recording_minimum_duration_milliseconds",
+ "posthog_team"."session_recording_linked_flag",
+ "posthog_team"."session_recording_network_payload_capture_config",
+ "posthog_team"."session_recording_masking_config",
+ "posthog_team"."session_recording_url_trigger_config",
+ "posthog_team"."session_recording_url_blocklist_config",
+ "posthog_team"."session_recording_event_trigger_config",
+ "posthog_team"."session_recording_trigger_match_type_config",
+ "posthog_team"."session_recording_trigger_groups",
+ "posthog_team"."session_replay_config",
+ "posthog_team"."session_recording_retention_period",
+ "posthog_team"."event_retention_months",
+ "posthog_team"."conversations_enabled",
+ "posthog_team"."conversations_settings",
+ "posthog_team"."proactive_tasks_enabled",
+ "posthog_team"."survey_config",
+ "posthog_team"."surveys_opt_in",
+ "posthog_team"."product_tours_opt_in",
+ "posthog_team"."capture_console_log_opt_in",
+ "posthog_team"."capture_performance_opt_in",
+ "posthog_team"."capture_dead_clicks",
+ "posthog_team"."autocapture_opt_out",
+ "posthog_team"."autocapture_web_vitals_opt_in",
+ "posthog_team"."autocapture_web_vitals_allowed_metrics",
+ "posthog_team"."autocapture_exceptions_opt_in",
+ "posthog_team"."autocapture_exceptions_errors_to_ignore",
+ "posthog_team"."logs_settings",
+ "posthog_team"."llm_gateway_enabled_at",
+ "posthog_team"."llm_gateway_revoked_at",
+ "posthog_team"."llm_gateway_overspend_allowance_usd",
+ "posthog_team"."heatmaps_opt_in",
+ "posthog_team"."receive_org_level_activity_logs",
+ "posthog_team"."web_analytics_pre_aggregated_tables_enabled",
+ "posthog_team"."web_analytics_pre_aggregated_tables_version",
+ "posthog_team"."flags_persistence_default",
+ "posthog_team"."feature_flag_confirmation_enabled",
+ "posthog_team"."feature_flag_confirmation_message",
+ "posthog_team"."default_evaluation_environments_enabled",
+ "posthog_team"."require_evaluation_environment_tags",
+ "posthog_team"."default_evaluation_contexts_enabled",
+ "posthog_team"."require_evaluation_contexts",
+ "posthog_team"."session_recording_version",
+ "posthog_team"."signup_token",
+ "posthog_team"."is_demo",
+ "posthog_team"."access_control",
+ "posthog_team"."week_start_day",
+ "posthog_team"."inject_web_apps",
+ "posthog_team"."test_account_filters",
+ "posthog_team"."test_account_filters_default_checked",
+ "posthog_team"."path_cleaning_filters",
+ "posthog_team"."timezone",
+ "posthog_team"."data_attributes",
+ "posthog_team"."person_display_name_properties",
+ "posthog_team"."live_events_columns",
+ "posthog_team"."recording_domains",
+ "posthog_team"."human_friendly_comparison_periods",
+ "posthog_team"."cookieless_server_hash_mode",
+ "posthog_team"."primary_dashboard_id",
+ "posthog_team"."default_data_theme",
+ "posthog_team"."extra_settings",
+ "posthog_team"."modifiers",
+ "posthog_team"."correlation_config",
+ "posthog_team"."session_recording_retention_period_days",
+ "posthog_team"."external_data_workspace_id",
+ "posthog_team"."external_data_workspace_last_synced_at",
+ "posthog_team"."api_query_rate_limit",
+ "posthog_team"."drop_events_older_than",
+ "posthog_team"."base_currency",
+ "posthog_team"."business_model",
+ "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_team"
+ INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
+ WHERE "posthog_team"."id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.102
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -4805,27 +5008,167 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.101
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.103
'''
- SELECT "posthog_datawarehousesavedquery"."created_by_id",
- "posthog_datawarehousesavedquery"."created_at",
- "posthog_datawarehousesavedquery"."updated_at",
- "posthog_datawarehousesavedquery"."deleted",
- "posthog_datawarehousesavedquery"."deleted_at",
- "posthog_datawarehousesavedquery"."id",
- "posthog_datawarehousesavedquery"."name",
- "posthog_datawarehousesavedquery"."team_id",
- "posthog_datawarehousesavedquery"."latest_error",
- "posthog_datawarehousesavedquery"."columns",
- "posthog_datawarehousesavedquery"."column_order",
- "posthog_datawarehousesavedquery"."external_tables",
- "posthog_datawarehousesavedquery"."query",
- "posthog_datawarehousesavedquery"."query_revision",
- "posthog_datawarehousesavedquery"."status",
- "posthog_datawarehousesavedquery"."last_run_at",
- "posthog_datawarehousesavedquery"."sync_frequency_interval",
- "posthog_datawarehousesavedquery"."table_id",
- "posthog_datawarehousesavedquery"."is_materialized",
+ SELECT "ee_accesscontrol"."id",
+ "ee_accesscontrol"."team_id",
+ "ee_accesscontrol"."access_level",
+ "ee_accesscontrol"."resource",
+ "ee_accesscontrol"."resource_id",
+ "ee_accesscontrol"."organization_member_id",
+ "ee_accesscontrol"."role_id",
+ "ee_accesscontrol"."created_by_id",
+ "ee_accesscontrol"."created_at",
+ "ee_accesscontrol"."updated_at"
+ FROM "ee_accesscontrol"
+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")
+ WHERE (("ee_accesscontrol"."organization_member_id" IS NULL
+ AND "ee_accesscontrol"."role_id" IS NULL
+ AND "ee_accesscontrol"."team_id" = 99999)
+ OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_organizationmembership"."user_id" = 99999
+ AND "ee_accesscontrol"."role_id" IS NULL
+ AND "ee_accesscontrol"."team_id" = 99999))
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.104
+ '''
+ SELECT "posthog_organizationmembership"."id",
+ "posthog_organizationmembership"."organization_id",
+ "posthog_organizationmembership"."user_id",
+ "posthog_organizationmembership"."level",
+ "posthog_organizationmembership"."joined_at",
+ "posthog_organizationmembership"."updated_at",
+ "posthog_organizationmembership"."invited_by_id",
+ "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_organizationmembership"
+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
+ WHERE "posthog_organizationmembership"."user_id" = 99999
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.105
+ '''
+ SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
+ FROM "feature_flags_organizationfeatureflagsconfig"
+ WHERE "feature_flags_organizationfeatureflagsconfig"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ ORDER BY "feature_flags_organizationfeatureflagsconfig"."organization_id" ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.106
+ '''
+ SELECT "posthog_organizationmembership"."id",
+ "posthog_organizationmembership"."organization_id",
+ "posthog_organizationmembership"."user_id",
+ "posthog_organizationmembership"."level",
+ "posthog_organizationmembership"."joined_at",
+ "posthog_organizationmembership"."updated_at",
+ "posthog_organizationmembership"."invited_by_id",
+ "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_organizationmembership"
+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_organizationmembership"."user_id" = 99999)
+ LIMIT 21
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.107
+ '''
+ SELECT "posthog_datawarehousesavedquery"."created_by_id",
+ "posthog_datawarehousesavedquery"."created_at",
+ "posthog_datawarehousesavedquery"."updated_at",
+ "posthog_datawarehousesavedquery"."deleted",
+ "posthog_datawarehousesavedquery"."deleted_at",
+ "posthog_datawarehousesavedquery"."id",
+ "posthog_datawarehousesavedquery"."name",
+ "posthog_datawarehousesavedquery"."team_id",
+ "posthog_datawarehousesavedquery"."latest_error",
+ "posthog_datawarehousesavedquery"."columns",
+ "posthog_datawarehousesavedquery"."column_order",
+ "posthog_datawarehousesavedquery"."external_tables",
+ "posthog_datawarehousesavedquery"."query",
+ "posthog_datawarehousesavedquery"."query_revision",
+ "posthog_datawarehousesavedquery"."status",
+ "posthog_datawarehousesavedquery"."last_run_at",
+ "posthog_datawarehousesavedquery"."sync_frequency_interval",
+ "posthog_datawarehousesavedquery"."table_id",
+ "posthog_datawarehousesavedquery"."is_materialized",
"posthog_datawarehousesavedquery"."deleted_name",
"posthog_datawarehousesavedquery"."managed_viewset_id",
"posthog_datawarehousesavedquery"."folder_id",
@@ -4869,7 +5212,20 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.102
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.108
+ '''
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.109
'''
SELECT "posthog_externaldatasource"."created_by_id",
"posthog_externaldatasource"."created_at",
@@ -4907,7 +5263,7 @@
AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.103
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.11
'''
SELECT "posthog_datawarehousejoin"."created_by_id",
"posthog_datawarehousejoin"."created_at",
@@ -4927,7 +5283,27 @@
AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.104
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.110
+ '''
+ SELECT "posthog_datawarehousejoin"."created_by_id",
+ "posthog_datawarehousejoin"."created_at",
+ "posthog_datawarehousejoin"."deleted",
+ "posthog_datawarehousejoin"."deleted_at",
+ "posthog_datawarehousejoin"."id",
+ "posthog_datawarehousejoin"."team_id",
+ "posthog_datawarehousejoin"."source_table_name",
+ "posthog_datawarehousejoin"."source_table_key",
+ "posthog_datawarehousejoin"."joining_table_name",
+ "posthog_datawarehousejoin"."joining_table_key",
+ "posthog_datawarehousejoin"."field_name",
+ "posthog_datawarehousejoin"."configuration"
+ FROM "posthog_datawarehousejoin"
+ WHERE ("posthog_datawarehousejoin"."team_id" = 99999
+ AND NOT ("posthog_datawarehousejoin"."deleted"
+ AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.111
'''
SELECT "data_tools_datawarehouseexpression"."deleted",
"data_tools_datawarehouseexpression"."deleted_at",
@@ -4946,7 +5322,7 @@
AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.105
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.112
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -4979,7 +5355,7 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.106
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.113
'''
SELECT "posthog_sessionrecording"."id",
"posthog_sessionrecording"."session_id",
@@ -5010,7 +5386,7 @@
AND "posthog_sessionrecording"."team_id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.107
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.114
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
FROM "posthog_sessionrecordingviewed"
@@ -5024,7 +5400,7 @@
'1'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.108
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.115
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id",
"posthog_user"."email" AS "user__email"
@@ -5040,7 +5416,7 @@
AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.109
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.116
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -5086,26 +5462,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.11
- '''
- SELECT "data_tools_datawarehouseexpression"."deleted",
- "data_tools_datawarehouseexpression"."deleted_at",
- "data_tools_datawarehouseexpression"."id",
- "data_tools_datawarehouseexpression"."team_id",
- "data_tools_datawarehouseexpression"."created_at",
- "data_tools_datawarehouseexpression"."created_by_id",
- "data_tools_datawarehouseexpression"."table_name",
- "data_tools_datawarehouseexpression"."field_name",
- "data_tools_datawarehouseexpression"."expression",
- "data_tools_datawarehouseexpression"."connection_id"
- FROM "data_tools_datawarehouseexpression"
- WHERE ("data_tools_datawarehouseexpression"."team_id" = 99999
- AND NOT ("data_tools_datawarehouseexpression"."deleted"
- AND "data_tools_datawarehouseexpression"."deleted" IS NOT NULL)
- AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
- '''
-# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.110
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.117
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -5151,7 +5508,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.111
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.118
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -5290,7 +5647,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.112
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.119
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -5345,7 +5702,26 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.113
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.12
+ '''
+ SELECT "data_tools_datawarehouseexpression"."deleted",
+ "data_tools_datawarehouseexpression"."deleted_at",
+ "data_tools_datawarehouseexpression"."id",
+ "data_tools_datawarehouseexpression"."team_id",
+ "data_tools_datawarehouseexpression"."created_at",
+ "data_tools_datawarehouseexpression"."created_by_id",
+ "data_tools_datawarehouseexpression"."table_name",
+ "data_tools_datawarehouseexpression"."field_name",
+ "data_tools_datawarehouseexpression"."expression",
+ "data_tools_datawarehouseexpression"."connection_id"
+ FROM "data_tools_datawarehouseexpression"
+ WHERE ("data_tools_datawarehouseexpression"."team_id" = 99999
+ AND NOT ("data_tools_datawarehouseexpression"."deleted"
+ AND "data_tools_datawarehouseexpression"."deleted" IS NOT NULL)
+ AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.120
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -5368,7 +5744,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.114
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.121
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -5421,7 +5797,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.115
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.122
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -5430,7 +5806,7 @@
LIMIT 1
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.116
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.123
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -5485,7 +5861,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.117
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.124
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -5549,7 +5925,20 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.118
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.125
+ '''
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.126
'''
SELECT "posthog_externaldatasource"."created_by_id",
"posthog_externaldatasource"."created_at",
@@ -5587,7 +5976,7 @@
AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.119
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.127
'''
SELECT "posthog_datawarehousejoin"."created_by_id",
"posthog_datawarehousejoin"."created_at",
@@ -5607,7 +5996,26 @@
AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.12
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.128
+ '''
+ SELECT "data_tools_datawarehouseexpression"."deleted",
+ "data_tools_datawarehouseexpression"."deleted_at",
+ "data_tools_datawarehouseexpression"."id",
+ "data_tools_datawarehouseexpression"."team_id",
+ "data_tools_datawarehouseexpression"."created_at",
+ "data_tools_datawarehouseexpression"."created_by_id",
+ "data_tools_datawarehouseexpression"."table_name",
+ "data_tools_datawarehouseexpression"."field_name",
+ "data_tools_datawarehouseexpression"."expression",
+ "data_tools_datawarehouseexpression"."connection_id"
+ FROM "data_tools_datawarehouseexpression"
+ WHERE ("data_tools_datawarehouseexpression"."team_id" = 99999
+ AND NOT ("data_tools_datawarehouseexpression"."deleted"
+ AND "data_tools_datawarehouseexpression"."deleted" IS NOT NULL)
+ AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.129
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -5640,26 +6048,7 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.120
- '''
- SELECT "data_tools_datawarehouseexpression"."deleted",
- "data_tools_datawarehouseexpression"."deleted_at",
- "data_tools_datawarehouseexpression"."id",
- "data_tools_datawarehouseexpression"."team_id",
- "data_tools_datawarehouseexpression"."created_at",
- "data_tools_datawarehouseexpression"."created_by_id",
- "data_tools_datawarehouseexpression"."table_name",
- "data_tools_datawarehouseexpression"."field_name",
- "data_tools_datawarehouseexpression"."expression",
- "data_tools_datawarehouseexpression"."connection_id"
- FROM "data_tools_datawarehouseexpression"
- WHERE ("data_tools_datawarehouseexpression"."team_id" = 99999
- AND NOT ("data_tools_datawarehouseexpression"."deleted"
- AND "data_tools_datawarehouseexpression"."deleted" IS NOT NULL)
- AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
- '''
-# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.121
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.13
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -5692,7 +6081,7 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.122
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.130
'''
SELECT "posthog_sessionrecording"."id",
"posthog_sessionrecording"."session_id",
@@ -5724,7 +6113,7 @@
AND "posthog_sessionrecording"."team_id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.123
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.131
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
FROM "posthog_sessionrecordingviewed"
@@ -5739,7 +6128,7 @@
'1'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.124
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.132
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id",
"posthog_user"."email" AS "user__email"
@@ -5756,7 +6145,7 @@
AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.125
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.133
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -5802,7 +6191,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.126
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.134
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -5848,7 +6237,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.127
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.135
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -5987,7 +6376,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.128
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.136
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -6042,7 +6431,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.129
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.137
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -6065,53 +6454,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.13
- '''
- SELECT "posthog_user"."id",
- "posthog_user"."password",
- "posthog_user"."last_login",
- "posthog_user"."first_name",
- "posthog_user"."last_name",
- "posthog_user"."is_staff",
- "posthog_user"."date_joined",
- "posthog_user"."uuid",
- "posthog_user"."current_organization_id",
- "posthog_user"."current_team_id",
- "posthog_user"."email",
- "posthog_user"."pending_email",
- "posthog_user"."distinct_id",
- "posthog_user"."is_email_verified",
- "posthog_user"."credentials_reviewed_at",
- "posthog_user"."requested_2fa_reset_at",
- "posthog_user"."has_seen_product_intro_for",
- "posthog_user"."strapi_id",
- "posthog_user"."is_active",
- "posthog_user"."role_at_organization",
- "posthog_user"."theme_mode",
- "posthog_user"."partial_notification_settings",
- "posthog_user"."anonymize_data",
- "posthog_user"."allow_impersonation",
- "posthog_user"."toolbar_mode",
- "posthog_user"."hedgehog_config",
- "posthog_user"."allow_sidebar_suggestions",
- "posthog_user"."shortcut_position",
- "posthog_user"."passkeys_enabled_for_2fa",
- "posthog_user"."hide_mcp_hints",
- "posthog_user"."ui_configuration",
- "posthog_user"."onboarding_skipped_at",
- "posthog_user"."onboarding_skipped_reason",
- "posthog_user"."onboarding_skipped_organization_id",
- "posthog_user"."onboarding_delegated_to_invite_id",
- "posthog_user"."onboarding_delegated_to_organization_id",
- "posthog_user"."onboarding_delegation_accepted_at",
- "posthog_user"."events_column_config",
- "posthog_user"."email_opt_in"
- FROM "posthog_user"
- WHERE ("posthog_user"."is_active"
- AND "posthog_user"."id" = 99999)
- '''
-# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.130
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.138
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -6164,7 +6507,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.131
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.139
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -6173,7 +6516,53 @@
LIMIT 1
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.132
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.14
+ '''
+ SELECT "posthog_user"."id",
+ "posthog_user"."password",
+ "posthog_user"."last_login",
+ "posthog_user"."first_name",
+ "posthog_user"."last_name",
+ "posthog_user"."is_staff",
+ "posthog_user"."date_joined",
+ "posthog_user"."uuid",
+ "posthog_user"."current_organization_id",
+ "posthog_user"."current_team_id",
+ "posthog_user"."email",
+ "posthog_user"."pending_email",
+ "posthog_user"."distinct_id",
+ "posthog_user"."is_email_verified",
+ "posthog_user"."credentials_reviewed_at",
+ "posthog_user"."requested_2fa_reset_at",
+ "posthog_user"."has_seen_product_intro_for",
+ "posthog_user"."strapi_id",
+ "posthog_user"."is_active",
+ "posthog_user"."role_at_organization",
+ "posthog_user"."theme_mode",
+ "posthog_user"."partial_notification_settings",
+ "posthog_user"."anonymize_data",
+ "posthog_user"."allow_impersonation",
+ "posthog_user"."toolbar_mode",
+ "posthog_user"."hedgehog_config",
+ "posthog_user"."allow_sidebar_suggestions",
+ "posthog_user"."shortcut_position",
+ "posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
+ "posthog_user"."ui_configuration",
+ "posthog_user"."onboarding_skipped_at",
+ "posthog_user"."onboarding_skipped_reason",
+ "posthog_user"."onboarding_skipped_organization_id",
+ "posthog_user"."onboarding_delegated_to_invite_id",
+ "posthog_user"."onboarding_delegated_to_organization_id",
+ "posthog_user"."onboarding_delegation_accepted_at",
+ "posthog_user"."events_column_config",
+ "posthog_user"."email_opt_in"
+ FROM "posthog_user"
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.140
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -6228,7 +6617,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.133
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.141
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -6292,7 +6681,20 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.134
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.142
+ '''
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.143
'''
SELECT "posthog_externaldatasource"."created_by_id",
"posthog_externaldatasource"."created_at",
@@ -6330,7 +6732,7 @@
AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.135
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.144
'''
SELECT "posthog_datawarehousejoin"."created_by_id",
"posthog_datawarehousejoin"."created_at",
@@ -6350,7 +6752,7 @@
AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.136
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.145
'''
SELECT "data_tools_datawarehouseexpression"."deleted",
"data_tools_datawarehouseexpression"."deleted_at",
@@ -6369,7 +6771,7 @@
AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.137
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.146
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -6402,7 +6804,7 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.138
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.147
'''
SELECT "posthog_sessionrecording"."id",
"posthog_sessionrecording"."session_id",
@@ -6435,7 +6837,7 @@
AND "posthog_sessionrecording"."team_id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.139
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.148
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
FROM "posthog_sessionrecordingviewed"
@@ -6451,7 +6853,25 @@
'1'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.14
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.149
+ '''
+ SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id",
+ "posthog_user"."email" AS "user__email"
+ FROM "posthog_sessionrecordingviewed"
+ INNER JOIN "posthog_user" ON ("posthog_sessionrecordingviewed"."user_id" = "posthog_user"."id")
+ WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('8',
+ '7',
+ '6',
+ '5',
+ '4',
+ '3',
+ '2',
+ '1')
+ AND "posthog_sessionrecordingviewed"."team_id" = 99999
+ AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.15
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -6497,25 +6917,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.140
- '''
- SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id",
- "posthog_user"."email" AS "user__email"
- FROM "posthog_sessionrecordingviewed"
- INNER JOIN "posthog_user" ON ("posthog_sessionrecordingviewed"."user_id" = "posthog_user"."id")
- WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('8',
- '7',
- '6',
- '5',
- '4',
- '3',
- '2',
- '1')
- AND "posthog_sessionrecordingviewed"."team_id" = 99999
- AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
- '''
-# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.141
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.150
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -6561,7 +6963,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.142
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.151
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -6607,7 +7009,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.143
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.152
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -6746,7 +7148,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.144
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.153
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -6801,7 +7203,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.145
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.154
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -6824,7 +7226,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.146
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.155
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -6877,7 +7279,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.147
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.156
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -6886,7 +7288,7 @@
LIMIT 1
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.148
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.157
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -6941,7 +7343,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.149
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.158
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -7005,7 +7407,20 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.15
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.159
+ '''
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.16
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -7144,7 +7559,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.150
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.160
'''
SELECT "posthog_externaldatasource"."created_by_id",
"posthog_externaldatasource"."created_at",
@@ -7182,7 +7597,7 @@
AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.151
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.161
'''
SELECT "posthog_datawarehousejoin"."created_by_id",
"posthog_datawarehousejoin"."created_at",
@@ -7202,7 +7617,7 @@
AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.152
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.162
'''
SELECT "data_tools_datawarehouseexpression"."deleted",
"data_tools_datawarehouseexpression"."deleted_at",
@@ -7221,7 +7636,7 @@
AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.153
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.163
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -7254,7 +7669,7 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.154
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.164
'''
SELECT "posthog_sessionrecording"."id",
"posthog_sessionrecording"."session_id",
@@ -7288,7 +7703,7 @@
AND "posthog_sessionrecording"."team_id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.155
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.165
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
FROM "posthog_sessionrecordingviewed"
@@ -7305,7 +7720,7 @@
'1'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.156
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.166
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id",
"posthog_user"."email" AS "user__email"
@@ -7324,7 +7739,7 @@
AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.157
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.167
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -7370,7 +7785,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.158
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.168
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -7416,7 +7831,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.159
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.169
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -7555,7 +7970,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.16
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.17
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -7610,7 +8025,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.160
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.170
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -7665,7 +8080,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.161
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.171
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -7688,7 +8103,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.162
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.172
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -7741,7 +8156,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.163
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.173
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -7750,7 +8165,7 @@
LIMIT 1
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.164
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.174
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -7805,7 +8220,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.165
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.175
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -7869,7 +8284,20 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.166
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.176
+ '''
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.177
'''
SELECT "posthog_externaldatasource"."created_by_id",
"posthog_externaldatasource"."created_at",
@@ -7907,7 +8335,7 @@
AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.167
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.178
'''
SELECT "posthog_datawarehousejoin"."created_by_id",
"posthog_datawarehousejoin"."created_at",
@@ -7927,7 +8355,7 @@
AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.168
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.179
'''
SELECT "data_tools_datawarehouseexpression"."deleted",
"data_tools_datawarehouseexpression"."deleted_at",
@@ -7946,7 +8374,30 @@
AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.169
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.18
+ '''
+ SELECT "ee_accesscontrol"."id",
+ "ee_accesscontrol"."team_id",
+ "ee_accesscontrol"."access_level",
+ "ee_accesscontrol"."resource",
+ "ee_accesscontrol"."resource_id",
+ "ee_accesscontrol"."organization_member_id",
+ "ee_accesscontrol"."role_id",
+ "ee_accesscontrol"."created_by_id",
+ "ee_accesscontrol"."created_at",
+ "ee_accesscontrol"."updated_at"
+ FROM "ee_accesscontrol"
+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")
+ WHERE (("ee_accesscontrol"."organization_member_id" IS NULL
+ AND "ee_accesscontrol"."role_id" IS NULL
+ AND "ee_accesscontrol"."team_id" = 99999)
+ OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_organizationmembership"."user_id" = 99999
+ AND "ee_accesscontrol"."role_id" IS NULL
+ AND "ee_accesscontrol"."team_id" = 99999))
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.180
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -7979,30 +8430,7 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.17
- '''
- SELECT "ee_accesscontrol"."id",
- "ee_accesscontrol"."team_id",
- "ee_accesscontrol"."access_level",
- "ee_accesscontrol"."resource",
- "ee_accesscontrol"."resource_id",
- "ee_accesscontrol"."organization_member_id",
- "ee_accesscontrol"."role_id",
- "ee_accesscontrol"."created_by_id",
- "ee_accesscontrol"."created_at",
- "ee_accesscontrol"."updated_at"
- FROM "ee_accesscontrol"
- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")
- WHERE (("ee_accesscontrol"."organization_member_id" IS NULL
- AND "ee_accesscontrol"."role_id" IS NULL
- AND "ee_accesscontrol"."team_id" = 99999)
- OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_organizationmembership"."user_id" = 99999
- AND "ee_accesscontrol"."role_id" IS NULL
- AND "ee_accesscontrol"."team_id" = 99999))
- '''
-# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.170
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.181
'''
SELECT "posthog_sessionrecording"."id",
"posthog_sessionrecording"."session_id",
@@ -8037,7 +8465,7 @@
AND "posthog_sessionrecording"."team_id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.171
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.182
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
FROM "posthog_sessionrecordingviewed"
@@ -8055,7 +8483,7 @@
'1'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.172
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.183
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id",
"posthog_user"."email" AS "user__email"
@@ -8075,7 +8503,7 @@
AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.18
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.19
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -8128,15 +8556,6 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.19
- '''
- SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
- FROM "feature_flags_organizationfeatureflagsconfig"
- WHERE "feature_flags_organizationfeatureflagsconfig"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- ORDER BY "feature_flags_organizationfeatureflagsconfig"."organization_id" ASC
- LIMIT 1
- '''
-# ---
# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.2
'''
SELECT "posthog_team"."id",
@@ -8277,6 +8696,15 @@
'''
# ---
# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.20
+ '''
+ SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
+ FROM "feature_flags_organizationfeatureflagsconfig"
+ WHERE "feature_flags_organizationfeatureflagsconfig"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ ORDER BY "feature_flags_organizationfeatureflagsconfig"."organization_id" ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.21
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -8331,7 +8759,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.21
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.22
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -8395,7 +8823,20 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.22
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.23
+ '''
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.24
'''
SELECT "posthog_externaldatasource"."created_by_id",
"posthog_externaldatasource"."created_at",
@@ -8433,7 +8874,7 @@
AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.23
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.25
'''
SELECT "posthog_datawarehousejoin"."created_by_id",
"posthog_datawarehousejoin"."created_at",
@@ -8453,7 +8894,7 @@
AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.24
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.26
'''
SELECT "data_tools_datawarehouseexpression"."deleted",
"data_tools_datawarehouseexpression"."deleted_at",
@@ -8472,7 +8913,7 @@
AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.25
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.27
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -8505,7 +8946,7 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.26
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.28
'''
SELECT "posthog_sessionrecording"."id",
"posthog_sessionrecording"."session_id",
@@ -8531,7 +8972,7 @@
AND "posthog_sessionrecording"."team_id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.27
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.29
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
FROM "posthog_sessionrecordingviewed"
@@ -8540,7 +8981,62 @@
AND "posthog_sessionrecordingviewed"."session_id" IN ('1'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.28
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.3
+ '''
+ SELECT "posthog_organizationmembership"."id",
+ "posthog_organizationmembership"."organization_id",
+ "posthog_organizationmembership"."user_id",
+ "posthog_organizationmembership"."level",
+ "posthog_organizationmembership"."joined_at",
+ "posthog_organizationmembership"."updated_at",
+ "posthog_organizationmembership"."invited_by_id",
+ "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_organizationmembership"
+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_organizationmembership"."user_id" = 99999)
+ LIMIT 21
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.30
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id",
"posthog_user"."email" AS "user__email"
@@ -8551,7 +9047,7 @@
AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.29
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.31
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -8597,16 +9093,9 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.3
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.32
'''
- SELECT "posthog_organizationmembership"."id",
- "posthog_organizationmembership"."organization_id",
- "posthog_organizationmembership"."user_id",
- "posthog_organizationmembership"."level",
- "posthog_organizationmembership"."joined_at",
- "posthog_organizationmembership"."updated_at",
- "posthog_organizationmembership"."invited_by_id",
- "posthog_organization"."id",
+ SELECT "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -8645,60 +9134,12 @@
"posthog_organization"."personalization",
"posthog_organization"."domain_whitelist",
"posthog_organization"."is_platform"
- FROM "posthog_organizationmembership"
- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_organizationmembership"."user_id" = 99999)
+ FROM "posthog_organization"
+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.30
- '''
- SELECT "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
- LIMIT 21
- '''
-# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.31
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.33
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -8837,7 +9278,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.32
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.34
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -8892,7 +9333,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.33
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.35
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -8915,7 +9356,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.34
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.36
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -8968,7 +9409,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.35
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.37
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -8977,7 +9418,7 @@
LIMIT 1
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.36
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.38
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -9032,7 +9473,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.37
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.39
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -9096,7 +9537,43 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.38
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.4
+ '''
+ SELECT "ee_accesscontrol"."id",
+ "ee_accesscontrol"."team_id",
+ "ee_accesscontrol"."access_level",
+ "ee_accesscontrol"."resource",
+ "ee_accesscontrol"."resource_id",
+ "ee_accesscontrol"."organization_member_id",
+ "ee_accesscontrol"."role_id",
+ "ee_accesscontrol"."created_by_id",
+ "ee_accesscontrol"."created_at",
+ "ee_accesscontrol"."updated_at"
+ FROM "ee_accesscontrol"
+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")
+ WHERE (("ee_accesscontrol"."organization_member_id" IS NULL
+ AND "ee_accesscontrol"."role_id" IS NULL
+ AND "ee_accesscontrol"."team_id" = 99999)
+ OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_organizationmembership"."user_id" = 99999
+ AND "ee_accesscontrol"."role_id" IS NULL
+ AND "ee_accesscontrol"."team_id" = 99999))
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.40
+ '''
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.41
'''
SELECT "posthog_externaldatasource"."created_by_id",
"posthog_externaldatasource"."created_at",
@@ -9134,7 +9611,7 @@
AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.39
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.42
'''
SELECT "posthog_datawarehousejoin"."created_by_id",
"posthog_datawarehousejoin"."created_at",
@@ -9154,30 +9631,7 @@
AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.4
- '''
- SELECT "ee_accesscontrol"."id",
- "ee_accesscontrol"."team_id",
- "ee_accesscontrol"."access_level",
- "ee_accesscontrol"."resource",
- "ee_accesscontrol"."resource_id",
- "ee_accesscontrol"."organization_member_id",
- "ee_accesscontrol"."role_id",
- "ee_accesscontrol"."created_by_id",
- "ee_accesscontrol"."created_at",
- "ee_accesscontrol"."updated_at"
- FROM "ee_accesscontrol"
- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")
- WHERE (("ee_accesscontrol"."organization_member_id" IS NULL
- AND "ee_accesscontrol"."role_id" IS NULL
- AND "ee_accesscontrol"."team_id" = 99999)
- OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_organizationmembership"."user_id" = 99999
- AND "ee_accesscontrol"."role_id" IS NULL
- AND "ee_accesscontrol"."team_id" = 99999))
- '''
-# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.40
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.43
'''
SELECT "data_tools_datawarehouseexpression"."deleted",
"data_tools_datawarehouseexpression"."deleted_at",
@@ -9196,7 +9650,7 @@
AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.41
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.44
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -9229,7 +9683,7 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.42
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.45
'''
SELECT "posthog_sessionrecording"."id",
"posthog_sessionrecording"."session_id",
@@ -9256,7 +9710,7 @@
AND "posthog_sessionrecording"."team_id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.43
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.46
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
FROM "posthog_sessionrecordingviewed"
@@ -9266,7 +9720,7 @@
'1'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.44
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.47
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id",
"posthog_user"."email" AS "user__email"
@@ -9278,7 +9732,7 @@
AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.45
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.48
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -9324,7 +9778,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.46
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.49
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -9370,7 +9824,60 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.47
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.5
+ '''
+ SELECT "posthog_organizationmembership"."id",
+ "posthog_organizationmembership"."organization_id",
+ "posthog_organizationmembership"."user_id",
+ "posthog_organizationmembership"."level",
+ "posthog_organizationmembership"."joined_at",
+ "posthog_organizationmembership"."updated_at",
+ "posthog_organizationmembership"."invited_by_id",
+ "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_organizationmembership"
+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
+ WHERE "posthog_organizationmembership"."user_id" = 99999
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.50
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -9509,7 +10016,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.48
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.51
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -9564,7 +10071,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.49
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.52
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -9587,60 +10094,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.5
- '''
- SELECT "posthog_organizationmembership"."id",
- "posthog_organizationmembership"."organization_id",
- "posthog_organizationmembership"."user_id",
- "posthog_organizationmembership"."level",
- "posthog_organizationmembership"."joined_at",
- "posthog_organizationmembership"."updated_at",
- "posthog_organizationmembership"."invited_by_id",
- "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organizationmembership"
- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
- WHERE "posthog_organizationmembership"."user_id" = 99999
- '''
-# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.50
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.53
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -9693,7 +10147,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.51
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.54
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -9702,7 +10156,7 @@
LIMIT 1
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.52
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.55
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -9757,7 +10211,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.53
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.56
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -9821,7 +10275,20 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.54
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.57
+ '''
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.58
'''
SELECT "posthog_externaldatasource"."created_by_id",
"posthog_externaldatasource"."created_at",
@@ -9859,7 +10326,7 @@
AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.55
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.59
'''
SELECT "posthog_datawarehousejoin"."created_by_id",
"posthog_datawarehousejoin"."created_at",
@@ -9879,7 +10346,16 @@
AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.56
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.6
+ '''
+ SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
+ FROM "feature_flags_organizationfeatureflagsconfig"
+ WHERE "feature_flags_organizationfeatureflagsconfig"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ ORDER BY "feature_flags_organizationfeatureflagsconfig"."organization_id" ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.60
'''
SELECT "data_tools_datawarehouseexpression"."deleted",
"data_tools_datawarehouseexpression"."deleted_at",
@@ -9898,7 +10374,7 @@
AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.57
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.61
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -9931,7 +10407,7 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.58
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.62
'''
SELECT "posthog_sessionrecording"."id",
"posthog_sessionrecording"."session_id",
@@ -9959,7 +10435,7 @@
AND "posthog_sessionrecording"."team_id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.59
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.63
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
FROM "posthog_sessionrecordingviewed"
@@ -9970,16 +10446,7 @@
'1'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.6
- '''
- SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
- FROM "feature_flags_organizationfeatureflagsconfig"
- WHERE "feature_flags_organizationfeatureflagsconfig"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- ORDER BY "feature_flags_organizationfeatureflagsconfig"."organization_id" ASC
- LIMIT 1
- '''
-# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.60
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.64
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id",
"posthog_user"."email" AS "user__email"
@@ -9992,7 +10459,7 @@
AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.61
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.65
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -10038,7 +10505,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.62
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.66
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -10084,7 +10551,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.63
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.67
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -10223,7 +10690,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.64
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.68
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -10278,7 +10745,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.65
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.69
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -10301,7 +10768,62 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.66
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.7
+ '''
+ SELECT "posthog_organizationmembership"."id",
+ "posthog_organizationmembership"."organization_id",
+ "posthog_organizationmembership"."user_id",
+ "posthog_organizationmembership"."level",
+ "posthog_organizationmembership"."joined_at",
+ "posthog_organizationmembership"."updated_at",
+ "posthog_organizationmembership"."invited_by_id",
+ "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_organizationmembership"
+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_organizationmembership"."user_id" = 99999)
+ LIMIT 21
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.70
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -10354,7 +10876,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.67
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.71
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -10363,7 +10885,7 @@
LIMIT 1
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.68
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.72
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -10418,7 +10940,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.69
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.73
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -10482,62 +11004,20 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.7
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.74
'''
- SELECT "posthog_organizationmembership"."id",
- "posthog_organizationmembership"."organization_id",
- "posthog_organizationmembership"."user_id",
- "posthog_organizationmembership"."level",
- "posthog_organizationmembership"."joined_at",
- "posthog_organizationmembership"."updated_at",
- "posthog_organizationmembership"."invited_by_id",
- "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organizationmembership"
- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_organizationmembership"."user_id" = 99999)
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.70
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.75
'''
SELECT "posthog_externaldatasource"."created_by_id",
"posthog_externaldatasource"."created_at",
@@ -10575,7 +11055,7 @@
AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.71
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.76
'''
SELECT "posthog_datawarehousejoin"."created_by_id",
"posthog_datawarehousejoin"."created_at",
@@ -10595,7 +11075,7 @@
AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.72
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.77
'''
SELECT "data_tools_datawarehouseexpression"."deleted",
"data_tools_datawarehouseexpression"."deleted_at",
@@ -10614,7 +11094,7 @@
AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.73
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.78
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -10647,7 +11127,7 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.74
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.79
'''
SELECT "posthog_sessionrecording"."id",
"posthog_sessionrecording"."session_id",
@@ -10676,7 +11156,71 @@
AND "posthog_sessionrecording"."team_id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.75
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.8
+ '''
+ SELECT "posthog_datawarehousesavedquery"."created_by_id",
+ "posthog_datawarehousesavedquery"."created_at",
+ "posthog_datawarehousesavedquery"."updated_at",
+ "posthog_datawarehousesavedquery"."deleted",
+ "posthog_datawarehousesavedquery"."deleted_at",
+ "posthog_datawarehousesavedquery"."id",
+ "posthog_datawarehousesavedquery"."name",
+ "posthog_datawarehousesavedquery"."team_id",
+ "posthog_datawarehousesavedquery"."latest_error",
+ "posthog_datawarehousesavedquery"."columns",
+ "posthog_datawarehousesavedquery"."column_order",
+ "posthog_datawarehousesavedquery"."external_tables",
+ "posthog_datawarehousesavedquery"."query",
+ "posthog_datawarehousesavedquery"."query_revision",
+ "posthog_datawarehousesavedquery"."status",
+ "posthog_datawarehousesavedquery"."last_run_at",
+ "posthog_datawarehousesavedquery"."sync_frequency_interval",
+ "posthog_datawarehousesavedquery"."table_id",
+ "posthog_datawarehousesavedquery"."is_materialized",
+ "posthog_datawarehousesavedquery"."deleted_name",
+ "posthog_datawarehousesavedquery"."managed_viewset_id",
+ "posthog_datawarehousesavedquery"."folder_id",
+ "posthog_datawarehousesavedquery"."origin",
+ "posthog_datawarehousesavedquery"."is_test",
+ "posthog_datawarehousesavedquery"."expires_at",
+ "posthog_datawarehousesavedquery"."semantic_enrichment_hash",
+ "posthog_datawarehousesavedquery"."incremental_config",
+ "posthog_datawarehousesavedquery"."incremental_state",
+ "posthog_datawarehousetable"."created_by_id",
+ "posthog_datawarehousetable"."created_at",
+ "posthog_datawarehousetable"."updated_at",
+ "posthog_datawarehousetable"."deleted",
+ "posthog_datawarehousetable"."deleted_at",
+ "posthog_datawarehousetable"."id",
+ "posthog_datawarehousetable"."name",
+ "posthog_datawarehousetable"."format",
+ "posthog_datawarehousetable"."team_id",
+ "posthog_datawarehousetable"."url_pattern",
+ "posthog_datawarehousetable"."queryable_folder",
+ "posthog_datawarehousetable"."credential_id",
+ "posthog_datawarehousetable"."external_data_source_id",
+ "posthog_datawarehousetable"."created_via",
+ "posthog_datawarehousetable"."columns",
+ "posthog_datawarehousetable"."column_order",
+ "posthog_datawarehousetable"."options",
+ "posthog_datawarehousetable"."row_count",
+ "posthog_datawarehousetable"."size_in_s3_mib",
+ "posthog_datawarehousemanagedviewset"."created_by_id",
+ "posthog_datawarehousemanagedviewset"."created_at",
+ "posthog_datawarehousemanagedviewset"."updated_at",
+ "posthog_datawarehousemanagedviewset"."id",
+ "posthog_datawarehousemanagedviewset"."team_id",
+ "posthog_datawarehousemanagedviewset"."kind"
+ FROM "posthog_datawarehousesavedquery"
+ LEFT OUTER JOIN "posthog_datawarehousetable" ON ("posthog_datawarehousesavedquery"."table_id" = "posthog_datawarehousetable"."id")
+ LEFT OUTER JOIN "posthog_datawarehousemanagedviewset" ON ("posthog_datawarehousesavedquery"."managed_viewset_id" = "posthog_datawarehousemanagedviewset"."id")
+ WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999
+ AND NOT ("posthog_datawarehousesavedquery"."deleted"
+ AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))
+ ORDER BY "posthog_datawarehousesavedquery"."name" ASC
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.80
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
FROM "posthog_sessionrecordingviewed"
@@ -10688,7 +11232,7 @@
'1'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.76
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.81
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id",
"posthog_user"."email" AS "user__email"
@@ -10702,7 +11246,7 @@
AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.77
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.82
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -10748,7 +11292,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.78
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.83
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -10794,7 +11338,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.79
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.84
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -10933,71 +11477,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.8
- '''
- SELECT "posthog_datawarehousesavedquery"."created_by_id",
- "posthog_datawarehousesavedquery"."created_at",
- "posthog_datawarehousesavedquery"."updated_at",
- "posthog_datawarehousesavedquery"."deleted",
- "posthog_datawarehousesavedquery"."deleted_at",
- "posthog_datawarehousesavedquery"."id",
- "posthog_datawarehousesavedquery"."name",
- "posthog_datawarehousesavedquery"."team_id",
- "posthog_datawarehousesavedquery"."latest_error",
- "posthog_datawarehousesavedquery"."columns",
- "posthog_datawarehousesavedquery"."column_order",
- "posthog_datawarehousesavedquery"."external_tables",
- "posthog_datawarehousesavedquery"."query",
- "posthog_datawarehousesavedquery"."query_revision",
- "posthog_datawarehousesavedquery"."status",
- "posthog_datawarehousesavedquery"."last_run_at",
- "posthog_datawarehousesavedquery"."sync_frequency_interval",
- "posthog_datawarehousesavedquery"."table_id",
- "posthog_datawarehousesavedquery"."is_materialized",
- "posthog_datawarehousesavedquery"."deleted_name",
- "posthog_datawarehousesavedquery"."managed_viewset_id",
- "posthog_datawarehousesavedquery"."folder_id",
- "posthog_datawarehousesavedquery"."origin",
- "posthog_datawarehousesavedquery"."is_test",
- "posthog_datawarehousesavedquery"."expires_at",
- "posthog_datawarehousesavedquery"."semantic_enrichment_hash",
- "posthog_datawarehousesavedquery"."incremental_config",
- "posthog_datawarehousesavedquery"."incremental_state",
- "posthog_datawarehousetable"."created_by_id",
- "posthog_datawarehousetable"."created_at",
- "posthog_datawarehousetable"."updated_at",
- "posthog_datawarehousetable"."deleted",
- "posthog_datawarehousetable"."deleted_at",
- "posthog_datawarehousetable"."id",
- "posthog_datawarehousetable"."name",
- "posthog_datawarehousetable"."format",
- "posthog_datawarehousetable"."team_id",
- "posthog_datawarehousetable"."url_pattern",
- "posthog_datawarehousetable"."queryable_folder",
- "posthog_datawarehousetable"."credential_id",
- "posthog_datawarehousetable"."external_data_source_id",
- "posthog_datawarehousetable"."created_via",
- "posthog_datawarehousetable"."columns",
- "posthog_datawarehousetable"."column_order",
- "posthog_datawarehousetable"."options",
- "posthog_datawarehousetable"."row_count",
- "posthog_datawarehousetable"."size_in_s3_mib",
- "posthog_datawarehousemanagedviewset"."created_by_id",
- "posthog_datawarehousemanagedviewset"."created_at",
- "posthog_datawarehousemanagedviewset"."updated_at",
- "posthog_datawarehousemanagedviewset"."id",
- "posthog_datawarehousemanagedviewset"."team_id",
- "posthog_datawarehousemanagedviewset"."kind"
- FROM "posthog_datawarehousesavedquery"
- LEFT OUTER JOIN "posthog_datawarehousetable" ON ("posthog_datawarehousesavedquery"."table_id" = "posthog_datawarehousetable"."id")
- LEFT OUTER JOIN "posthog_datawarehousemanagedviewset" ON ("posthog_datawarehousesavedquery"."managed_viewset_id" = "posthog_datawarehousemanagedviewset"."id")
- WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999
- AND NOT ("posthog_datawarehousesavedquery"."deleted"
- AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))
- ORDER BY "posthog_datawarehousesavedquery"."name" ASC
- '''
-# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.80
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.85
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -11052,7 +11532,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.81
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.86
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -11075,7 +11555,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.82
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.87
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -11128,7 +11608,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.83
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.88
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -11137,7 +11617,7 @@
LIMIT 1
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.84
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.89
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -11192,7 +11672,20 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.85
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.9
+ '''
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.90
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -11256,7 +11749,20 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.86
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.91
+ '''
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.92
'''
SELECT "posthog_externaldatasource"."created_by_id",
"posthog_externaldatasource"."created_at",
@@ -11294,7 +11800,7 @@
AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.87
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.93
'''
SELECT "posthog_datawarehousejoin"."created_by_id",
"posthog_datawarehousejoin"."created_at",
@@ -11314,7 +11820,7 @@
AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.88
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.94
'''
SELECT "data_tools_datawarehouseexpression"."deleted",
"data_tools_datawarehouseexpression"."deleted_at",
@@ -11333,7 +11839,7 @@
AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.89
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.95
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -11366,45 +11872,7 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.9
- '''
- SELECT "posthog_externaldatasource"."created_by_id",
- "posthog_externaldatasource"."created_at",
- "posthog_externaldatasource"."updated_at",
- "posthog_externaldatasource"."deleted",
- "posthog_externaldatasource"."deleted_at",
- "posthog_externaldatasource"."id",
- "posthog_externaldatasource"."source_id",
- "posthog_externaldatasource"."connection_id",
- "posthog_externaldatasource"."destination_id",
- "posthog_externaldatasource"."team_id",
- "posthog_externaldatasource"."sync_frequency",
- "posthog_externaldatasource"."status",
- "posthog_externaldatasource"."source_type",
- "posthog_externaldatasource"."api_version",
- "posthog_externaldatasource"."job_inputs",
- "posthog_externaldatasource"."connection_metadata",
- "posthog_externaldatasource"."are_tables_created",
- "posthog_externaldatasource"."prefix",
- "posthog_externaldatasource"."description",
- "posthog_externaldatasource"."created_via",
- "posthog_externaldatasource"."access_method",
- "posthog_externaldatasource"."direct_query_enabled",
- "posthog_externaldatasource"."auto_sync_new_schemas",
- "posthog_externaldatasource"."auto_sync_schema_patterns",
- "posthog_externaldatasource"."revenue_analytics_enabled",
- "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",
- "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",
- "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"
- FROM "posthog_externaldatasource"
- LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")
- WHERE ("posthog_externaldatasource"."team_id" = 99999
- AND NOT ("posthog_externaldatasource"."deleted"
- AND "posthog_externaldatasource"."deleted" IS NOT NULL)
- AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
- '''
-# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.90
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.96
'''
SELECT "posthog_sessionrecording"."id",
"posthog_sessionrecording"."session_id",
@@ -11434,7 +11902,7 @@
AND "posthog_sessionrecording"."team_id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.91
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.97
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
FROM "posthog_sessionrecordingviewed"
@@ -11447,7 +11915,7 @@
'1'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.92
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.98
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id",
"posthog_user"."email" AS "user__email"
@@ -11462,7 +11930,7 @@
AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.93
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.99
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -11508,328 +11976,3 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.94
- '''
- SELECT "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
- LIMIT 21
- '''
-# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.95
- '''
- SELECT "posthog_team"."id",
- "posthog_team"."uuid",
- "posthog_team"."organization_id",
- "posthog_team"."parent_team_id",
- "posthog_team"."project_id",
- "posthog_team"."api_token",
- "posthog_team"."app_urls",
- "posthog_team"."name",
- "posthog_team"."slack_incoming_webhook",
- "posthog_team"."created_at",
- "posthog_team"."updated_at",
- "posthog_team"."anonymize_ips",
- "posthog_team"."completed_snippet_onboarding",
- "posthog_team"."has_completed_onboarding_for",
- "posthog_team"."onboarding_tasks",
- "posthog_team"."ingested_event",
- "posthog_team"."ingested_production_event",
- "posthog_team"."ingested_production_event_last_checked_at",
- "posthog_team"."person_processing_opt_out",
- "posthog_team"."secret_api_token",
- "posthog_team"."secret_api_token_backup",
- "posthog_team"."session_recording_opt_in",
- "posthog_team"."session_recording_sample_rate",
- "posthog_team"."session_recording_minimum_duration_milliseconds",
- "posthog_team"."session_recording_linked_flag",
- "posthog_team"."session_recording_network_payload_capture_config",
- "posthog_team"."session_recording_masking_config",
- "posthog_team"."session_recording_url_trigger_config",
- "posthog_team"."session_recording_url_blocklist_config",
- "posthog_team"."session_recording_event_trigger_config",
- "posthog_team"."session_recording_trigger_match_type_config",
- "posthog_team"."session_recording_trigger_groups",
- "posthog_team"."session_replay_config",
- "posthog_team"."session_recording_retention_period",
- "posthog_team"."event_retention_months",
- "posthog_team"."conversations_enabled",
- "posthog_team"."conversations_settings",
- "posthog_team"."proactive_tasks_enabled",
- "posthog_team"."survey_config",
- "posthog_team"."surveys_opt_in",
- "posthog_team"."product_tours_opt_in",
- "posthog_team"."capture_console_log_opt_in",
- "posthog_team"."capture_performance_opt_in",
- "posthog_team"."capture_dead_clicks",
- "posthog_team"."autocapture_opt_out",
- "posthog_team"."autocapture_web_vitals_opt_in",
- "posthog_team"."autocapture_web_vitals_allowed_metrics",
- "posthog_team"."autocapture_exceptions_opt_in",
- "posthog_team"."autocapture_exceptions_errors_to_ignore",
- "posthog_team"."logs_settings",
- "posthog_team"."llm_gateway_enabled_at",
- "posthog_team"."llm_gateway_revoked_at",
- "posthog_team"."llm_gateway_overspend_allowance_usd",
- "posthog_team"."heatmaps_opt_in",
- "posthog_team"."receive_org_level_activity_logs",
- "posthog_team"."web_analytics_pre_aggregated_tables_enabled",
- "posthog_team"."web_analytics_pre_aggregated_tables_version",
- "posthog_team"."flags_persistence_default",
- "posthog_team"."feature_flag_confirmation_enabled",
- "posthog_team"."feature_flag_confirmation_message",
- "posthog_team"."default_evaluation_environments_enabled",
- "posthog_team"."require_evaluation_environment_tags",
- "posthog_team"."default_evaluation_contexts_enabled",
- "posthog_team"."require_evaluation_contexts",
- "posthog_team"."session_recording_version",
- "posthog_team"."signup_token",
- "posthog_team"."is_demo",
- "posthog_team"."access_control",
- "posthog_team"."week_start_day",
- "posthog_team"."inject_web_apps",
- "posthog_team"."test_account_filters",
- "posthog_team"."test_account_filters_default_checked",
- "posthog_team"."path_cleaning_filters",
- "posthog_team"."timezone",
- "posthog_team"."data_attributes",
- "posthog_team"."person_display_name_properties",
- "posthog_team"."live_events_columns",
- "posthog_team"."recording_domains",
- "posthog_team"."human_friendly_comparison_periods",
- "posthog_team"."cookieless_server_hash_mode",
- "posthog_team"."primary_dashboard_id",
- "posthog_team"."default_data_theme",
- "posthog_team"."extra_settings",
- "posthog_team"."modifiers",
- "posthog_team"."correlation_config",
- "posthog_team"."session_recording_retention_period_days",
- "posthog_team"."external_data_workspace_id",
- "posthog_team"."external_data_workspace_last_synced_at",
- "posthog_team"."api_query_rate_limit",
- "posthog_team"."drop_events_older_than",
- "posthog_team"."base_currency",
- "posthog_team"."business_model",
- "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_team"
- INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
- WHERE "posthog_team"."id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.96
- '''
- SELECT "posthog_organizationmembership"."id",
- "posthog_organizationmembership"."organization_id",
- "posthog_organizationmembership"."user_id",
- "posthog_organizationmembership"."level",
- "posthog_organizationmembership"."joined_at",
- "posthog_organizationmembership"."updated_at",
- "posthog_organizationmembership"."invited_by_id",
- "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organizationmembership"
- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_organizationmembership"."user_id" = 99999)
- LIMIT 21
- '''
-# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.97
- '''
- SELECT "ee_accesscontrol"."id",
- "ee_accesscontrol"."team_id",
- "ee_accesscontrol"."access_level",
- "ee_accesscontrol"."resource",
- "ee_accesscontrol"."resource_id",
- "ee_accesscontrol"."organization_member_id",
- "ee_accesscontrol"."role_id",
- "ee_accesscontrol"."created_by_id",
- "ee_accesscontrol"."created_at",
- "ee_accesscontrol"."updated_at"
- FROM "ee_accesscontrol"
- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")
- WHERE (("ee_accesscontrol"."organization_member_id" IS NULL
- AND "ee_accesscontrol"."role_id" IS NULL
- AND "ee_accesscontrol"."team_id" = 99999)
- OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_organizationmembership"."user_id" = 99999
- AND "ee_accesscontrol"."role_id" IS NULL
- AND "ee_accesscontrol"."team_id" = 99999))
- '''
-# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.98
- '''
- SELECT "posthog_organizationmembership"."id",
- "posthog_organizationmembership"."organization_id",
- "posthog_organizationmembership"."user_id",
- "posthog_organizationmembership"."level",
- "posthog_organizationmembership"."joined_at",
- "posthog_organizationmembership"."updated_at",
- "posthog_organizationmembership"."invited_by_id",
- "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organizationmembership"
- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
- WHERE "posthog_organizationmembership"."user_id" = 99999
- '''
-# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.99
- '''
- SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
- FROM "feature_flags_organizationfeatureflagsconfig"
- WHERE "feature_flags_organizationfeatureflagsconfig"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- ORDER BY "feature_flags_organizationfeatureflagsconfig"."organization_id" ASC
- LIMIT 1
- '''
-# ---
diff --git a/posthog/test/test_middleware.py b/posthog/test/test_middleware.py
index c37f74efa290..0071829d19e5 100644
--- a/posthog/test/test_middleware.py
+++ b/posthog/test/test_middleware.py
@@ -431,9 +431,22 @@ class TestAutoProjectMiddleware(APIBaseTest):
# indexed lookup on posthog_taggeditem per page load, and the organization it
# serializes comes off the user's current_organization foreign key, which carries
# no signed-BAA annotation, so the AI training lock costs one more indexed lookup.
- cls.base_app_num_queries = 56
+ # +5: the app context also serializes the team's five extension configs, and each
+ # request reads them on its own Team instance, one primary-key lookup each.
+ cls.base_app_num_queries = 61
# Create another team that the user does have access to
cls.second_team = create_team(organization=cls.organization, name="Second Life")
+ # A page load creates any missing config row, which adds an insert per config to its first
+ # count. Create the rows here so that each count covers only the lookups.
+ for team in (cls.team, cls.second_team):
+ for config in (
+ "revenue_analytics_config",
+ "marketing_analytics_config",
+ "customer_analytics_config",
+ "workflows_config",
+ "feature_flag_policy_config",
+ ):
+ getattr(team, config)
# some teams have non-standard API tokens
cls.third_team = create_team(organization=cls.organization, name="Third Life")
diff --git a/products/customer_analytics/backend/test/test_email_account_matching.py b/products/customer_analytics/backend/test/test_email_account_matching.py
index debcf7c1d3cd..cbf2c8bd91d0 100644
--- a/products/customer_analytics/backend/test/test_email_account_matching.py
+++ b/products/customer_analytics/backend/test/test_email_account_matching.py
@@ -4,7 +4,6 @@ from unittest.mock import MagicMock, patch
from parameterized import parameterized
from posthog.models.organization import Organization, OrganizationMembership
-from posthog.models.team.extensions import get_or_create_team_extension
from posthog.models.user import User
from products.conversations.backend.facade.types import EmailThreadForAccountMatching
@@ -20,16 +19,10 @@ from products.customer_analytics.backend.logic.email_account_matching import (
MatchedAccount,
match_accounts_for_gmail_emails,
)
-from products.customer_analytics.backend.models import Account, TeamCustomerAnalyticsConfig
+from products.customer_analytics.backend.models import Account
class TestEmailAccountMatching(BaseTest):
- def setUp(self) -> None:
- super().setUp()
- # Team.customer_analytics_config caches the config object process-wide. Without a row here, a later test
- # gets the object an earlier test created and rolled back, and save(update_fields=...) updates no rows.
- get_or_create_team_extension(self.team, TeamCustomerAnalyticsConfig)
-
def _create_account(
self,
*,
diff --git a/products/dashboards/backend/api/dashboard.py b/products/dashboards/backend/api/dashboard.py
index fdf474e8c35f..6c266ca36bb5 100644
--- a/products/dashboards/backend/api/dashboard.py
+++ b/products/dashboards/backend/api/dashboard.py
@@ -80,6 +80,7 @@ from posthog.helpers.trigram_search import (
drop_similar_when_exact_exists,
)
from posthog.hogql_queries.apply_dashboard_filters import normalize_dashboard_filters_properties
+from posthog.hogql_queries.query_runner import team_configs_for_cache_key
from posthog.hogql_queries.refresh_policy import ComputeSurface
from posthog.models.file_system.constants import DEFAULT_SURFACE, surface_q
from posthog.models.file_system.file_system import FileSystem, create_or_update_file, delete_file, join_path, split_path
@@ -3328,6 +3329,11 @@ class DashboardsViewSet(
),
)
+ # Each tile's query cache key reads the team's analytics configs. Read them here with the other
+ # database reads, so that the tiles reuse the configs this Team instance loaded and the stream
+ # below runs no queries for them.
+ team_configs_for_cache_key(self.team)
+
# Async generator that handles progressive tile serialization and streaming
async def async_tile_stream_generator() -> AsyncGenerator[bytes]:
renderer = SafeJSONRenderer()
diff --git a/products/data_warehouse/backend/tests/api/test_view_link.py b/products/data_warehouse/backend/tests/api/test_view_link.py
index f886dfd9a1c0..d696ae5ee1a0 100644
--- a/products/data_warehouse/backend/tests/api/test_view_link.py
+++ b/products/data_warehouse/backend/tests/api/test_view_link.py
@@ -11,6 +11,9 @@ from posthog.schema import HogQLQueryResponse
from posthog.hogql.database.database import Database
from posthog.hogql.query import HogQLQueryExecutor
+from posthog.models.team.extensions import get_or_create_team_extension
+from posthog.models.team.team_revenue_analytics_config import TeamRevenueAnalyticsConfig
+
from products.data_tools.backend.models.join import DataWarehouseJoin
from products.data_warehouse.backend.presentation.views.view_link import NO_MATCHING_ROWS_MSG
from products.warehouse_sources.backend.facade.models import (
@@ -323,11 +326,13 @@ class TestViewLinkQuery(APIBaseTest):
configuration=None,
)
+ # The HogQL database build creates the revenue analytics row on a team's first query.
+ # Create it here so the count below covers only the queries every request makes.
+ get_or_create_team_extension(self.team, TeamRevenueAnalyticsConfig)
+
# Test that listing joins uses efficient querying
- with self.assertNumQueries(
- FuzzyInt(19, 21)
- ): # depends when the team revenue analytics config cache and instance-setting caches are hit in a test
+ with self.assertNumQueries(FuzzyInt(20, 21)): # depends when the instance-setting caches are hit in a test
response = self.client.get(f"/api/environments/{self.team.id}/warehouse_view_links/")
self.assertEqual(response.status_code, 200)
diff --git a/products/feature_flags/backend/api/test/test_feature_flag.py b/products/feature_flags/backend/api/test/test_feature_flag.py
index a303fc342ae8..2e53eda9aef7 100644
--- a/products/feature_flags/backend/api/test/test_feature_flag.py
+++ b/products/feature_flags/backend/api/test/test_feature_flag.py
@@ -9271,7 +9271,7 @@ class TestBlastRadius(ClickhouseTestMixin, APIBaseTest):
_create_person(team_id=team.pk, distinct_ids=[f"seen_person_{i}"], properties={"group": f"{i}"})
with self.capture_select_queries() as queries:
- assert team.persons_seen_so_far == 3
+ assert team.count_persons_seen_so_far() == 3
assert queries
for query in queries:
diff --git a/products/feature_flags/backend/user_blast_radius.py b/products/feature_flags/backend/user_blast_radius.py
index fd3b5bccf179..09890447b03f 100644
--- a/products/feature_flags/backend/user_blast_radius.py
+++ b/products/feature_flags/backend/user_blast_radius.py
@@ -239,7 +239,7 @@ def _get_person_blast_radius(team: Team, prop_group: PropertyGroup) -> BlastRadi
if len(properties) == 0:
# No filters means all persons are affected
- total_users = team.persons_seen_so_far
+ total_users = team.count_persons_seen_so_far()
return BlastRadiusResult(affected=total_users, total=total_users)
tag_queries(product=Product.FEATURE_FLAGS, feature=Feature.QUERY)
@@ -356,7 +356,7 @@ def _get_group_blast_radius(
if len(properties) == 0:
# No filters means all groups of this type are affected
- total_groups = team.groups_seen_so_far(group_type_index)
+ total_groups = team.count_groups_seen_so_far(group_type_index)
return BlastRadiusResult(affected=total_groups, total=total_groups)
# Build the SELECT query for groups
diff --git a/products/marketing_analytics/backend/hogql_queries/test_marketing_analytics_config.py b/products/marketing_analytics/backend/hogql_queries/test_marketing_analytics_config.py
index 67b8dc0e2c1b..ed4d361dc1d2 100644
--- a/products/marketing_analytics/backend/hogql_queries/test_marketing_analytics_config.py
+++ b/products/marketing_analytics/backend/hogql_queries/test_marketing_analytics_config.py
@@ -21,15 +21,9 @@ class TestMarketingAnalyticsConfig(BaseTest):
return [call for call in mock_ff.call_args_list if call.args and call.args[0] == _MULTI_TOUCH_FLAG]
def _set_attribution_mode(self, mode: AttributionMode) -> None:
- # Access the cached_property to ensure the config exists, then update it
ma_config = self.team.marketing_analytics_config
ma_config.attribution_mode = mode.value
ma_config.save()
- # Invalidate the cached_property so from_team reads fresh data
- try:
- del self.team.marketing_analytics_config
- except AttributeError:
- pass
def test_from_team_defaults_to_last_touch(self):
config = MarketingAnalyticsConfig.from_team(self.team)
diff --git a/products/marketing_analytics/backend/test_api_conversion_goals.py b/products/marketing_analytics/backend/test_api_conversion_goals.py
index 4ad1f28f1332..4e458e9f8490 100644
--- a/products/marketing_analytics/backend/test_api_conversion_goals.py
+++ b/products/marketing_analytics/backend/test_api_conversion_goals.py
@@ -368,9 +368,6 @@ class TestConversionGoalWrites(APIBaseTest):
def test_another_teams_goals_are_not_reachable(self):
goal = self.create_goal("Sign ups").json()["goal"]
other_team = Team.objects.create(organization=self.organization, name="Other")
- # Without an existing row, the 404 rolls back the row that the first request creates.
- # Team.marketing_analytics_config then returns the rolled-back row from its process-wide cache.
- get_or_create_team_extension(other_team, TeamMarketingAnalyticsConfig)
other_url = f"/api/projects/{other_team.pk}/marketing_analytics/conversion_goals"
update = self.client.patch(
diff --git a/products/marketing_analytics/backend/test_api_setup_plan.py b/products/marketing_analytics/backend/test_api_setup_plan.py
index a0f3572d1ada..e49ddb641458 100644
--- a/products/marketing_analytics/backend/test_api_setup_plan.py
+++ b/products/marketing_analytics/backend/test_api_setup_plan.py
@@ -10,9 +10,7 @@ from django.utils import timezone
from parameterized import parameterized
from posthog.models.organization import Organization, OrganizationMembership
-from posthog.models.team.extensions import get_or_create_team_extension
from posthog.models.team.team import Team
-from posthog.models.team.team_marketing_analytics_config import TeamMarketingAnalyticsConfig
from posthog.models.user import User
from products.marketing_analytics.backend.services.setup_types import (
@@ -245,9 +243,6 @@ class TestSetupPlanCaching(APIBaseTest):
def setUp(self):
super().setUp()
self.url = f"/api/projects/{self.team.pk}/marketing_analytics/setup_plan"
- # Team.marketing_analytics_config caches the config object process-wide. Without a row here,
- # apply_setup_ops locks a row that an earlier test created and rolled back, and the request fails.
- get_or_create_team_extension(self.team, TeamMarketingAnalyticsConfig)
# locmem persists across tests in a process; a leaked entry would make these
# pass or fail depending on ordering.
cache.clear()
diff --git a/products/product_analytics/backend/tests/api/__snapshots__/test_insight.ambr b/products/product_analytics/backend/tests/api/__snapshots__/test_insight.ambr
index ba930f82a628..1395af30dd2e 100644
--- a/products/product_analytics/backend/tests/api/__snapshots__/test_insight.ambr
+++ b/products/product_analytics/backend/tests/api/__snapshots__/test_insight.ambr
@@ -458,46 +458,31 @@
# ---
# name: TestInsight.test_listing_insights_does_not_nplus1.18
'''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
+ LIMIT 21
'''
# ---
# name: TestInsight.test_listing_insights_does_not_nplus1.19
'''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
+ SELECT "posthog_teammarketinganalyticsconfig"."team_id",
+ "posthog_teammarketinganalyticsconfig"."attribution_window_days",
+ "posthog_teammarketinganalyticsconfig"."attribution_mode",
+ "posthog_teammarketinganalyticsconfig"."filter_test_accounts",
+ "posthog_teammarketinganalyticsconfig"."sources_map",
+ "posthog_teammarketinganalyticsconfig"."conversion_goals",
+ "posthog_teammarketinganalyticsconfig"."campaign_name_mappings",
+ "posthog_teammarketinganalyticsconfig"."custom_source_mappings",
+ "posthog_teammarketinganalyticsconfig"."campaign_field_preferences"
+ FROM "posthog_teammarketinganalyticsconfig"
+ WHERE "posthog_teammarketinganalyticsconfig"."team_id" = 99999
+ LIMIT 21
'''
# ---
# name: TestInsight.test_listing_insights_does_not_nplus1.2
@@ -640,6 +625,67 @@
'''
# ---
# name: TestInsight.test_listing_insights_does_not_nplus1.20
+ '''
+ SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
+ "customer_analytics_teamcustomeranalyticsconfig"."activity_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."signup_pageview_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."signup_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."subscription_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."payment_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_group_type_index",
+ "customer_analytics_teamcustomeranalyticsconfig"."default_pinned_properties",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules_enabled_at"
+ FROM "customer_analytics_teamcustomeranalyticsconfig"
+ WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.21
+ '''
+ SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
+ FROM "posthog_dashboardtile"
+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
+ WHERE (NOT ("posthog_dashboardtile"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL)
+ AND NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboardtile"."insight_id" = 99999)
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.22
+ '''
+ SELECT "posthog_dashboard"."id",
+ "posthog_dashboard"."name",
+ "posthog_dashboard"."description",
+ "posthog_dashboard"."team_id",
+ "posthog_dashboard"."pinned",
+ "posthog_dashboard"."created_at",
+ "posthog_dashboard"."created_by_id",
+ "posthog_dashboard"."deleted",
+ "posthog_dashboard"."last_accessed_at",
+ "posthog_dashboard"."last_refresh",
+ "posthog_dashboard"."filters",
+ "posthog_dashboard"."variables",
+ "posthog_dashboard"."breakdown_colors",
+ "posthog_dashboard"."data_color_theme_id",
+ "posthog_dashboard"."creation_mode",
+ "posthog_dashboard"."restriction_level",
+ "posthog_dashboard"."quick_filter_ids",
+ "posthog_dashboard"."customization",
+ "posthog_dashboard"."deprecated_tags",
+ "posthog_dashboard"."tags",
+ "posthog_dashboard"."share_token",
+ "posthog_dashboard"."is_shared"
+ FROM "posthog_dashboard"
+ WHERE (NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboard"."id" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.23
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -648,14 +694,14 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.21
+# name: TestInsight.test_listing_insights_does_not_nplus1.24
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboarditem"
WHERE NOT ("posthog_dashboarditem"."deleted")
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.22
+# name: TestInsight.test_listing_insights_does_not_nplus1.25
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -701,7 +747,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.23
+# name: TestInsight.test_listing_insights_does_not_nplus1.26
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -747,7 +793,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.24
+# name: TestInsight.test_listing_insights_does_not_nplus1.27
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -886,7 +932,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.25
+# name: TestInsight.test_listing_insights_does_not_nplus1.28
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -941,7 +987,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.26
+# name: TestInsight.test_listing_insights_does_not_nplus1.29
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -964,7 +1010,62 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.27
+# name: TestInsight.test_listing_insights_does_not_nplus1.3
+ '''
+ SELECT "posthog_organizationmembership"."id",
+ "posthog_organizationmembership"."organization_id",
+ "posthog_organizationmembership"."user_id",
+ "posthog_organizationmembership"."level",
+ "posthog_organizationmembership"."joined_at",
+ "posthog_organizationmembership"."updated_at",
+ "posthog_organizationmembership"."invited_by_id",
+ "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_organizationmembership"
+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_organizationmembership"."user_id" = 99999)
+ LIMIT 21
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.30
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1017,7 +1118,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.28
+# name: TestInsight.test_listing_insights_does_not_nplus1.31
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboarditem"
@@ -1026,7 +1127,7 @@
AND NOT ("posthog_dashboarditem"."deleted"))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.29
+# name: TestInsight.test_listing_insights_does_not_nplus1.32
'''
SELECT "posthog_dashboarditem"."id",
"posthog_dashboarditem"."name",
@@ -1213,62 +1314,7 @@
LIMIT 100
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.3
- '''
- SELECT "posthog_organizationmembership"."id",
- "posthog_organizationmembership"."organization_id",
- "posthog_organizationmembership"."user_id",
- "posthog_organizationmembership"."level",
- "posthog_organizationmembership"."joined_at",
- "posthog_organizationmembership"."updated_at",
- "posthog_organizationmembership"."invited_by_id",
- "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organizationmembership"
- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_organizationmembership"."user_id" = 99999)
- LIMIT 21
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.30
+# name: TestInsight.test_listing_insights_does_not_nplus1.33
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -1286,7 +1332,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.31
+# name: TestInsight.test_listing_insights_does_not_nplus1.34
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -1303,7 +1349,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.32
+# name: TestInsight.test_listing_insights_does_not_nplus1.35
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
diff --git a/products/warehouse_sources/backend/temporal/data_imports/tests/e2e/test_end_to_end.py b/products/warehouse_sources/backend/temporal/data_imports/tests/e2e/test_end_to_end.py
index 18d8bfef67da..683d4b35ddbb 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/tests/e2e/test_end_to_end.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/tests/e2e/test_end_to_end.py
@@ -43,6 +43,7 @@ from posthog.hogql.query import execute_hogql_query
from posthog.models.event.util import format_clickhouse_timestamp
from posthog.models.integration import Integration
from posthog.models.team.team import Team
+from posthog.models.team.team_revenue_analytics_config import TeamRevenueAnalyticsConfig
from posthog.temporal.common.shutdown import ShutdownMonitor, WorkerShuttingDownError
from posthog.temporal.utils import ExternalDataWorkflowInputs
@@ -690,9 +691,8 @@ async def test_stripe_charges(team, stripe_charge, mock_stripe_client):
mock_data_response=stripe_charge["data"],
)
- # Get team from the DB to remove cached config value
- team = await sync_to_async(Team.objects.get)(id=team.id)
- assert team.revenue_analytics_config.notified_first_sync
+ config = await sync_to_async(TeamRevenueAnalyticsConfig.objects.get)(team_id=team.id)
+ assert config.notified_first_sync
_ZENDESK_JOB_INPUTS: dict[str, str | dict[str, str]] = {
diff --git a/products/workflows/backend/services/default_email_sender.py b/products/workflows/backend/services/default_email_sender.py
index 81166f7e0186..47a93664614b 100644
--- a/products/workflows/backend/services/default_email_sender.py
+++ b/products/workflows/backend/services/default_email_sender.py
@@ -1,30 +1,18 @@
"""The project's default email sender, which new broadcasts and workflow email steps start with."""
-from posthog.models.team import Team
-
from products.workflows.backend.models.team_workflows_config import TeamWorkflowsConfig
from products.workflows.backend.services.email_sending_controls import ensure_workflows_config
-def _forget_memoized_config() -> None:
- # Team.workflows_config is memoized for the whole process, so a write that bypasses the
- # memoized row would keep serving the old sender to this team's next request.
- Team.workflows_config.fget.cache_clear()
-
-
def set_default_email_sender_if_unset(team_id: int, integration_id: int) -> bool:
ensure_workflows_config(team_id)
updated = TeamWorkflowsConfig.objects.filter(team_id=team_id, default_email_integration_id__isnull=True).update(
default_email_integration_id=integration_id
)
- if updated:
- _forget_memoized_config()
return updated > 0
def clear_default_email_sender(team_id: int, integration_id: int) -> None:
- cleared = TeamWorkflowsConfig.objects.filter(team_id=team_id, default_email_integration_id=integration_id).update(
+ TeamWorkflowsConfig.objects.filter(team_id=team_id, default_email_integration_id=integration_id).update(
default_email_integration_id=None
)
- if cleared:
- _forget_memoized_config()
diff --git a/products/workflows/backend/services/transactional_email_workflows.py b/products/workflows/backend/services/transactional_email_workflows.py
index 729b4b239023..e02cbbc5aff8 100644
--- a/products/workflows/backend/services/transactional_email_workflows.py
+++ b/products/workflows/backend/services/transactional_email_workflows.py
@@ -100,7 +100,6 @@ def _content_fields(content: TransactionalEmailContent, from_integration_id: int
def _verified_sender(team_id: int, requested_id: int | None) -> int:
- # A fresh read: Team.workflows_config is memoized for the whole process.
sender_id = requested_id or (
TeamWorkflowsConfig.objects.filter(team_id=team_id)
.values_list("default_email_integration_id", flat=True)
diff --git a/products/workflows/backend/test/test_team_workflows_config.py b/products/workflows/backend/test/test_team_workflows_config.py
index 64f89a63b90b..0ebb51229f10 100644
--- a/products/workflows/backend/test/test_team_workflows_config.py
+++ b/products/workflows/backend/test/test_team_workflows_config.py
@@ -57,7 +57,7 @@ class TestTeamWorkflowsConfig(APIBaseTest):
}
def test_patch_enables_capture(self) -> None:
- # APIBaseTest.setUp may trigger the workflows_config cached_property (which calls
+ # APIBaseTest.setUp may trigger the workflows_config accessor (which calls
# get_or_create_team_extension) so the extension row can already exist with the default
# value. Either way, the patch must end with the row present and capture enabled.
response = self.client.patch(self.url, {"workflows_config": {"capture_workflows_engagement_events": True}})