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(auth): load the session user with its current organization (#126421)

Paul D'Ambra618eb91f15c8
diff --git a/ee/api/test/test_action.py b/ee/api/test/test_action.py
index b4781a2b205a..c9cd8bb11450 100644
--- a/ee/api/test/test_action.py
+++ b/ee/api/test/test_action.py
@@ -82,7 +82,7 @@ class TestActionApi(APIBaseTest):
# base request queries + the single bulk access-control preload (one query covering all
# actions, replacing the previous per-action access-control lookups)
- with self.assertNumQueries(14):
+ with self.assertNumQueries(13):
response = self.client.get(f"/api/projects/{self.team.id}/actions")
self.assertEqual(response.json()["results"][0]["tags"][0], "tag")
self.assertEqual(response.status_code, status.HTTP_200_OK)
diff --git a/ee/settings.py b/ee/settings.py
index 0ef819ea63cc..60385cee7dd6 100644
--- a/ee/settings.py
+++ b/ee/settings.py
@@ -61,7 +61,7 @@ if ENFORCE_ADMIN_OAUTH2 and ADMIN_AUTH_GOOGLE_OAUTH2_KEY and ADMIN_AUTH_GOOGLE_O
ADMIN_OAUTH2_COOKIE_SECURE = str_to_bool(get_from_env("ADMIN_OAUTH2_COOKIE_SECURE", "True", type_cast=str))
# middleware must be added after `AuthenticationMiddleware``
MIDDLEWARE = MIDDLEWARE.copy()
- auth_middleware_index = MIDDLEWARE.index("django.contrib.auth.middleware.AuthenticationMiddleware")
+ auth_middleware_index = MIDDLEWARE.index("posthog.middleware.AuthenticationMiddleware")
MIDDLEWARE.insert(auth_middleware_index + 1, "posthog.admin.oauth2.AdminOAuth2Middleware")
CUSTOMER_IO_API_KEY = get_from_env("CUSTOMER_IO_API_KEY", "", type_cast=str)
diff --git a/posthog/api/test/__snapshots__/test_element.ambr b/posthog/api/test/__snapshots__/test_element.ambr
index 5bd4fb8a0ccc..629717e7aac5 100644
--- a/posthog/api/test/__snapshots__/test_element.ambr
+++ b/posthog/api/test/__snapshots__/test_element.ambr
@@ -39,15 +39,8 @@
"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: TestElement.test_element_stats_postgres_queries_are_as_expected.1
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -86,122 +79,13 @@
"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: TestElement.test_element_stats_postgres_queries_are_as_expected.10
- '''
- 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: TestElement.test_element_stats_postgres_queries_are_as_expected.11
- '''
- 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: TestElement.test_element_stats_postgres_queries_are_as_expected.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: TestElement.test_element_stats_postgres_queries_are_as_expected.13
- '''
- SELECT "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"
- FROM "posthog_datawarehousetable"
- LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")
- WHERE ("posthog_datawarehousetable"."team_id" = 99999
- AND NOT ("posthog_datawarehousetable"."deleted"
- AND "posthog_datawarehousetable"."deleted" IS NOT NULL)
- AND NOT ("posthog_externaldatasource"."deleted"
- AND "posthog_externaldatasource"."deleted" IS NOT NULL)
- AND NOT ("posthog_externaldatasource"."access_method" = 'direct'
- AND "posthog_externaldatasource"."access_method" IS NOT NULL))
- ORDER BY "posthog_datawarehousetable"."created_at" DESC
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestElement.test_element_stats_postgres_queries_are_as_expected.2
+# name: TestElement.test_element_stats_postgres_queries_are_as_expected.1
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -299,7 +183,112 @@
LIMIT 21
'''
# ---
-# name: TestElement.test_element_stats_postgres_queries_are_as_expected.3
+# name: TestElement.test_element_stats_postgres_queries_are_as_expected.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))
+ '''
+# ---
+# name: TestElement.test_element_stats_postgres_queries_are_as_expected.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: TestElement.test_element_stats_postgres_queries_are_as_expected.12
+ '''
+ SELECT "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"
+ FROM "posthog_datawarehousetable"
+ LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")
+ WHERE ("posthog_datawarehousetable"."team_id" = 99999
+ AND NOT ("posthog_datawarehousetable"."deleted"
+ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)
+ AND NOT ("posthog_externaldatasource"."deleted"
+ AND "posthog_externaldatasource"."deleted" IS NOT NULL)
+ AND NOT ("posthog_externaldatasource"."access_method" = 'direct'
+ AND "posthog_externaldatasource"."access_method" IS NOT NULL))
+ ORDER BY "posthog_datawarehousetable"."created_at" DESC
+ '''
+# ---
+# name: TestElement.test_element_stats_postgres_queries_are_as_expected.13
+ '''
+ SELECT "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"
+ FROM "posthog_datawarehousetable"
+ LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")
+ WHERE ("posthog_datawarehousetable"."team_id" = 99999
+ AND NOT ("posthog_datawarehousetable"."deleted"
+ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)
+ AND NOT ("posthog_externaldatasource"."deleted"
+ AND "posthog_externaldatasource"."deleted" IS NOT NULL)
+ AND NOT ("posthog_externaldatasource"."access_method" = 'direct'
+ AND "posthog_externaldatasource"."access_method" IS NOT NULL))
+ ORDER BY "posthog_datawarehousetable"."created_at" DESC
+ '''
+# ---
+# name: TestElement.test_element_stats_postgres_queries_are_as_expected.2
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -345,7 +334,7 @@
LIMIT 21
'''
# ---
-# name: TestElement.test_element_stats_postgres_queries_are_as_expected.4
+# name: TestElement.test_element_stats_postgres_queries_are_as_expected.3
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -400,7 +389,7 @@
LIMIT 21
'''
# ---
-# name: TestElement.test_element_stats_postgres_queries_are_as_expected.5
+# name: TestElement.test_element_stats_postgres_queries_are_as_expected.4
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -423,7 +412,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestElement.test_element_stats_postgres_queries_are_as_expected.6
+# name: TestElement.test_element_stats_postgres_queries_are_as_expected.5
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -476,7 +465,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestElement.test_element_stats_postgres_queries_are_as_expected.7
+# name: TestElement.test_element_stats_postgres_queries_are_as_expected.6
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -485,7 +474,7 @@
LIMIT 1
'''
# ---
-# name: TestElement.test_element_stats_postgres_queries_are_as_expected.8
+# name: TestElement.test_element_stats_postgres_queries_are_as_expected.7
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -550,7 +539,7 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestElement.test_element_stats_postgres_queries_are_as_expected.9
+# name: TestElement.test_element_stats_postgres_queries_are_as_expected.8
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -563,3 +552,41 @@
LIMIT 21
'''
# ---
+# name: TestElement.test_element_stats_postgres_queries_are_as_expected.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'))
+ '''
+# ---
diff --git a/posthog/api/test/__snapshots__/test_preflight.ambr b/posthog/api/test/__snapshots__/test_preflight.ambr
index 665f469f530e..747418c6d48e 100644
--- a/posthog/api/test/__snapshots__/test_preflight.ambr
+++ b/posthog/api/test/__snapshots__/test_preflight.ambr
@@ -39,15 +39,8 @@
"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: TestPreflight.test_cloud_preflight_limited_db_queries.1
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -86,8 +79,107 @@
"posthog_organization"."personalization",
"posthog_organization"."domain_whitelist",
"posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
+ '''
+# ---
+# name: TestPreflight.test_cloud_preflight_limited_db_queries.1
+ '''
+ 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"."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"
+ FROM "posthog_team"
+ WHERE "posthog_team"."id" = 99999
LIMIT 21
'''
# ---
diff --git a/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr b/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr
index 3443aa0b5dcc..79a1931161c1 100644
--- a/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr
+++ b/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr
@@ -39,86 +39,8 @@
"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_adding_insights_is_not_nplus1_for_gets.1
- '''
- 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_adding_insights_is_not_nplus1_for_gets.10
- '''
- 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" = 'dashboard'
- AND NOT ("posthog_filesystem"."shortcut"
- AND "posthog_filesystem"."shortcut" IS NOT NULL))
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.100
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -157,41 +79,13 @@
"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_adding_insights_is_not_nplus1_for_gets.101
- '''
- SELECT 1 AS "a"
- FROM "posthog_sharingconfiguration"
- WHERE ("posthog_sharingconfiguration"."enabled"
- AND ("posthog_sharingconfiguration"."expires_at" IS NULL
- OR "posthog_sharingconfiguration"."expires_at" > 'SHARING-EXPIRY-TIMESTAMP'::timestamptz)
- AND "posthog_sharingconfiguration"."dashboard_id" = 99999
- AND "posthog_sharingconfiguration"."team_id" = 99999)
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.102
- '''
- SELECT 1 AS "a"
- FROM "posthog_subscription"
- WHERE (NOT "posthog_subscription"."deleted"
- AND "posthog_subscription"."enabled"
- AND "posthog_subscription"."dashboard_id" = 99999
- AND NOT (EXISTS
- (SELECT 1 AS "a"
- FROM "posthog_subscription_dashboard_export_insights" "U1"
- INNER JOIN "posthog_dashboarditem" "U2" ON ("U1"."insight_id" = "U2"."id")
- WHERE (NOT "U2"."deleted"
- AND "U1"."subscription_id" = ("posthog_subscription"."id"))
- LIMIT 1)))
- LIMIT 1
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.103
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.1
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -283,38 +177,65 @@
"posthog_team"."api_query_rate_limit",
"posthog_team"."drop_events_older_than",
"posthog_team"."base_currency",
- "posthog_team"."business_model"
+ "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: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.104
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.10
'''
- 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))
+ 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_adding_insights_is_not_nplus1_for_gets.105
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.100
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -332,7 +253,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.106
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.101
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -361,7 +282,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.107
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.102
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -390,7 +311,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.108
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.103
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -410,7 +331,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.109
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.104
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -423,19 +344,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.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_adding_insights_is_not_nplus1_for_gets.110
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.105
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -451,7 +360,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.111
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.106
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -469,7 +378,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.112
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.107
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -478,7 +387,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.113
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.108
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -518,15 +427,8 @@
"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_adding_insights_is_not_nplus1_for_gets.114
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -565,12 +467,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.115
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.109
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -708,7 +611,26 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.116
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.11
+ '''
+ 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_adding_insights_is_not_nplus1_for_gets.110
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -763,7 +685,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.117
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.111
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -786,7 +708,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.118
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.112
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -839,7 +761,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.119
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.113
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -851,26 +773,7 @@
OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.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_adding_insights_is_not_nplus1_for_gets.120
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.114
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -892,7 +795,7 @@
AND "ee_accesscontrol"."role_id" IS NULL)))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.121
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.115
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -994,7 +897,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.122
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.116
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -1017,7 +920,7 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.123
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.117
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -1038,7 +941,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.124
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.118
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1136,7 +1039,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.125
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.119
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -1161,7 +1064,15 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.126
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.12
+ '''
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_taggeditem"
+ WHERE ("posthog_taggeditem"."content_type_id" = 99999
+ AND "posthog_taggeditem"."object_id" = 99999)
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.120
'''
SELECT "posthog_filesystemshortcut"."id",
"posthog_filesystemshortcut"."team_id",
@@ -1184,7 +1095,7 @@
AND "posthog_filesystemshortcut"."href" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.127
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.121
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -1204,7 +1115,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.128
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.122
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -1561,7 +1472,7 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.129
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.123
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -1579,15 +1490,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.13
- '''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_taggeditem"
- WHERE ("posthog_taggeditem"."content_type_id" = 99999
- AND "posthog_taggeditem"."object_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.130
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.124
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -1608,7 +1511,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.131
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.125
'''
SELECT "posthog_alertconfiguration"."created_by_id",
"posthog_alertconfiguration"."created_at",
@@ -1693,7 +1596,7 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.132
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.126
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -1706,7 +1609,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.133
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.127
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -1722,7 +1625,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.134
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.128
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -1740,7 +1643,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.135
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.129
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -1780,15 +1683,8 @@
"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_adding_insights_is_not_nplus1_for_gets.136
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -1827,12 +1723,27 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.137
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.13
+ '''
+ SELECT "posthog_dashboardtile"."group_key" AS "group_key"
+ FROM "posthog_dashboardtile"
+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
+ LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."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_dashboarditem"."deleted"
+ OR "posthog_dashboardtile"."insight_id" IS NULL))
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.130
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1970,7 +1881,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.138
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.131
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -2025,7 +1936,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.139
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.132
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -2048,21 +1959,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.14
- '''
- SELECT "posthog_dashboardtile"."group_key" AS "group_key"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."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_dashboarditem"."deleted"
- OR "posthog_dashboardtile"."insight_id" IS NULL))
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.140
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.133
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -2115,7 +2012,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.141
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.134
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -2127,7 +2024,7 @@
OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.142
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.135
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -2149,7 +2046,7 @@
AND "ee_accesscontrol"."role_id" IS NULL)))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.143
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.136
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -2169,7 +2066,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.144
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.137
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -2182,7 +2079,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.145
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.138
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -2195,7 +2092,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.146
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.139
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -2227,7 +2124,23 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.147
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.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_adding_insights_is_not_nplus1_for_gets.140
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -2325,7 +2238,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.148
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.141
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -2371,7 +2284,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.149
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.142
'''
SELECT 1 AS "a"
FROM "posthog_sharingconfiguration"
@@ -2383,23 +2296,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.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_adding_insights_is_not_nplus1_for_gets.150
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.143
'''
SELECT 1 AS "a"
FROM "posthog_subscription"
@@ -2416,7 +2313,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.151
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.144
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -2514,7 +2411,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.152
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.145
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -2539,7 +2436,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.153
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.146
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -2557,7 +2454,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.154
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.147
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -2586,7 +2483,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.155
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.148
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -2615,7 +2512,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.156
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.149
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -2635,7 +2532,23 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.157
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.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_adding_insights_is_not_nplus1_for_gets.150
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -2648,7 +2561,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.158
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.151
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -2664,7 +2577,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.159
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.152
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -2682,23 +2595,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.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_adding_insights_is_not_nplus1_for_gets.160
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.153
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -2707,7 +2604,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.161
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.154
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -2747,15 +2644,8 @@
"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_adding_insights_is_not_nplus1_for_gets.162
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -2794,12 +2684,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.163
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.155
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -2937,7 +2828,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.164
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.156
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -2992,7 +2883,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.165
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.157
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -3015,7 +2906,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.166
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.158
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -3068,7 +2959,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.167
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.159
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -3080,7 +2971,23 @@
OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.168
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.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_adding_insights_is_not_nplus1_for_gets.160
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -3102,7 +3009,7 @@
AND "ee_accesscontrol"."role_id" IS NULL)))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.169
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.161
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -3204,23 +3111,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.17
- '''
- 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_adding_insights_is_not_nplus1_for_gets.170
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.162
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -3243,7 +3134,7 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.171
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.163
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -3264,7 +3155,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.172
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.164
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -3362,7 +3253,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.173
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.165
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -3387,7 +3278,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.174
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.166
'''
SELECT "posthog_filesystemshortcut"."id",
"posthog_filesystemshortcut"."team_id",
@@ -3410,7 +3301,7 @@
AND "posthog_filesystemshortcut"."href" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.175
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.167
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -3430,7 +3321,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.176
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.168
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -3787,7 +3678,7 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.177
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.169
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -3805,7 +3696,26 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.178
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.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_adding_insights_is_not_nplus1_for_gets.170
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -3826,7 +3736,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.179
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.171
'''
SELECT "posthog_alertconfiguration"."created_by_id",
"posthog_alertconfiguration"."created_at",
@@ -3911,26 +3821,7 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.18
- '''
- 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_adding_insights_is_not_nplus1_for_gets.180
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.172
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -3943,7 +3834,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.181
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.173
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -3959,7 +3850,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.182
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.174
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -3977,7 +3868,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.19
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.175
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -3997,145 +3888,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.2
- '''
- 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"."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: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.20
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.176
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -4492,18 +4245,74 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.21
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.177
'''
- SELECT "posthog_tag"."name" AS "tag__name"
+ SELECT "posthog_dashboardtile"."id",
+ "posthog_dashboardtile"."dashboard_id",
+ "posthog_dashboardtile"."insight_id",
+ "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" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.178
+ '''
+ SELECT "posthog_taggeditem"."id",
+ "posthog_taggeditem"."tag_id",
+ "posthog_taggeditem"."content_type_id",
+ "posthog_taggeditem"."object_id",
+ "posthog_taggeditem"."object_uuid",
+ "posthog_taggeditem"."team_id",
+ "posthog_tag"."id",
+ "posthog_tag"."name",
+ "posthog_tag"."team_id"
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)
+ AND "posthog_taggeditem"."object_id" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.22
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.179
'''
- SELECT "posthog_user"."id",
+ SELECT "posthog_alertconfiguration"."created_by_id",
+ "posthog_alertconfiguration"."created_at",
+ "posthog_alertconfiguration"."id",
+ "posthog_alertconfiguration"."team_id",
+ "posthog_alertconfiguration"."insight_id",
+ "posthog_alertconfiguration"."name",
+ "posthog_alertconfiguration"."config",
+ "posthog_alertconfiguration"."evaluation_delay_intervals",
+ "posthog_alertconfiguration"."calculation_interval",
+ "posthog_alertconfiguration"."threshold_id",
+ "posthog_alertconfiguration"."condition",
+ "posthog_alertconfiguration"."detector_config",
+ "posthog_alertconfiguration"."state",
+ "posthog_alertconfiguration"."enabled",
+ "posthog_alertconfiguration"."last_notified_at",
+ "posthog_alertconfiguration"."last_checked_at",
+ "posthog_alertconfiguration"."next_check_at",
+ "posthog_alertconfiguration"."snoozed_until",
+ "posthog_alertconfiguration"."skip_weekend",
+ "posthog_alertconfiguration"."schedule_restriction",
+ "posthog_alertconfiguration"."schedule_start_time",
+ "posthog_alertconfiguration"."investigation_agent_enabled",
+ "posthog_alertconfiguration"."investigation_gates_notifications",
+ "posthog_alertconfiguration"."investigation_inconclusive_action",
+ "posthog_alertconfiguration"."owner",
+ "posthog_alertconfiguration"."owner_changed_at",
+ "posthog_user"."id",
"posthog_user"."password",
"posthog_user"."last_login",
"posthog_user"."first_name",
@@ -4518,6 +4327,7 @@
"posthog_user"."distinct_id",
"posthog_user"."is_email_verified",
"posthog_user"."credentials_reviewed_at",
+ "posthog_user"."requested_password_reset_at",
"posthog_user"."requested_2fa_reset_at",
"posthog_user"."has_seen_product_intro_for",
"posthog_user"."strapi_id",
@@ -4541,61 +4351,142 @@
"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)
+ "posthog_user"."email_opt_in",
+ "posthog_threshold"."created_by_id",
+ "posthog_threshold"."created_at",
+ "posthog_threshold"."id",
+ "posthog_threshold"."team_id",
+ "posthog_threshold"."insight_id",
+ "posthog_threshold"."name",
+ "posthog_threshold"."configuration"
+ FROM "posthog_alertconfiguration"
+ LEFT OUTER JOIN "posthog_user" ON ("posthog_alertconfiguration"."created_by_id" = "posthog_user"."id")
+ LEFT OUTER JOIN "posthog_threshold" ON ("posthog_alertconfiguration"."threshold_id" = "posthog_threshold"."id")
+ WHERE "posthog_alertconfiguration"."insight_id" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.23
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.18
'''
- 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_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_adding_insights_is_not_nplus1_for_gets.180
+ '''
+ 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.24
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.181
'''
- SELECT "posthog_team"."id",
+ 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.182
+ '''
+ 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",
+ "customer_analytics_teamcustomeranalyticsconfig"."properties"
+ FROM "customer_analytics_teamcustomeranalyticsconfig"
+ WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.19
+ '''
+ SELECT "posthog_dashboardtile"."id",
+ "posthog_dashboardtile"."dashboard_id",
+ "posthog_dashboardtile"."insight_id",
+ "posthog_dashboardtile"."text_id",
+ "posthog_dashboardtile"."button_tile_id",
+ "posthog_dashboardtile"."widget_id",
+ "posthog_dashboardtile"."team_id",
+ "posthog_dashboardtile"."layouts",
+ "posthog_dashboardtile"."color",
+ "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",
+ "posthog_dashboarditem"."id",
+ "posthog_dashboarditem"."name",
+ "posthog_dashboarditem"."derived_name",
+ "posthog_dashboarditem"."description",
+ "posthog_dashboarditem"."team_id",
+ "posthog_dashboarditem"."filters",
+ "posthog_dashboarditem"."filters_hash",
+ "posthog_dashboarditem"."query",
+ "posthog_dashboarditem"."query_metadata",
+ "posthog_dashboarditem"."order",
+ "posthog_dashboarditem"."deleted",
+ "posthog_dashboarditem"."saved",
+ "posthog_dashboarditem"."created_at",
+ "posthog_dashboarditem"."refreshing",
+ "posthog_dashboarditem"."created_by_id",
+ "posthog_dashboarditem"."is_sample",
+ "posthog_dashboarditem"."short_id",
+ "posthog_dashboarditem"."favorited",
+ "posthog_dashboarditem"."refresh_attempt",
+ "posthog_dashboarditem"."last_modified_at",
+ "posthog_dashboarditem"."last_modified_by_id",
+ "posthog_dashboarditem"."dashboard_id",
+ "posthog_dashboarditem"."last_refresh",
+ "posthog_dashboarditem"."layouts",
+ "posthog_dashboarditem"."color",
+ "posthog_dashboarditem"."dive_dashboard_id",
+ "posthog_dashboarditem"."updated_at",
+ "posthog_dashboarditem"."deprecated_tags",
+ "posthog_dashboarditem"."tags",
+ "posthog_team"."id",
"posthog_team"."uuid",
"posthog_team"."organization_id",
"posthog_team"."parent_team_id",
@@ -4680,12 +4571,237 @@
"posthog_team"."extra_settings",
"posthog_team"."modifiers",
"posthog_team"."session_recording_retention_period_days",
+ "posthog_team"."plugins_opt_in",
+ "posthog_team"."opt_out_capture",
+ "posthog_team"."event_names",
+ "posthog_team"."event_names_with_usage",
+ "posthog_team"."event_properties",
+ "posthog_team"."event_properties_with_usage",
+ "posthog_team"."event_properties_numerical",
"posthog_team"."external_data_workspace_id",
"posthog_team"."external_data_workspace_last_synced_at",
"posthog_team"."api_query_rate_limit",
+ "posthog_team"."revenue_tracking_config",
"posthog_team"."drop_events_older_than",
"posthog_team"."base_currency",
"posthog_team"."business_model",
+ "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_password_reset_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",
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in",
+ "posthog_text"."id",
+ "posthog_text"."body",
+ "posthog_text"."agent_context",
+ "posthog_text"."created_by_id",
+ "posthog_text"."last_modified_at",
+ "posthog_text"."last_modified_by_id",
+ "posthog_text"."team_id",
+ "posthog_buttontile"."id",
+ "posthog_buttontile"."url",
+ "posthog_buttontile"."text",
+ "posthog_buttontile"."placement",
+ "posthog_buttontile"."style",
+ "posthog_buttontile"."created_by_id",
+ "posthog_buttontile"."last_modified_at",
+ "posthog_buttontile"."last_modified_by_id",
+ "posthog_buttontile"."team_id",
+ "posthog_dashboardwidget"."id",
+ "posthog_dashboardwidget"."widget_type",
+ "posthog_dashboardwidget"."name",
+ "posthog_dashboardwidget"."description",
+ "posthog_dashboardwidget"."config",
+ "posthog_dashboardwidget"."created_by_id",
+ "posthog_dashboardwidget"."last_modified_at",
+ "posthog_dashboardwidget"."last_modified_by_id",
+ "posthog_dashboardwidget"."team_id",
+ "T10"."id",
+ "T10"."password",
+ "T10"."last_login",
+ "T10"."first_name",
+ "T10"."last_name",
+ "T10"."is_staff",
+ "T10"."date_joined",
+ "T10"."uuid",
+ "T10"."current_organization_id",
+ "T10"."current_team_id",
+ "T10"."email",
+ "T10"."pending_email",
+ "T10"."distinct_id",
+ "T10"."is_email_verified",
+ "T10"."credentials_reviewed_at",
+ "T10"."requested_password_reset_at",
+ "T10"."requested_2fa_reset_at",
+ "T10"."has_seen_product_intro_for",
+ "T10"."strapi_id",
+ "T10"."is_active",
+ "T10"."role_at_organization",
+ "T10"."theme_mode",
+ "T10"."partial_notification_settings",
+ "T10"."anonymize_data",
+ "T10"."allow_impersonation",
+ "T10"."toolbar_mode",
+ "T10"."hedgehog_config",
+ "T10"."allow_sidebar_suggestions",
+ "T10"."shortcut_position",
+ "T10"."passkeys_enabled_for_2fa",
+ "T10"."hide_mcp_hints",
+ "T10"."ui_configuration",
+ "T10"."onboarding_skipped_at",
+ "T10"."onboarding_skipped_reason",
+ "T10"."onboarding_skipped_organization_id",
+ "T10"."onboarding_delegated_to_invite_id",
+ "T10"."onboarding_delegated_to_organization_id",
+ "T10"."onboarding_delegation_accepted_at",
+ "T10"."events_column_config",
+ "T10"."email_opt_in",
+ "T11"."id",
+ "T11"."password",
+ "T11"."last_login",
+ "T11"."first_name",
+ "T11"."last_name",
+ "T11"."is_staff",
+ "T11"."date_joined",
+ "T11"."uuid",
+ "T11"."current_organization_id",
+ "T11"."current_team_id",
+ "T11"."email",
+ "T11"."pending_email",
+ "T11"."distinct_id",
+ "T11"."is_email_verified",
+ "T11"."credentials_reviewed_at",
+ "T11"."requested_password_reset_at",
+ "T11"."requested_2fa_reset_at",
+ "T11"."has_seen_product_intro_for",
+ "T11"."strapi_id",
+ "T11"."is_active",
+ "T11"."role_at_organization",
+ "T11"."theme_mode",
+ "T11"."partial_notification_settings",
+ "T11"."anonymize_data",
+ "T11"."allow_impersonation",
+ "T11"."toolbar_mode",
+ "T11"."hedgehog_config",
+ "T11"."allow_sidebar_suggestions",
+ "T11"."shortcut_position",
+ "T11"."passkeys_enabled_for_2fa",
+ "T11"."hide_mcp_hints",
+ "T11"."ui_configuration",
+ "T11"."onboarding_skipped_at",
+ "T11"."onboarding_skipped_reason",
+ "T11"."onboarding_skipped_organization_id",
+ "T11"."onboarding_delegated_to_invite_id",
+ "T11"."onboarding_delegated_to_organization_id",
+ "T11"."onboarding_delegation_accepted_at",
+ "T11"."events_column_config",
+ "T11"."email_opt_in"
+ FROM "posthog_dashboardtile"
+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
+ LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."id")
+ LEFT OUTER JOIN "posthog_team" ON ("posthog_dashboarditem"."team_id" = "posthog_team"."id")
+ LEFT OUTER JOIN "posthog_user" ON ("posthog_dashboarditem"."created_by_id" = "posthog_user"."id")
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboarditem"."last_modified_by_id" = "T6"."id")
+ LEFT OUTER JOIN "posthog_text" ON ("posthog_dashboardtile"."text_id" = "posthog_text"."id")
+ LEFT OUTER JOIN "posthog_buttontile" ON ("posthog_dashboardtile"."button_tile_id" = "posthog_buttontile"."id")
+ LEFT OUTER JOIN "posthog_dashboardwidget" ON ("posthog_dashboardtile"."widget_id" = "posthog_dashboardwidget"."id")
+ LEFT OUTER JOIN "posthog_user" "T10" ON ("posthog_dashboardwidget"."created_by_id" = "T10"."id")
+ LEFT OUTER JOIN "posthog_user" "T11" ON ("posthog_dashboardwidget"."last_modified_by_id" = "T11"."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_dashboard"."deleted"
+ AND "posthog_dashboardtile"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL)
+ AND (NOT "posthog_dashboarditem"."deleted"
+ OR "posthog_dashboardtile"."insight_id" IS NULL))
+ ORDER BY "posthog_dashboarditem"."order" ASC
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.2
+ '''
+ 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",
@@ -4725,21 +4841,201 @@
"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
+ 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: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.25
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.20
'''
- 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",
+ 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_adding_insights_is_not_nplus1_for_gets.21
+ '''
+ 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",
+ "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_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.22
+ '''
+ 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"."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",
@@ -4779,37 +5075,13 @@
"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_team"
+ INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
+ WHERE "posthog_team"."id" = 99999
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.26
- '''
- 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.27
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.23
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -4859,22 +5131,12 @@
"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.28
- '''
- SELECT "ee_role"."organization_id" AS "role__organization_id",
- "ee_rolemembership"."role_id" AS "role_id"
- FROM "ee_rolemembership"
- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_rolemembership"."organization_member_id" = "posthog_organizationmembership"."id")
- INNER JOIN "ee_role" ON ("ee_rolemembership"."role_id" = "ee_role"."id")
- WHERE ("ee_rolemembership"."user_id" = 99999
- AND ("ee_rolemembership"."organization_member_id" IS NULL
- OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
+ 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.29
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.24
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -4887,16 +5149,17 @@
"ee_accesscontrol"."created_at",
"ee_accesscontrol"."updated_at"
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)))
+ 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.3
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.25
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -4946,12 +5209,44 @@
"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.26
+ '''
+ SELECT "ee_role"."organization_id" AS "role__organization_id",
+ "ee_rolemembership"."role_id" AS "role_id"
+ FROM "ee_rolemembership"
+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_rolemembership"."organization_member_id" = "posthog_organizationmembership"."id")
+ INNER JOIN "ee_role" ON ("ee_rolemembership"."role_id" = "ee_role"."id")
+ WHERE ("ee_rolemembership"."user_id" = 99999
+ AND ("ee_rolemembership"."organization_member_id" IS NULL
+ OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.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"
+ 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_adding_insights_is_not_nplus1_for_gets.28
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -5053,7 +5348,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.31
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.29
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -5076,7 +5371,30 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.32
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.3
+ '''
+ 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.30
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -5097,7 +5415,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.33
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.31
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -5195,7 +5513,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.34
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.32
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -5220,7 +5538,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.35
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.33
'''
SELECT "posthog_filesystemshortcut"."id",
"posthog_filesystemshortcut"."team_id",
@@ -5243,7 +5561,7 @@
AND "posthog_filesystemshortcut"."href" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.36
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.34
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -5263,7 +5581,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.37
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.35
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -5620,7 +5938,7 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.38
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.36
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -5660,15 +5978,8 @@
"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_adding_insights_is_not_nplus1_for_gets.39
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -5707,35 +6018,13 @@
"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_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))
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.40
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.37
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -5873,7 +6162,85 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.41
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.38
+ '''
+ 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: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.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: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.4
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -5923,35 +6290,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
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.42
- '''
- 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))
+ WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.43
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.40
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -6004,7 +6346,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.44
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.41
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -6016,7 +6358,7 @@
OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.45
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.42
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -6038,7 +6380,7 @@
AND "ee_accesscontrol"."role_id" IS NULL)))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.46
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.43
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -6058,7 +6400,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.47
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.44
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -6071,7 +6413,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.48
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.45
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -6084,7 +6426,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.49
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.46
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -6116,60 +6458,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.50
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.47
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -6267,7 +6556,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.51
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.48
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -6313,7 +6602,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.52
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.49
'''
SELECT 1 AS "a"
FROM "posthog_sharingconfiguration"
@@ -6325,7 +6614,19 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.53
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.5
+ '''
+ SELECT "ee_role"."organization_id" AS "role__organization_id",
+ "ee_rolemembership"."role_id" AS "role_id"
+ FROM "ee_rolemembership"
+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_rolemembership"."organization_member_id" = "posthog_organizationmembership"."id")
+ INNER JOIN "ee_role" ON ("ee_rolemembership"."role_id" = "ee_role"."id")
+ WHERE ("ee_rolemembership"."user_id" = 99999
+ AND ("ee_rolemembership"."organization_member_id" IS NULL
+ OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.50
'''
SELECT 1 AS "a"
FROM "posthog_subscription"
@@ -6342,7 +6643,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.54
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.51
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -6440,7 +6741,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.55
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.52
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -6465,7 +6766,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.56
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.53
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -6483,7 +6784,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.57
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.54
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -6512,7 +6813,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.58
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.55
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -6541,7 +6842,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.59
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.56
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -6561,19 +6862,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# 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"
- FROM "ee_rolemembership"
- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_rolemembership"."organization_member_id" = "posthog_organizationmembership"."id")
- INNER JOIN "ee_role" ON ("ee_rolemembership"."role_id" = "ee_role"."id")
- WHERE ("ee_rolemembership"."user_id" = 99999
- AND ("ee_rolemembership"."organization_member_id" IS NULL
- OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.60
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.57
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -6586,7 +6875,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.61
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.58
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -6602,7 +6891,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.62
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.59
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -6620,7 +6909,29 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.63
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.6
+ '''
+ 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"
+ 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_adding_insights_is_not_nplus1_for_gets.60
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."account_group_type_index" AS "account_group_type_index"
FROM "customer_analytics_teamcustomeranalyticsconfig"
@@ -6629,7 +6940,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.64
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.61
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -6638,7 +6949,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.65
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.62
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -6678,15 +6989,8 @@
"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_adding_insights_is_not_nplus1_for_gets.66
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -6725,12 +7029,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.67
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.63
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -6868,7 +7173,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.68
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.64
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -6923,7 +7228,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.69
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.65
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -6946,29 +7251,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.7
- '''
- 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"
- 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_adding_insights_is_not_nplus1_for_gets.70
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.66
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -7021,7 +7304,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.71
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.67
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -7033,7 +7316,7 @@
OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.72
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.68
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -7055,7 +7338,7 @@
AND "ee_accesscontrol"."role_id" IS NULL)))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.73
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.69
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -7157,7 +7440,23 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.74
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.7
+ '''
+ 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_adding_insights_is_not_nplus1_for_gets.70
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -7180,7 +7479,7 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.75
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.71
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -7201,7 +7500,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.76
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.72
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -7299,7 +7598,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.77
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.73
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -7324,7 +7623,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.78
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.74
'''
SELECT "posthog_filesystemshortcut"."id",
"posthog_filesystemshortcut"."team_id",
@@ -7347,7 +7646,7 @@
AND "posthog_filesystemshortcut"."href" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.79
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.75
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -7367,23 +7666,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.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_adding_insights_is_not_nplus1_for_gets.80
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.76
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -7740,7 +8023,7 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.81
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.77
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -7758,7 +8041,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.82
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.78
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -7779,7 +8062,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.83
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.79
'''
SELECT "posthog_alertconfiguration"."created_by_id",
"posthog_alertconfiguration"."created_at",
@@ -7864,7 +8147,105 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.84
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.8
+ '''
+ 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"."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"
+ FROM "posthog_team"
+ WHERE "posthog_team"."id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.80
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -7877,7 +8258,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.85
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.81
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -7893,7 +8274,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.86
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.82
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -7911,7 +8292,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.87
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.83
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -7951,15 +8332,8 @@
"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_adding_insights_is_not_nplus1_for_gets.88
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -7998,12 +8372,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.89
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.84
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -8141,105 +8516,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.9
- '''
- 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"."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"
- FROM "posthog_team"
- WHERE "posthog_team"."id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.90
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.85
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -8294,7 +8571,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.91
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.86
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -8317,7 +8594,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.92
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.87
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -8370,7 +8647,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.93
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.88
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -8382,7 +8659,7 @@
OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.94
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.89
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -8404,7 +8681,32 @@
AND "ee_accesscontrol"."role_id" IS NULL)))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.95
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.9
+ '''
+ 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" = 'dashboard'
+ AND NOT ("posthog_filesystem"."shortcut"
+ AND "posthog_filesystem"."shortcut" IS NOT NULL))
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.90
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -8424,7 +8726,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.96
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.91
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -8437,7 +8739,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.97
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.92
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -8450,7 +8752,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.98
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.93
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -8482,7 +8784,180 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.99
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.94
+ '''
+ 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"."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"
+ FROM "posthog_team"
+ WHERE "posthog_team"."id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.95
+ '''
+ 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_adding_insights_is_not_nplus1_for_gets.96
+ '''
+ SELECT 1 AS "a"
+ FROM "posthog_sharingconfiguration"
+ WHERE ("posthog_sharingconfiguration"."enabled"
+ AND ("posthog_sharingconfiguration"."expires_at" IS NULL
+ OR "posthog_sharingconfiguration"."expires_at" > 'SHARING-EXPIRY-TIMESTAMP'::timestamptz)
+ AND "posthog_sharingconfiguration"."dashboard_id" = 99999
+ AND "posthog_sharingconfiguration"."team_id" = 99999)
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.97
+ '''
+ SELECT 1 AS "a"
+ FROM "posthog_subscription"
+ WHERE (NOT "posthog_subscription"."deleted"
+ AND "posthog_subscription"."enabled"
+ AND "posthog_subscription"."dashboard_id" = 99999
+ AND NOT (EXISTS
+ (SELECT 1 AS "a"
+ FROM "posthog_subscription_dashboard_export_insights" "U1"
+ INNER JOIN "posthog_dashboarditem" "U2" ON ("U1"."insight_id" = "U2"."id")
+ WHERE (NOT "U2"."deleted"
+ AND "U1"."subscription_id" = ("posthog_subscription"."id"))
+ LIMIT 1)))
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.98
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -8580,6 +9055,31 @@
LIMIT 21
'''
# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.99
+ '''
+ 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_listing_dashboards_is_not_nplus1
'''
SELECT "posthog_user"."id",
@@ -8661,115 +9161,6 @@
'''
# ---
# name: TestDashboard.test_listing_dashboards_is_not_nplus1.100
- '''
- 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.101
- '''
- 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_listing_dashboards_is_not_nplus1.102
- '''
- SELECT "posthog_dashboard"."id" AS "id"
- 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 "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.103
- '''
- SELECT "posthog_dashboard"."id" AS "id",
- "posthog_dashboard"."name" AS "name"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.104
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -8782,7 +9173,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.105
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.101
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -8814,7 +9205,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.106
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.102
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -8912,7 +9303,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.107
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.103
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -8958,7 +9349,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.108
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.104
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -9056,7 +9447,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.109
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.105
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -9081,33 +9472,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.11
- '''
- SELECT "posthog_identityproviderconfig"."id",
- "posthog_identityproviderconfig"."organization_id",
- "posthog_identityproviderconfig"."name",
- "posthog_identityproviderconfig"."domain_scope",
- "posthog_identityproviderconfig"."config_scope",
- "posthog_identityproviderconfig"."created_at",
- "posthog_identityproviderconfig"."updated_at",
- "posthog_identityproviderconfig"."saml_entity_id",
- "posthog_identityproviderconfig"."saml_acs_url",
- "posthog_identityproviderconfig"."saml_x509_cert",
- "posthog_identityproviderconfig"."oidc_issuer_url",
- "posthog_identityproviderconfig"."oidc_client_id",
- "posthog_identityproviderconfig"."oidc_credentials",
- "posthog_identityproviderconfig"."saml_relay_state",
- "posthog_identityproviderconfig"."scim_slug",
- "posthog_identityproviderconfig"."scim_enabled",
- "posthog_identityproviderconfig"."scim_bearer_token",
- "posthog_identityproviderconfig"."id_jag_issuer_url",
- "posthog_identityproviderconfig"."id_jag_jwks_url",
- "posthog_identityproviderconfig"."id_jag_allowed_clients"
- FROM "posthog_identityproviderconfig"
- WHERE "posthog_identityproviderconfig"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.110
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.106
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -9125,7 +9490,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.111
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.107
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -9171,7 +9536,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.112
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.108
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -9269,7 +9634,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.113
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.109
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -9298,7 +9663,33 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.114
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.11
+ '''
+ SELECT "posthog_identityproviderconfig"."id",
+ "posthog_identityproviderconfig"."organization_id",
+ "posthog_identityproviderconfig"."name",
+ "posthog_identityproviderconfig"."domain_scope",
+ "posthog_identityproviderconfig"."config_scope",
+ "posthog_identityproviderconfig"."created_at",
+ "posthog_identityproviderconfig"."updated_at",
+ "posthog_identityproviderconfig"."saml_entity_id",
+ "posthog_identityproviderconfig"."saml_acs_url",
+ "posthog_identityproviderconfig"."saml_x509_cert",
+ "posthog_identityproviderconfig"."oidc_issuer_url",
+ "posthog_identityproviderconfig"."oidc_client_id",
+ "posthog_identityproviderconfig"."oidc_credentials",
+ "posthog_identityproviderconfig"."saml_relay_state",
+ "posthog_identityproviderconfig"."scim_slug",
+ "posthog_identityproviderconfig"."scim_enabled",
+ "posthog_identityproviderconfig"."scim_bearer_token",
+ "posthog_identityproviderconfig"."id_jag_issuer_url",
+ "posthog_identityproviderconfig"."id_jag_jwks_url",
+ "posthog_identityproviderconfig"."id_jag_allowed_clients"
+ FROM "posthog_identityproviderconfig"
+ WHERE "posthog_identityproviderconfig"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.110
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -9327,7 +9718,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.115
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.111
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -9347,7 +9738,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.116
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.112
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -9360,7 +9751,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.117
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.113
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -9376,7 +9767,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.118
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.114
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -9394,7 +9785,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.119
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.115
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -9403,30 +9794,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.12
- '''
- SELECT "posthog_organizationdomain"."id",
- "posthog_organizationdomain"."organization_id",
- "posthog_organizationdomain"."domain",
- "posthog_organizationdomain"."verification_challenge",
- "posthog_organizationdomain"."verified_at",
- "posthog_organizationdomain"."last_verification_retry",
- "posthog_organizationdomain"."jit_provisioning_enabled",
- "posthog_organizationdomain"."sso_enforcement",
- "posthog_organizationdomain"."saml_entity_id",
- "posthog_organizationdomain"."saml_acs_url",
- "posthog_organizationdomain"."saml_x509_cert",
- "posthog_organizationdomain"."scim_enabled",
- "posthog_organizationdomain"."scim_bearer_token",
- "posthog_organizationdomain"."id_jag_issuer_url",
- "posthog_organizationdomain"."id_jag_jwks_url",
- "posthog_organizationdomain"."id_jag_allowed_clients",
- "posthog_organizationdomain"."identity_provider_config_id"
- FROM "posthog_organizationdomain"
- WHERE "posthog_organizationdomain"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.120
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.116
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -9466,15 +9834,8 @@
"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_listing_dashboards_is_not_nplus1.121
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -9513,12 +9874,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.122
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.117
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -9656,7 +10018,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.123
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.118
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -9711,7 +10073,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.124
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.119
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -9734,7 +10096,30 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.125
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.12
+ '''
+ SELECT "posthog_organizationdomain"."id",
+ "posthog_organizationdomain"."organization_id",
+ "posthog_organizationdomain"."domain",
+ "posthog_organizationdomain"."verification_challenge",
+ "posthog_organizationdomain"."verified_at",
+ "posthog_organizationdomain"."last_verification_retry",
+ "posthog_organizationdomain"."jit_provisioning_enabled",
+ "posthog_organizationdomain"."sso_enforcement",
+ "posthog_organizationdomain"."saml_entity_id",
+ "posthog_organizationdomain"."saml_acs_url",
+ "posthog_organizationdomain"."saml_x509_cert",
+ "posthog_organizationdomain"."scim_enabled",
+ "posthog_organizationdomain"."scim_bearer_token",
+ "posthog_organizationdomain"."id_jag_issuer_url",
+ "posthog_organizationdomain"."id_jag_jwks_url",
+ "posthog_organizationdomain"."id_jag_allowed_clients",
+ "posthog_organizationdomain"."identity_provider_config_id"
+ FROM "posthog_organizationdomain"
+ WHERE "posthog_organizationdomain"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.120
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -9787,7 +10172,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.126
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.121
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -9807,7 +10192,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.127
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.122
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -9820,7 +10205,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.128
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.123
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -9833,7 +10218,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.129
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.124
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -9865,30 +10250,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.13
- '''
- SELECT "posthog_organizationdomain"."id",
- "posthog_organizationdomain"."organization_id",
- "posthog_organizationdomain"."domain",
- "posthog_organizationdomain"."verification_challenge",
- "posthog_organizationdomain"."verified_at",
- "posthog_organizationdomain"."last_verification_retry",
- "posthog_organizationdomain"."jit_provisioning_enabled",
- "posthog_organizationdomain"."sso_enforcement",
- "posthog_organizationdomain"."saml_entity_id",
- "posthog_organizationdomain"."saml_acs_url",
- "posthog_organizationdomain"."saml_x509_cert",
- "posthog_organizationdomain"."scim_enabled",
- "posthog_organizationdomain"."scim_bearer_token",
- "posthog_organizationdomain"."id_jag_issuer_url",
- "posthog_organizationdomain"."id_jag_jwks_url",
- "posthog_organizationdomain"."id_jag_allowed_clients",
- "posthog_organizationdomain"."identity_provider_config_id"
- FROM "posthog_organizationdomain"
- WHERE "posthog_organizationdomain"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.130
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.125
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -9986,7 +10348,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.131
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.126
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -10032,7 +10394,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.132
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.127
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -10130,7 +10492,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.133
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.128
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -10155,7 +10517,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.134
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.129
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -10173,7 +10535,30 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.135
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.13
+ '''
+ SELECT "posthog_organizationdomain"."id",
+ "posthog_organizationdomain"."organization_id",
+ "posthog_organizationdomain"."domain",
+ "posthog_organizationdomain"."verification_challenge",
+ "posthog_organizationdomain"."verified_at",
+ "posthog_organizationdomain"."last_verification_retry",
+ "posthog_organizationdomain"."jit_provisioning_enabled",
+ "posthog_organizationdomain"."sso_enforcement",
+ "posthog_organizationdomain"."saml_entity_id",
+ "posthog_organizationdomain"."saml_acs_url",
+ "posthog_organizationdomain"."saml_x509_cert",
+ "posthog_organizationdomain"."scim_enabled",
+ "posthog_organizationdomain"."scim_bearer_token",
+ "posthog_organizationdomain"."id_jag_issuer_url",
+ "posthog_organizationdomain"."id_jag_jwks_url",
+ "posthog_organizationdomain"."id_jag_allowed_clients",
+ "posthog_organizationdomain"."identity_provider_config_id"
+ FROM "posthog_organizationdomain"
+ WHERE "posthog_organizationdomain"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.130
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -10219,7 +10604,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.136
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.131
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -10317,7 +10702,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.137
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.132
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -10346,7 +10731,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.138
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.133
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -10375,7 +10760,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.139
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.134
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -10395,24 +10780,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.14
- '''
- SELECT "posthog_roleexternalreference"."id",
- "posthog_roleexternalreference"."organization_id",
- "posthog_roleexternalreference"."role_id",
- "posthog_roleexternalreference"."provider",
- "posthog_roleexternalreference"."provider_organization_id",
- "posthog_roleexternalreference"."provider_role_id",
- "posthog_roleexternalreference"."provider_role_slug",
- "posthog_roleexternalreference"."provider_role_name",
- "posthog_roleexternalreference"."created_at",
- "posthog_roleexternalreference"."updated_at",
- "posthog_roleexternalreference"."created_by_id"
- FROM "posthog_roleexternalreference"
- WHERE "posthog_roleexternalreference"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.140
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.135
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -10425,7 +10793,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.141
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.136
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -10441,7 +10809,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.142
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.137
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -10459,7 +10827,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.143
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.138
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -10468,7 +10836,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.144
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.139
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -10508,15 +10876,8 @@
"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_listing_dashboards_is_not_nplus1.145
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -10555,12 +10916,30 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.146
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.14
+ '''
+ SELECT "posthog_roleexternalreference"."id",
+ "posthog_roleexternalreference"."organization_id",
+ "posthog_roleexternalreference"."role_id",
+ "posthog_roleexternalreference"."provider",
+ "posthog_roleexternalreference"."provider_organization_id",
+ "posthog_roleexternalreference"."provider_role_id",
+ "posthog_roleexternalreference"."provider_role_slug",
+ "posthog_roleexternalreference"."provider_role_name",
+ "posthog_roleexternalreference"."created_at",
+ "posthog_roleexternalreference"."updated_at",
+ "posthog_roleexternalreference"."created_by_id"
+ FROM "posthog_roleexternalreference"
+ WHERE "posthog_roleexternalreference"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.140
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -10698,7 +11077,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.147
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.141
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -10753,7 +11132,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.148
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.142
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -10776,7 +11155,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.149
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.143
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -10829,24 +11208,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.15
- '''
- SELECT "posthog_roleexternalreference"."id",
- "posthog_roleexternalreference"."organization_id",
- "posthog_roleexternalreference"."role_id",
- "posthog_roleexternalreference"."provider",
- "posthog_roleexternalreference"."provider_organization_id",
- "posthog_roleexternalreference"."provider_role_id",
- "posthog_roleexternalreference"."provider_role_slug",
- "posthog_roleexternalreference"."provider_role_name",
- "posthog_roleexternalreference"."created_at",
- "posthog_roleexternalreference"."updated_at",
- "posthog_roleexternalreference"."created_by_id"
- FROM "posthog_roleexternalreference"
- WHERE "posthog_roleexternalreference"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.150
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.144
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboard"
@@ -10860,7 +11222,7 @@
AND NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.151
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.145
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -10965,7 +11327,7 @@
LIMIT 300
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.152
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.146
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -10988,7 +11350,7 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.153
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.147
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -11009,7 +11371,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.154
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.148
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -11049,15 +11411,8 @@
"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_listing_dashboards_is_not_nplus1.155
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -11096,12 +11451,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.156
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.149
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -11239,7 +11595,24 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.157
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.15
+ '''
+ SELECT "posthog_roleexternalreference"."id",
+ "posthog_roleexternalreference"."organization_id",
+ "posthog_roleexternalreference"."role_id",
+ "posthog_roleexternalreference"."provider",
+ "posthog_roleexternalreference"."provider_organization_id",
+ "posthog_roleexternalreference"."provider_role_id",
+ "posthog_roleexternalreference"."provider_role_slug",
+ "posthog_roleexternalreference"."provider_role_name",
+ "posthog_roleexternalreference"."created_at",
+ "posthog_roleexternalreference"."updated_at",
+ "posthog_roleexternalreference"."created_by_id"
+ FROM "posthog_roleexternalreference"
+ WHERE "posthog_roleexternalreference"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.150
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -11294,7 +11667,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.158
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.151
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -11317,7 +11690,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.159
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.152
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -11370,23 +11743,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.16
- '''
- SELECT "posthog_proxyrecord"."id",
- "posthog_proxyrecord"."organization_id",
- "posthog_proxyrecord"."domain",
- "posthog_proxyrecord"."target_cname",
- "posthog_proxyrecord"."root_redirect_url",
- "posthog_proxyrecord"."message",
- "posthog_proxyrecord"."status",
- "posthog_proxyrecord"."created_by_id",
- "posthog_proxyrecord"."created_at",
- "posthog_proxyrecord"."updated_at"
- FROM "posthog_proxyrecord"
- WHERE "posthog_proxyrecord"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.160
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.153
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboard"
@@ -11402,7 +11759,7 @@
AND NOT "posthog_dashboard"."deleted")
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.161
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.154
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -11500,7 +11857,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.162
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.155
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -11525,7 +11882,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.163
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.156
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -11537,7 +11894,7 @@
AND NOT ("posthog_dashboardtile"."insight_id" IS NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.164
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.157
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -11556,7 +11913,7 @@
WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.165
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.158
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_taggeditem"
@@ -11564,7 +11921,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.166
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.159
'''
SELECT "posthog_dashboardtile"."group_key" AS "group_key"
FROM "posthog_dashboardtile"
@@ -11578,7 +11935,23 @@
OR "posthog_dashboardtile"."insight_id" IS NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.167
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.16
+ '''
+ SELECT "posthog_proxyrecord"."id",
+ "posthog_proxyrecord"."organization_id",
+ "posthog_proxyrecord"."domain",
+ "posthog_proxyrecord"."target_cname",
+ "posthog_proxyrecord"."root_redirect_url",
+ "posthog_proxyrecord"."message",
+ "posthog_proxyrecord"."status",
+ "posthog_proxyrecord"."created_by_id",
+ "posthog_proxyrecord"."created_at",
+ "posthog_proxyrecord"."updated_at"
+ FROM "posthog_proxyrecord"
+ WHERE "posthog_proxyrecord"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.160
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -11594,7 +11967,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.168
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.161
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -11610,7 +11983,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.169
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.162
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -11626,23 +11999,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.17
- '''
- SELECT "posthog_proxyrecord"."id",
- "posthog_proxyrecord"."organization_id",
- "posthog_proxyrecord"."domain",
- "posthog_proxyrecord"."target_cname",
- "posthog_proxyrecord"."root_redirect_url",
- "posthog_proxyrecord"."message",
- "posthog_proxyrecord"."status",
- "posthog_proxyrecord"."created_by_id",
- "posthog_proxyrecord"."created_at",
- "posthog_proxyrecord"."updated_at"
- FROM "posthog_proxyrecord"
- WHERE "posthog_proxyrecord"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.170
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.163
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -11661,7 +12018,7 @@
WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.171
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.164
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -11681,7 +12038,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.172
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.165
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -12038,7 +12395,7 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.173
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.166
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -12047,7 +12404,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.174
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.167
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -12087,15 +12444,8 @@
"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_listing_dashboards_is_not_nplus1.175
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -12134,12 +12484,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.176
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.168
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -12277,7 +12628,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.177
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.169
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -12332,7 +12683,23 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.178
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.17
+ '''
+ SELECT "posthog_proxyrecord"."id",
+ "posthog_proxyrecord"."organization_id",
+ "posthog_proxyrecord"."domain",
+ "posthog_proxyrecord"."target_cname",
+ "posthog_proxyrecord"."root_redirect_url",
+ "posthog_proxyrecord"."message",
+ "posthog_proxyrecord"."status",
+ "posthog_proxyrecord"."created_by_id",
+ "posthog_proxyrecord"."created_at",
+ "posthog_proxyrecord"."updated_at"
+ FROM "posthog_proxyrecord"
+ WHERE "posthog_proxyrecord"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.170
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -12355,7 +12722,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.179
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.171
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -12408,26 +12775,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.18
- '''
- SELECT "legal_documents_legaldocument"."created_by_id",
- "legal_documents_legaldocument"."created_at",
- "legal_documents_legaldocument"."updated_at",
- "legal_documents_legaldocument"."id",
- "legal_documents_legaldocument"."organization_id",
- "legal_documents_legaldocument"."document_type",
- "legal_documents_legaldocument"."company_name",
- "legal_documents_legaldocument"."company_address",
- "legal_documents_legaldocument"."representative_email",
- "legal_documents_legaldocument"."status",
- "legal_documents_legaldocument"."pandadoc_document_id",
- "legal_documents_legaldocument"."signed_pdf_stored"
- FROM "legal_documents_legaldocument"
- WHERE "legal_documents_legaldocument"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- ORDER BY "legal_documents_legaldocument"."created_at" DESC
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.180
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.172
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -12447,7 +12795,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.181
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.173
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -12460,7 +12808,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.182
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.174
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -12473,7 +12821,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.183
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.175
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -12505,7 +12853,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.184
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.176
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -12603,7 +12951,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.185
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.177
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -12649,7 +12997,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.186
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.178
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -12747,7 +13095,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.187
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.179
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -12772,7 +13120,26 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.188
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.18
+ '''
+ SELECT "legal_documents_legaldocument"."created_by_id",
+ "legal_documents_legaldocument"."created_at",
+ "legal_documents_legaldocument"."updated_at",
+ "legal_documents_legaldocument"."id",
+ "legal_documents_legaldocument"."organization_id",
+ "legal_documents_legaldocument"."document_type",
+ "legal_documents_legaldocument"."company_name",
+ "legal_documents_legaldocument"."company_address",
+ "legal_documents_legaldocument"."representative_email",
+ "legal_documents_legaldocument"."status",
+ "legal_documents_legaldocument"."pandadoc_document_id",
+ "legal_documents_legaldocument"."signed_pdf_stored"
+ FROM "legal_documents_legaldocument"
+ WHERE "legal_documents_legaldocument"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ ORDER BY "legal_documents_legaldocument"."created_at" DESC
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.180
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -12790,7 +13157,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.189
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.181
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -12836,26 +13203,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.19
- '''
- SELECT "legal_documents_legaldocument"."created_by_id",
- "legal_documents_legaldocument"."created_at",
- "legal_documents_legaldocument"."updated_at",
- "legal_documents_legaldocument"."id",
- "legal_documents_legaldocument"."organization_id",
- "legal_documents_legaldocument"."document_type",
- "legal_documents_legaldocument"."company_name",
- "legal_documents_legaldocument"."company_address",
- "legal_documents_legaldocument"."representative_email",
- "legal_documents_legaldocument"."status",
- "legal_documents_legaldocument"."pandadoc_document_id",
- "legal_documents_legaldocument"."signed_pdf_stored"
- FROM "legal_documents_legaldocument"
- WHERE "legal_documents_legaldocument"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- ORDER BY "legal_documents_legaldocument"."created_at" DESC
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.190
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.182
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -12953,7 +13301,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.191
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.183
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -12982,7 +13330,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.192
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.184
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -13011,7 +13359,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.193
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.185
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -13031,7 +13379,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.194
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.186
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -13044,7 +13392,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.195
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.187
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -13060,7 +13408,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.196
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.188
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -13078,7 +13426,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.197
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.189
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -13087,7 +13435,26 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.198
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.19
+ '''
+ SELECT "legal_documents_legaldocument"."created_by_id",
+ "legal_documents_legaldocument"."created_at",
+ "legal_documents_legaldocument"."updated_at",
+ "legal_documents_legaldocument"."id",
+ "legal_documents_legaldocument"."organization_id",
+ "legal_documents_legaldocument"."document_type",
+ "legal_documents_legaldocument"."company_name",
+ "legal_documents_legaldocument"."company_address",
+ "legal_documents_legaldocument"."representative_email",
+ "legal_documents_legaldocument"."status",
+ "legal_documents_legaldocument"."pandadoc_document_id",
+ "legal_documents_legaldocument"."signed_pdf_stored"
+ FROM "legal_documents_legaldocument"
+ WHERE "legal_documents_legaldocument"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ ORDER BY "legal_documents_legaldocument"."created_at" DESC
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.190
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -13127,61 +13494,8 @@
"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_listing_dashboards_is_not_nplus1.199
- '''
- 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_listing_dashboards_is_not_nplus1.2
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -13220,34 +13534,13 @@
"posthog_organization"."personalization",
"posthog_organization"."domain_whitelist",
"posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
- ORDER BY "posthog_organization"."id" ASC
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.20
- '''
- SELECT "growth_productpushcampaign"."updated_at",
- "growth_productpushcampaign"."id",
- "growth_productpushcampaign"."organization_id",
- "growth_productpushcampaign"."created_by_id",
- "growth_productpushcampaign"."product_key",
- "growth_productpushcampaign"."status",
- "growth_productpushcampaign"."position",
- "growth_productpushcampaign"."scheduled_for",
- "growth_productpushcampaign"."started_at",
- "growth_productpushcampaign"."ends_at",
- "growth_productpushcampaign"."ended_at",
- "growth_productpushcampaign"."source",
- "growth_productpushcampaign"."reason_text",
- "growth_productpushcampaign"."metadata",
- "growth_productpushcampaign"."created_at"
- FROM "growth_productpushcampaign"
- WHERE "growth_productpushcampaign"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.200
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.191
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -13385,7 +13678,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.201
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.192
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -13440,7 +13733,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.202
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.193
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -13463,7 +13756,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.203
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.194
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -13516,7 +13809,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.204
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.195
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -13536,7 +13829,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.205
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.196
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -13549,7 +13842,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.206
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.197
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -13562,7 +13855,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.207
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.198
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -13594,7 +13887,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.208
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.199
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -13692,7 +13985,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.209
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.2
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -13735,10 +14028,11 @@
"posthog_organization"."is_platform"
FROM "posthog_organization"
WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
- LIMIT 21
+ ORDER BY "posthog_organization"."id" ASC
+ LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.21
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.20
'''
SELECT "growth_productpushcampaign"."updated_at",
"growth_productpushcampaign"."id",
@@ -13759,7 +14053,53 @@
WHERE "growth_productpushcampaign"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.210
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.200
+ '''
+ 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_listing_dashboards_is_not_nplus1.201
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -13857,7 +14197,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.211
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.202
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -13882,7 +14222,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.212
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.203
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -13900,7 +14240,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.213
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.204
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -13946,7 +14286,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.214
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.205
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -14044,7 +14384,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.215
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.206
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -14073,7 +14413,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.216
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.207
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -14102,7 +14442,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.217
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.208
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -14122,7 +14462,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.218
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.209
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -14135,7 +14475,28 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.219
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.21
+ '''
+ SELECT "growth_productpushcampaign"."updated_at",
+ "growth_productpushcampaign"."id",
+ "growth_productpushcampaign"."organization_id",
+ "growth_productpushcampaign"."created_by_id",
+ "growth_productpushcampaign"."product_key",
+ "growth_productpushcampaign"."status",
+ "growth_productpushcampaign"."position",
+ "growth_productpushcampaign"."scheduled_for",
+ "growth_productpushcampaign"."started_at",
+ "growth_productpushcampaign"."ends_at",
+ "growth_productpushcampaign"."ended_at",
+ "growth_productpushcampaign"."source",
+ "growth_productpushcampaign"."reason_text",
+ "growth_productpushcampaign"."metadata",
+ "growth_productpushcampaign"."created_at"
+ FROM "growth_productpushcampaign"
+ WHERE "growth_productpushcampaign"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.210
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -14151,19 +14512,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.22
- '''
- SELECT "growth_organizationenrichmentfetch"."id",
- "growth_organizationenrichmentfetch"."organization_id",
- "growth_organizationenrichmentfetch"."provider",
- "growth_organizationenrichmentfetch"."fetched_at",
- "growth_organizationenrichmentfetch"."is_recheck",
- "growth_organizationenrichmentfetch"."payload"
- FROM "growth_organizationenrichmentfetch"
- WHERE "growth_organizationenrichmentfetch"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.220
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.211
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -14181,7 +14530,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.221
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.212
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -14190,7 +14539,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.222
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.213
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -14230,15 +14579,8 @@
"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_listing_dashboards_is_not_nplus1.223
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -14277,12 +14619,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.224
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.214
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -14420,7 +14763,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.225
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.215
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -14475,7 +14818,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.226
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.216
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -14498,7 +14841,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.227
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.217
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -14551,7 +14894,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.228
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.218
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -14571,7 +14914,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.229
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.219
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -14584,7 +14927,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.23
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.22
'''
SELECT "growth_organizationenrichmentfetch"."id",
"growth_organizationenrichmentfetch"."organization_id",
@@ -14596,7 +14939,7 @@
WHERE "growth_organizationenrichmentfetch"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.230
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.220
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -14609,7 +14952,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.231
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.221
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -14641,7 +14984,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.232
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.222
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -14739,7 +15082,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.233
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.223
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -14785,7 +15128,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.234
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.224
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -14883,7 +15226,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.235
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.225
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -14908,7 +15251,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.236
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.226
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -14926,7 +15269,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.237
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.227
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -14972,7 +15315,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.238
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.228
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -15070,7 +15413,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.239
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.229
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -15099,23 +15442,19 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.24
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.23
'''
- SELECT "growth_enrichmentlabelresult"."id",
- "growth_enrichmentlabelresult"."organization_id",
- "growth_enrichmentlabelresult"."fetch_id",
- "growth_enrichmentlabelresult"."label_name",
- "growth_enrichmentlabelresult"."prompt_version",
- "growth_enrichmentlabelresult"."prompt_hash",
- "growth_enrichmentlabelresult"."model",
- "growth_enrichmentlabelresult"."output",
- "growth_enrichmentlabelresult"."inputs",
- "growth_enrichmentlabelresult"."created_at"
- FROM "growth_enrichmentlabelresult"
- WHERE "growth_enrichmentlabelresult"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ SELECT "growth_organizationenrichmentfetch"."id",
+ "growth_organizationenrichmentfetch"."organization_id",
+ "growth_organizationenrichmentfetch"."provider",
+ "growth_organizationenrichmentfetch"."fetched_at",
+ "growth_organizationenrichmentfetch"."is_recheck",
+ "growth_organizationenrichmentfetch"."payload"
+ FROM "growth_organizationenrichmentfetch"
+ WHERE "growth_organizationenrichmentfetch"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.240
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.230
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -15144,7 +15483,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.241
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.231
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -15164,7 +15503,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.242
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.232
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -15177,7 +15516,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.243
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.233
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -15193,7 +15532,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.244
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.234
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -15211,7 +15550,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.245
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.235
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -15220,7 +15559,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.246
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.236
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -15260,15 +15599,8 @@
"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_listing_dashboards_is_not_nplus1.247
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -15307,12 +15639,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.248
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.237
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -15450,7 +15783,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.249
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.238
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -15505,23 +15838,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.25
- '''
- SELECT "growth_enrichmentlabelresult"."id",
- "growth_enrichmentlabelresult"."organization_id",
- "growth_enrichmentlabelresult"."fetch_id",
- "growth_enrichmentlabelresult"."label_name",
- "growth_enrichmentlabelresult"."prompt_version",
- "growth_enrichmentlabelresult"."prompt_hash",
- "growth_enrichmentlabelresult"."model",
- "growth_enrichmentlabelresult"."output",
- "growth_enrichmentlabelresult"."inputs",
- "growth_enrichmentlabelresult"."created_at"
- FROM "growth_enrichmentlabelresult"
- WHERE "growth_enrichmentlabelresult"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.250
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.239
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -15544,7 +15861,23 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.251
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.24
+ '''
+ SELECT "growth_enrichmentlabelresult"."id",
+ "growth_enrichmentlabelresult"."organization_id",
+ "growth_enrichmentlabelresult"."fetch_id",
+ "growth_enrichmentlabelresult"."label_name",
+ "growth_enrichmentlabelresult"."prompt_version",
+ "growth_enrichmentlabelresult"."prompt_hash",
+ "growth_enrichmentlabelresult"."model",
+ "growth_enrichmentlabelresult"."output",
+ "growth_enrichmentlabelresult"."inputs",
+ "growth_enrichmentlabelresult"."created_at"
+ FROM "growth_enrichmentlabelresult"
+ WHERE "growth_enrichmentlabelresult"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.240
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -15597,7 +15930,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.252
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.241
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboard"
@@ -15611,7 +15944,7 @@
AND NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.253
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.242
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -15716,7 +16049,7 @@
LIMIT 300
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.254
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.243
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -15739,7 +16072,7 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.255
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.244
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -15760,7 +16093,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.256
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.245
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -15800,15 +16133,8 @@
"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_listing_dashboards_is_not_nplus1.257
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -15847,12 +16173,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.258
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.246
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -15990,7 +16317,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.259
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.247
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -16045,20 +16372,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.26
- '''
- SELECT "ee_organizationresourceaccess"."id",
- "ee_organizationresourceaccess"."resource",
- "ee_organizationresourceaccess"."access_level",
- "ee_organizationresourceaccess"."organization_id",
- "ee_organizationresourceaccess"."created_by_id",
- "ee_organizationresourceaccess"."created_at",
- "ee_organizationresourceaccess"."updated_at"
- FROM "ee_organizationresourceaccess"
- WHERE "ee_organizationresourceaccess"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.260
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.248
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -16081,7 +16395,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.261
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.249
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -16134,7 +16448,23 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.262
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.25
+ '''
+ SELECT "growth_enrichmentlabelresult"."id",
+ "growth_enrichmentlabelresult"."organization_id",
+ "growth_enrichmentlabelresult"."fetch_id",
+ "growth_enrichmentlabelresult"."label_name",
+ "growth_enrichmentlabelresult"."prompt_version",
+ "growth_enrichmentlabelresult"."prompt_hash",
+ "growth_enrichmentlabelresult"."model",
+ "growth_enrichmentlabelresult"."output",
+ "growth_enrichmentlabelresult"."inputs",
+ "growth_enrichmentlabelresult"."created_at"
+ FROM "growth_enrichmentlabelresult"
+ WHERE "growth_enrichmentlabelresult"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.250
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboard"
@@ -16150,7 +16480,7 @@
AND NOT "posthog_dashboard"."deleted")
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.263
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.251
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -16248,7 +16578,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.264
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.252
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -16273,7 +16603,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.265
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.253
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -16285,7 +16615,7 @@
AND NOT ("posthog_dashboardtile"."insight_id" IS NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.266
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.254
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -16304,7 +16634,7 @@
WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.267
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.255
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_taggeditem"
@@ -16312,7 +16642,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.268
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.256
'''
SELECT "posthog_dashboardtile"."group_key" AS "group_key"
FROM "posthog_dashboardtile"
@@ -16326,7 +16656,7 @@
OR "posthog_dashboardtile"."insight_id" IS NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.269
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.257
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -16342,20 +16672,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.27
- '''
- SELECT "ee_organizationresourceaccess"."id",
- "ee_organizationresourceaccess"."resource",
- "ee_organizationresourceaccess"."access_level",
- "ee_organizationresourceaccess"."organization_id",
- "ee_organizationresourceaccess"."created_by_id",
- "ee_organizationresourceaccess"."created_at",
- "ee_organizationresourceaccess"."updated_at"
- FROM "ee_organizationresourceaccess"
- WHERE "ee_organizationresourceaccess"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.270
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.258
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -16371,7 +16688,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.271
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.259
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -16387,7 +16704,20 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.272
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.26
+ '''
+ SELECT "ee_organizationresourceaccess"."id",
+ "ee_organizationresourceaccess"."resource",
+ "ee_organizationresourceaccess"."access_level",
+ "ee_organizationresourceaccess"."organization_id",
+ "ee_organizationresourceaccess"."created_by_id",
+ "ee_organizationresourceaccess"."created_at",
+ "ee_organizationresourceaccess"."updated_at"
+ FROM "ee_organizationresourceaccess"
+ WHERE "ee_organizationresourceaccess"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.260
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -16406,7 +16736,7 @@
WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.273
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.261
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -16426,7 +16756,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.274
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.262
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -16783,7 +17113,7 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.275
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.263
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -16792,7 +17122,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.276
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.264
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -16832,15 +17162,8 @@
"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_listing_dashboards_is_not_nplus1.277
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -16879,12 +17202,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.278
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.265
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -17022,7 +17346,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.279
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.266
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -17077,16 +17401,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.28
- '''
- SELECT "posthog_team"."organization_id" AS "organization_id"
- FROM "posthog_team"
- WHERE "posthog_team"."id" = 99999
- ORDER BY "posthog_team"."id" ASC
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.280
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.267
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -17109,7 +17424,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.281
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.268
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -17162,7 +17477,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.282
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.269
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -17182,7 +17497,20 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.283
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.27
+ '''
+ SELECT "ee_organizationresourceaccess"."id",
+ "ee_organizationresourceaccess"."resource",
+ "ee_organizationresourceaccess"."access_level",
+ "ee_organizationresourceaccess"."organization_id",
+ "ee_organizationresourceaccess"."created_by_id",
+ "ee_organizationresourceaccess"."created_at",
+ "ee_organizationresourceaccess"."updated_at"
+ FROM "ee_organizationresourceaccess"
+ WHERE "ee_organizationresourceaccess"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.270
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -17195,7 +17523,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.284
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.271
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -17208,7 +17536,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.285
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.272
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -17240,7 +17568,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.286
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.273
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -17338,7 +17666,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.287
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.274
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -17384,7 +17712,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.288
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.275
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -17482,7 +17810,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.289
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.276
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -17507,20 +17835,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.29
- '''
- 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"
- FROM "posthog_organizationmembership"
- WHERE "posthog_organizationmembership"."user_id" = 99999
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.290
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.277
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -17538,7 +17853,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.291
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.278
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -17584,7 +17899,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.292
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.279
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -17682,7 +17997,16 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.293
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.28
+ '''
+ SELECT "posthog_team"."organization_id" AS "organization_id"
+ FROM "posthog_team"
+ WHERE "posthog_team"."id" = 99999
+ ORDER BY "posthog_team"."id" ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.280
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -17711,7 +18035,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.294
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.281
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -17740,7 +18064,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.295
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.282
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -17760,7 +18084,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.296
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.283
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -17773,7 +18097,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.297
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.284
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -17789,7 +18113,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.298
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.285
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -17807,7 +18131,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.299
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.286
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -17816,31 +18140,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.3
- '''
- SELECT "posthog_organization"."is_active" AS "is_active",
- "posthog_organization"."has_active_subscription" AS "has_active_subscription"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
- ORDER BY "posthog_organization"."id" ASC
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.30
- '''
- 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"
- FROM "posthog_organizationmembership"
- WHERE "posthog_organizationmembership"."id" = '00000000000000000000000000000000'::uuid
- LIMIT 21
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.300
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.287
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -17880,15 +18180,8 @@
"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_listing_dashboards_is_not_nplus1.301
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -17927,12 +18220,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.302
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.288
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -18070,7 +18364,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.303
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.289
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -18125,7 +18419,20 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.304
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.29
+ '''
+ 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"
+ FROM "posthog_organizationmembership"
+ WHERE "posthog_organizationmembership"."user_id" = 99999
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.290
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -18148,7 +18455,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.305
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.291
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -18201,7 +18508,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.306
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.292
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -18221,7 +18528,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.307
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.293
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -18234,7 +18541,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.308
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.294
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -18247,7 +18554,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.309
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.295
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -18279,15 +18586,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.31
- '''
- SELECT "posthog_team"."id" AS "id"
- FROM "posthog_team"
- WHERE ("posthog_team"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_team"."receive_org_level_activity_logs")
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.310
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.296
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -18385,7 +18684,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.311
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.297
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -18431,7 +18730,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.312
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.298
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -18529,7 +18828,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.313
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.299
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -18554,7 +18853,31 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.314
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.3
+ '''
+ SELECT "posthog_organization"."is_active" AS "is_active",
+ "posthog_organization"."has_active_subscription" AS "has_active_subscription"
+ FROM "posthog_organization"
+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ ORDER BY "posthog_organization"."id" ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.30
+ '''
+ 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"
+ FROM "posthog_organizationmembership"
+ WHERE "posthog_organizationmembership"."id" = '00000000000000000000000000000000'::uuid
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.300
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -18572,7 +18895,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.315
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.301
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -18618,183 +18941,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.316
- '''
- 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"."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"
- FROM "posthog_team"
- WHERE "posthog_team"."id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.317
- '''
- SELECT "posthog_dashboardtile"."id",
- "posthog_dashboardtile"."dashboard_id",
- "posthog_dashboardtile"."insight_id",
- "posthog_dashboardtile"."text_id",
- "posthog_dashboardtile"."button_tile_id",
- "posthog_dashboardtile"."widget_id",
- "posthog_dashboardtile"."team_id",
- "posthog_dashboardtile"."layouts",
- "posthog_dashboardtile"."color",
- "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_listing_dashboards_is_not_nplus1.318
- '''
- SELECT "posthog_dashboardtile"."id",
- "posthog_dashboardtile"."dashboard_id",
- "posthog_dashboardtile"."insight_id",
- "posthog_dashboardtile"."text_id",
- "posthog_dashboardtile"."button_tile_id",
- "posthog_dashboardtile"."widget_id",
- "posthog_dashboardtile"."team_id",
- "posthog_dashboardtile"."layouts",
- "posthog_dashboardtile"."color",
- "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_listing_dashboards_is_not_nplus1.319
- '''
- 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_listing_dashboards_is_not_nplus1.32
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.302
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -18888,12 +19035,89 @@
"posthog_team"."base_currency",
"posthog_team"."business_model"
FROM "posthog_team"
- WHERE "posthog_team"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- ORDER BY "posthog_team"."id" ASC
- LIMIT 1
+ WHERE "posthog_team"."id" = 99999
+ LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.320
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.303
+ '''
+ SELECT "posthog_dashboardtile"."id",
+ "posthog_dashboardtile"."dashboard_id",
+ "posthog_dashboardtile"."insight_id",
+ "posthog_dashboardtile"."text_id",
+ "posthog_dashboardtile"."button_tile_id",
+ "posthog_dashboardtile"."widget_id",
+ "posthog_dashboardtile"."team_id",
+ "posthog_dashboardtile"."layouts",
+ "posthog_dashboardtile"."color",
+ "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_listing_dashboards_is_not_nplus1.304
+ '''
+ SELECT "posthog_dashboardtile"."id",
+ "posthog_dashboardtile"."dashboard_id",
+ "posthog_dashboardtile"."insight_id",
+ "posthog_dashboardtile"."text_id",
+ "posthog_dashboardtile"."button_tile_id",
+ "posthog_dashboardtile"."widget_id",
+ "posthog_dashboardtile"."team_id",
+ "posthog_dashboardtile"."layouts",
+ "posthog_dashboardtile"."color",
+ "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_listing_dashboards_is_not_nplus1.305
+ '''
+ 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_listing_dashboards_is_not_nplus1.306
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -18906,7 +19130,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.321
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.307
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -18922,7 +19146,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.322
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.308
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -18940,7 +19164,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.323
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.309
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -18949,7 +19173,15 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.324
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.31
+ '''
+ SELECT "posthog_team"."id" AS "id"
+ FROM "posthog_team"
+ WHERE ("posthog_team"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_team"."receive_org_level_activity_logs")
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.310
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -18989,15 +19221,8 @@
"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_listing_dashboards_is_not_nplus1.325
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -19036,12 +19261,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.326
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.311
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -19179,7 +19405,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.327
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.312
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -19234,7 +19460,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.328
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.313
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -19257,7 +19483,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.329
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.314
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -19310,54 +19536,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.33
- '''
- 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"."id" = 99999
- ORDER BY "posthog_user"."id" ASC
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.330
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.315
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -19377,7 +19556,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.331
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.316
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -19390,7 +19569,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.332
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.317
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -19403,7 +19582,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.333
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.318
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -19435,7 +19614,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.334
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.319
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -19533,7 +19712,106 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.335
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.32
+ '''
+ 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"."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"
+ FROM "posthog_team"
+ WHERE "posthog_team"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ ORDER BY "posthog_team"."id" ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.320
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -19579,7 +19857,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.336
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.321
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -19677,7 +19955,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.337
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.322
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -19702,7 +19980,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.338
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.323
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -19720,7 +19998,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.339
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.324
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -19761,67 +20039,12 @@
"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_listing_dashboards_is_not_nplus1.34
- '''
- 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)
+ FROM "posthog_organization"
+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.340
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.325
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -19919,7 +20142,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.341
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.326
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -19948,7 +20171,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.342
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.327
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -19977,7 +20200,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.343
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.328
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -19997,7 +20220,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.344
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.329
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -20010,7 +20233,54 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.345
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.33
+ '''
+ 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"."id" = 99999
+ ORDER BY "posthog_user"."id" ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.330
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -20026,7 +20296,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.346
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.331
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -20044,7 +20314,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.347
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.332
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -20053,7 +20323,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.348
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.333
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -20093,15 +20363,8 @@
"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_listing_dashboards_is_not_nplus1.349
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -20140,109 +20403,13 @@
"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_listing_dashboards_is_not_nplus1.35
- '''
- 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"."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"
- FROM "posthog_team"
- WHERE "posthog_team"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.350
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.334
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -20380,7 +20547,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.351
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.335
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -20435,7 +20602,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.352
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.336
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -20458,7 +20625,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.353
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.337
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -20511,7 +20678,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.354
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.338
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboard"
@@ -20525,7 +20692,7 @@
AND NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.355
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.339
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -20630,7 +20797,62 @@
LIMIT 300
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.356
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.34
+ '''
+ 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: TestDashboard.test_listing_dashboards_is_not_nplus1.340
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -20653,7 +20875,7 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.357
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.341
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -20674,7 +20896,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.358
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.342
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -20714,15 +20936,8 @@
"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_listing_dashboards_is_not_nplus1.359
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -20761,26 +20976,13 @@
"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_listing_dashboards_is_not_nplus1.36
- '''
- SELECT 1 AS "a"
- FROM "posthog_filesystemshortcut"
- INNER JOIN "posthog_team" ON ("posthog_filesystemshortcut"."team_id" = "posthog_team"."id")
- WHERE (("posthog_filesystemshortcut"."surface" IS NULL
- OR "posthog_filesystemshortcut"."surface" = 'web')
- AND "posthog_team"."project_id" = 99999
- AND "posthog_filesystemshortcut"."user_id" = 99999
- AND "posthog_filesystemshortcut"."ref" IS NULL
- AND NOT ("posthog_filesystemshortcut"."type" = 'folder'))
- LIMIT 1
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.360
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.343
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -20918,7 +21120,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.361
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.344
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -20973,7 +21175,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.362
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.345
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -20996,7 +21198,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.363
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.346
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -21049,7 +21251,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.364
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.347
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboard"
@@ -21065,7 +21267,7 @@
AND NOT "posthog_dashboard"."deleted")
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.365
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.348
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -21163,7 +21365,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.366
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.349
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -21188,7 +21390,104 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.367
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.35
+ '''
+ 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"."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"
+ FROM "posthog_team"
+ WHERE "posthog_team"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.350
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -21200,7 +21499,7 @@
AND NOT ("posthog_dashboardtile"."insight_id" IS NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.368
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.351
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -21219,7 +21518,7 @@
WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.369
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.352
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_taggeditem"
@@ -21227,10 +21526,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.37
- "SELECT pg_advisory_xact_lock(hashtextextended('file-system-shortcuts:99999:99999', 99999))"
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.370
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.353
'''
SELECT "posthog_dashboardtile"."group_key" AS "group_key"
FROM "posthog_dashboardtile"
@@ -21244,7 +21540,7 @@
OR "posthog_dashboardtile"."insight_id" IS NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.371
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.354
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -21260,7 +21556,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.372
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.355
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -21276,7 +21572,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.373
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.356
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -21292,7 +21588,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.374
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.357
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -21311,7 +21607,7 @@
WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.375
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.358
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -21331,7 +21627,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.376
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.359
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -21688,7 +21984,21 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.377
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.36
+ '''
+ SELECT 1 AS "a"
+ FROM "posthog_filesystemshortcut"
+ INNER JOIN "posthog_team" ON ("posthog_filesystemshortcut"."team_id" = "posthog_team"."id")
+ WHERE (("posthog_filesystemshortcut"."surface" IS NULL
+ OR "posthog_filesystemshortcut"."surface" = 'web')
+ AND "posthog_team"."project_id" = 99999
+ AND "posthog_filesystemshortcut"."user_id" = 99999
+ AND "posthog_filesystemshortcut"."ref" IS NULL
+ AND NOT ("posthog_filesystemshortcut"."type" = 'folder'))
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.360
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -21697,7 +22007,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.378
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.361
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -21737,15 +22047,8 @@
"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_listing_dashboards_is_not_nplus1.379
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -21784,25 +22087,13 @@
"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_listing_dashboards_is_not_nplus1.38
- '''
- SELECT "posthog_filesystemshortcut"."path" AS "path"
- FROM "posthog_filesystemshortcut"
- INNER JOIN "posthog_team" ON ("posthog_filesystemshortcut"."team_id" = "posthog_team"."id")
- WHERE (("posthog_filesystemshortcut"."surface" IS NULL
- OR "posthog_filesystemshortcut"."surface" = 'web')
- AND "posthog_team"."project_id" = 99999
- AND "posthog_filesystemshortcut"."user_id" = 99999
- AND "posthog_filesystemshortcut"."ref" IS NULL
- AND NOT ("posthog_filesystemshortcut"."type" = 'folder'))
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.380
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.362
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -21940,7 +22231,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.381
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.363
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -21995,7 +22286,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.382
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.364
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -22018,7 +22309,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.383
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.365
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -22071,7 +22362,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.384
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.366
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -22091,7 +22382,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.385
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.367
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -22104,7 +22395,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.386
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.368
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -22117,7 +22408,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.387
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.369
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -22149,7 +22440,10 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.388
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.37
+ "SELECT pg_advisory_xact_lock(hashtextextended('file-system-shortcuts:99999:99999', 99999))"
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.370
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -22247,7 +22541,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.389
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.371
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -22293,18 +22587,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.39
- '''
- SELECT "posthog_filesystemshortcut"."order" AS "order"
- FROM "posthog_filesystemshortcut"
- INNER JOIN "posthog_team" ON ("posthog_filesystemshortcut"."team_id" = "posthog_team"."id")
- WHERE (("posthog_filesystemshortcut"."surface" IS NULL
- OR "posthog_filesystemshortcut"."surface" = 'web')
- AND "posthog_team"."project_id" = 99999
- AND "posthog_filesystemshortcut"."user_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.390
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.372
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -22402,7 +22685,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.391
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.373
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -22427,7 +22710,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.392
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.374
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -22445,7 +22728,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.393
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.375
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -22491,7 +22774,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.394
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.376
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -22589,7 +22872,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.395
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.377
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -22618,7 +22901,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.396
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.378
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -22647,7 +22930,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.397
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.379
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -22667,7 +22950,20 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.398
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.38
+ '''
+ SELECT "posthog_filesystemshortcut"."path" AS "path"
+ FROM "posthog_filesystemshortcut"
+ INNER JOIN "posthog_team" ON ("posthog_filesystemshortcut"."team_id" = "posthog_team"."id")
+ WHERE (("posthog_filesystemshortcut"."surface" IS NULL
+ OR "posthog_filesystemshortcut"."surface" = 'web')
+ AND "posthog_team"."project_id" = 99999
+ AND "posthog_filesystemshortcut"."user_id" = 99999
+ AND "posthog_filesystemshortcut"."ref" IS NULL
+ AND NOT ("posthog_filesystemshortcut"."type" = 'folder'))
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.380
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -22680,7 +22976,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.399
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.381
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -22696,37 +22992,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.4
- '''
- SELECT "posthog_organizationmembernotificationlock"."id",
- "posthog_organizationmembernotificationlock"."organization_id",
- "posthog_organizationmembernotificationlock"."organization_membership_id",
- "posthog_organizationmembernotificationlock"."setting",
- "posthog_organizationmembernotificationlock"."scope_id",
- "posthog_organizationmembernotificationlock"."locked_value",
- "posthog_organizationmembernotificationlock"."created_by_id",
- "posthog_organizationmembernotificationlock"."created_at",
- "posthog_organizationmembernotificationlock"."updated_at"
- FROM "posthog_organizationmembernotificationlock"
- WHERE "posthog_organizationmembernotificationlock"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.40
- '''
- 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"
- FROM "posthog_organizationmembership"
- WHERE "posthog_organizationmembership"."user_id" = 99999
- ORDER BY "posthog_organizationmembership"."id" ASC
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.400
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.382
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -22744,7 +23010,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.401
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.383
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -22753,7 +23019,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.402
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.384
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -22793,15 +23059,8 @@
"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_listing_dashboards_is_not_nplus1.403
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -22840,12 +23099,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.404
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.385
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -22983,7 +23243,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.405
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.386
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -23038,7 +23298,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.406
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.387
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -23061,7 +23321,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.407
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.388
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -23114,7 +23374,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.408
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.389
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -23134,7 +23394,18 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.409
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.39
+ '''
+ SELECT "posthog_filesystemshortcut"."order" AS "order"
+ FROM "posthog_filesystemshortcut"
+ INNER JOIN "posthog_team" ON ("posthog_filesystemshortcut"."team_id" = "posthog_team"."id")
+ WHERE (("posthog_filesystemshortcut"."surface" IS NULL
+ OR "posthog_filesystemshortcut"."surface" = 'web')
+ AND "posthog_team"."project_id" = 99999
+ AND "posthog_filesystemshortcut"."user_id" = 99999)
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.390
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -23147,21 +23418,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.41
- '''
- SELECT 1 AS "a"
- FROM "posthog_filesystemshortcut"
- INNER JOIN "posthog_team" ON ("posthog_filesystemshortcut"."team_id" = "posthog_team"."id")
- WHERE (("posthog_filesystemshortcut"."surface" IS NULL
- OR "posthog_filesystemshortcut"."surface" = 'web')
- AND "posthog_team"."project_id" = 99999
- AND "posthog_filesystemshortcut"."user_id" = 99999
- AND "posthog_filesystemshortcut"."ref" IS NULL
- AND NOT ("posthog_filesystemshortcut"."type" = 'folder'))
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.410
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.391
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -23174,7 +23431,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.411
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.392
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -23206,7 +23463,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.412
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.393
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -23304,7 +23561,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.413
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.394
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -23350,7 +23607,194 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.414
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.395
+ '''
+ 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"."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"
+ FROM "posthog_team"
+ WHERE "posthog_team"."id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.396
+ '''
+ 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_listing_dashboards_is_not_nplus1.397
+ '''
+ 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_listing_dashboards_is_not_nplus1.398
+ '''
+ 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_listing_dashboards_is_not_nplus1.399
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -23448,194 +23892,37 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.415
- '''
- 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_listing_dashboards_is_not_nplus1.416
- '''
- 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_listing_dashboards_is_not_nplus1.417
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.4
'''
- 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
+ SELECT "posthog_organizationmembernotificationlock"."id",
+ "posthog_organizationmembernotificationlock"."organization_id",
+ "posthog_organizationmembernotificationlock"."organization_membership_id",
+ "posthog_organizationmembernotificationlock"."setting",
+ "posthog_organizationmembernotificationlock"."scope_id",
+ "posthog_organizationmembernotificationlock"."locked_value",
+ "posthog_organizationmembernotificationlock"."created_by_id",
+ "posthog_organizationmembernotificationlock"."created_at",
+ "posthog_organizationmembernotificationlock"."updated_at"
+ FROM "posthog_organizationmembernotificationlock"
+ WHERE "posthog_organizationmembernotificationlock"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.418
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.40
'''
- 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"."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"
- FROM "posthog_team"
- WHERE "posthog_team"."id" = 99999
- LIMIT 21
+ 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"
+ FROM "posthog_organizationmembership"
+ WHERE "posthog_organizationmembership"."user_id" = 99999
+ ORDER BY "posthog_organizationmembership"."id" ASC
+ LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.419
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.400
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -23664,16 +23951,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.42
- '''
- SELECT "posthog_team"."organization_id" AS "organization_id"
- FROM "posthog_team"
- WHERE "posthog_team"."id" = 99999
- ORDER BY "posthog_team"."id" ASC
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.420
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.401
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -23702,7 +23980,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.421
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.402
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -23722,7 +24000,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.422
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.403
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -23735,7 +24013,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.423
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.404
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -23751,7 +24029,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.424
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.405
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -23769,7 +24047,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.425
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.406
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -23778,7 +24056,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.426
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.407
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -23818,15 +24096,8 @@
"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_listing_dashboards_is_not_nplus1.427
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -23865,12 +24136,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.428
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.408
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -24008,7 +24280,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.429
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.409
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -24063,15 +24335,21 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.43
- '''
- SELECT "posthog_team"."id" AS "id"
- FROM "posthog_team"
- WHERE ("posthog_team"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_team"."receive_org_level_activity_logs")
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.41
+ '''
+ SELECT 1 AS "a"
+ FROM "posthog_filesystemshortcut"
+ INNER JOIN "posthog_team" ON ("posthog_filesystemshortcut"."team_id" = "posthog_team"."id")
+ WHERE (("posthog_filesystemshortcut"."surface" IS NULL
+ OR "posthog_filesystemshortcut"."surface" = 'web')
+ AND "posthog_team"."project_id" = 99999
+ AND "posthog_filesystemshortcut"."user_id" = 99999
+ AND "posthog_filesystemshortcut"."ref" IS NULL
+ AND NOT ("posthog_filesystemshortcut"."type" = 'folder'))
+ LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.430
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.410
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -24094,7 +24372,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.431
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.411
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -24147,7 +24425,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.432
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.412
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -24167,7 +24445,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.433
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.413
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -24180,7 +24458,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.434
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.414
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -24193,7 +24471,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.435
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.415
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -24225,7 +24503,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.436
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.416
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -24323,7 +24601,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.437
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.417
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -24369,7 +24647,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.438
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.418
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -24467,7 +24745,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.439
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.419
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -24492,53 +24770,16 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.44
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.42
'''
- 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_team"."organization_id" AS "organization_id"
+ FROM "posthog_team"
+ WHERE "posthog_team"."id" = 99999
+ ORDER BY "posthog_team"."id" ASC
+ LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.440
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.420
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -24556,7 +24797,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.441
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.421
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -24602,7 +24843,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.442
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.422
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -24700,7 +24941,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.443
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.423
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -24729,7 +24970,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.444
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.424
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -24758,7 +24999,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.445
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.425
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -24778,65 +25019,630 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.446
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.426
+ '''
+ 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.427
+ '''
+ 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.428
+ '''
+ 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",
+ "customer_analytics_teamcustomeranalyticsconfig"."properties"
+ FROM "customer_analytics_teamcustomeranalyticsconfig"
+ WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.429
+ '''
+ 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_listing_dashboards_is_not_nplus1.43
+ '''
+ SELECT "posthog_team"."id" AS "id"
+ FROM "posthog_team"
+ WHERE ("posthog_team"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_team"."receive_org_level_activity_logs")
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.430
+ '''
+ 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",
+ "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_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.431
+ '''
+ 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"."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: TestDashboard.test_listing_dashboards_is_not_nplus1.432
+ '''
+ 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: TestDashboard.test_listing_dashboards_is_not_nplus1.433
+ '''
+ 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.434
+ '''
+ 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_listing_dashboards_is_not_nplus1.435
'''
- 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
+ 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.447
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.436
'''
- 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
+ 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"."quick_filter_ids",
+ "posthog_dashboard"."customization",
+ "posthog_dashboard"."deprecated_tags",
+ "posthog_dashboard"."tags",
+ "posthog_dashboard"."share_token",
+ "posthog_dashboard"."is_shared",
+ "recent_dashboard_views"."viewed_at" AS "last_viewed_at",
+ ("posthog_dashboard"."id")::varchar AS "_ref_id",
+
+ (SELECT "U0"."path" AS "path"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
+ ORDER BY "U0"."id" ASC
+ LIMIT 1) AS "_folder_path",
+
+ (SELECT "U0"."id" AS "id"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
+ ORDER BY 1 ASC
+ LIMIT 1) AS "_folder_id",
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in"
+ 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)))
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboard"."created_by_id" = "T6"."id")
+ WHERE ("posthog_team"."project_id" = 99999
+ AND NOT ("posthog_dashboard"."deleted")
+ AND NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))
+ ORDER BY "posthog_dashboard"."pinned" DESC,
+ "posthog_dashboard"."name" ASC,
+ "posthog_dashboard"."id" ASC
+ LIMIT 300
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.448
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.437
'''
- 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",
- "customer_analytics_teamcustomeranalyticsconfig"."properties"
- FROM "customer_analytics_teamcustomeranalyticsconfig"
- WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
- LIMIT 21
+ 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" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.449
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.438
'''
- SELECT "posthog_tag"."name" AS "tag__name"
+ SELECT "posthog_taggeditem"."id",
+ "posthog_taggeditem"."tag_id",
+ "posthog_taggeditem"."content_type_id",
+ "posthog_taggeditem"."object_id",
+ "posthog_taggeditem"."object_uuid",
+ "posthog_taggeditem"."team_id",
+ "posthog_tag"."id",
+ "posthog_tag"."name",
+ "posthog_tag"."team_id"
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)
+ AND "posthog_taggeditem"."object_id" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.45
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.439
'''
- SELECT "posthog_organization"."id",
+ 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",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -24875,12 +25681,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.450
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.44
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -24920,15 +25727,8 @@
"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_listing_dashboards_is_not_nplus1.451
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -24967,12 +25767,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.452
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.440
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -25110,7 +25911,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.453
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.441
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -25165,7 +25966,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.454
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.442
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -25188,7 +25989,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.455
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.443
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -25241,126 +26042,158 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.456
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.444
'''
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'))
+ 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_listing_dashboards_is_not_nplus1.457
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.445
'''
- 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"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared",
- "recent_dashboard_views"."viewed_at" AS "last_viewed_at",
- ("posthog_dashboard"."id")::varchar AS "_ref_id",
-
- (SELECT "U0"."path" AS "path"
- FROM "posthog_filesystem" "U0"
- WHERE (("U0"."surface" IS NULL
- OR "U0"."surface" = 'web')
- AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
- AND "U0"."team_id" = ("posthog_dashboard"."team_id")
- AND "U0"."type" = 'dashboard'
- AND NOT ("U0"."shortcut"
- AND "U0"."shortcut" IS NOT NULL))
- ORDER BY "U0"."id" ASC
- LIMIT 1) AS "_folder_path",
-
- (SELECT "U0"."id" AS "id"
- FROM "posthog_filesystem" "U0"
- WHERE (("U0"."surface" IS NULL
- OR "U0"."surface" = 'web')
- AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
- AND "U0"."team_id" = ("posthog_dashboard"."team_id")
- AND "U0"."type" = 'dashboard'
- AND NOT ("U0"."shortcut"
- AND "U0"."shortcut" IS NOT NULL))
- ORDER BY 1 ASC
- LIMIT 1) AS "_folder_id",
- "T6"."id",
- "T6"."password",
- "T6"."last_login",
- "T6"."first_name",
- "T6"."last_name",
- "T6"."is_staff",
- "T6"."date_joined",
- "T6"."uuid",
- "T6"."current_organization_id",
- "T6"."current_team_id",
- "T6"."email",
- "T6"."pending_email",
- "T6"."distinct_id",
- "T6"."is_email_verified",
- "T6"."credentials_reviewed_at",
- "T6"."requested_password_reset_at",
- "T6"."requested_2fa_reset_at",
- "T6"."has_seen_product_intro_for",
- "T6"."strapi_id",
- "T6"."is_active",
- "T6"."role_at_organization",
- "T6"."theme_mode",
- "T6"."partial_notification_settings",
- "T6"."anonymize_data",
- "T6"."allow_impersonation",
- "T6"."toolbar_mode",
- "T6"."hedgehog_config",
- "T6"."allow_sidebar_suggestions",
- "T6"."shortcut_position",
- "T6"."passkeys_enabled_for_2fa",
- "T6"."hide_mcp_hints",
- "T6"."ui_configuration",
- "T6"."onboarding_skipped_at",
- "T6"."onboarding_skipped_reason",
- "T6"."onboarding_skipped_organization_id",
- "T6"."onboarding_delegated_to_invite_id",
- "T6"."onboarding_delegated_to_organization_id",
- "T6"."onboarding_delegation_accepted_at",
- "T6"."events_column_config",
- "T6"."email_opt_in"
- 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)))
- LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboard"."created_by_id" = "T6"."id")
- WHERE ("posthog_team"."project_id" = 99999
+ 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"."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"
+ FROM "posthog_team"
+ WHERE "posthog_team"."id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.446
+ '''
+ 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" = 'dashboard'
+ AND NOT ("posthog_filesystem"."shortcut"
+ AND "posthog_filesystem"."shortcut" IS NOT NULL))
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.447
+ '''
+ 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 NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))
- ORDER BY "posthog_dashboard"."pinned" DESC,
- "posthog_dashboard"."name" ASC,
- "posthog_dashboard"."id" ASC
- LIMIT 300
+ AND "posthog_dashboardtile"."dashboard_id" = 99999
+ AND NOT ("posthog_dashboardtile"."insight_id" IS NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.458
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.448
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -25376,35 +26209,18 @@
"posthog_sharingconfiguration"."settings",
"posthog_sharingconfiguration"."password_required"
FROM "posthog_sharingconfiguration"
- WHERE "posthog_sharingconfiguration"."dashboard_id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */)
+ WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.459
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.449
'''
- SELECT "posthog_taggeditem"."id",
- "posthog_taggeditem"."tag_id",
- "posthog_taggeditem"."content_type_id",
- "posthog_taggeditem"."object_id",
- "posthog_taggeditem"."object_uuid",
- "posthog_taggeditem"."team_id",
- "posthog_tag"."id",
- "posthog_tag"."name",
- "posthog_tag"."team_id"
+ SELECT COUNT(*) AS "__count"
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" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
+ AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.46
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.45
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -25542,9 +26358,257 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.460
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.450
'''
- SELECT "posthog_user"."id",
+ SELECT "posthog_dashboardtile"."group_key" AS "group_key"
+ FROM "posthog_dashboardtile"
+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
+ LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."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_dashboarditem"."deleted"
+ OR "posthog_dashboardtile"."insight_id" IS NULL))
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.451
+ '''
+ 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_listing_dashboards_is_not_nplus1.452
+ '''
+ 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_listing_dashboards_is_not_nplus1.453
+ '''
+ 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_listing_dashboards_is_not_nplus1.454
+ '''
+ 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_listing_dashboards_is_not_nplus1.455
+ '''
+ 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_listing_dashboards_is_not_nplus1.456
+ '''
+ SELECT "posthog_dashboardtile"."id",
+ "posthog_dashboardtile"."dashboard_id",
+ "posthog_dashboardtile"."insight_id",
+ "posthog_dashboardtile"."text_id",
+ "posthog_dashboardtile"."button_tile_id",
+ "posthog_dashboardtile"."widget_id",
+ "posthog_dashboardtile"."team_id",
+ "posthog_dashboardtile"."layouts",
+ "posthog_dashboardtile"."color",
+ "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",
+ "posthog_dashboarditem"."id",
+ "posthog_dashboarditem"."name",
+ "posthog_dashboarditem"."derived_name",
+ "posthog_dashboarditem"."description",
+ "posthog_dashboarditem"."team_id",
+ "posthog_dashboarditem"."filters",
+ "posthog_dashboarditem"."filters_hash",
+ "posthog_dashboarditem"."query",
+ "posthog_dashboarditem"."query_metadata",
+ "posthog_dashboarditem"."order",
+ "posthog_dashboarditem"."deleted",
+ "posthog_dashboarditem"."saved",
+ "posthog_dashboarditem"."created_at",
+ "posthog_dashboarditem"."refreshing",
+ "posthog_dashboarditem"."created_by_id",
+ "posthog_dashboarditem"."is_sample",
+ "posthog_dashboarditem"."short_id",
+ "posthog_dashboarditem"."favorited",
+ "posthog_dashboarditem"."refresh_attempt",
+ "posthog_dashboarditem"."last_modified_at",
+ "posthog_dashboarditem"."last_modified_by_id",
+ "posthog_dashboarditem"."dashboard_id",
+ "posthog_dashboarditem"."last_refresh",
+ "posthog_dashboarditem"."layouts",
+ "posthog_dashboarditem"."color",
+ "posthog_dashboarditem"."dive_dashboard_id",
+ "posthog_dashboarditem"."updated_at",
+ "posthog_dashboarditem"."deprecated_tags",
+ "posthog_dashboarditem"."tags",
+ "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"."session_recording_retention_period_days",
+ "posthog_team"."plugins_opt_in",
+ "posthog_team"."opt_out_capture",
+ "posthog_team"."event_names",
+ "posthog_team"."event_names_with_usage",
+ "posthog_team"."event_properties",
+ "posthog_team"."event_properties_with_usage",
+ "posthog_team"."event_properties_numerical",
+ "posthog_team"."external_data_workspace_id",
+ "posthog_team"."external_data_workspace_last_synced_at",
+ "posthog_team"."api_query_rate_limit",
+ "posthog_team"."revenue_tracking_config",
+ "posthog_team"."drop_events_older_than",
+ "posthog_team"."base_currency",
+ "posthog_team"."business_model",
+ "posthog_user"."id",
"posthog_user"."password",
"posthog_user"."last_login",
"posthog_user"."first_name",
@@ -25559,6 +26623,7 @@
"posthog_user"."distinct_id",
"posthog_user"."is_email_verified",
"posthog_user"."credentials_reviewed_at",
+ "posthog_user"."requested_password_reset_at",
"posthog_user"."requested_2fa_reset_at",
"posthog_user"."has_seen_product_intro_for",
"posthog_user"."strapi_id",
@@ -25582,15 +26647,226 @@
"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)
+ "posthog_user"."email_opt_in",
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in",
+ "posthog_text"."id",
+ "posthog_text"."body",
+ "posthog_text"."agent_context",
+ "posthog_text"."created_by_id",
+ "posthog_text"."last_modified_at",
+ "posthog_text"."last_modified_by_id",
+ "posthog_text"."team_id",
+ "posthog_buttontile"."id",
+ "posthog_buttontile"."url",
+ "posthog_buttontile"."text",
+ "posthog_buttontile"."placement",
+ "posthog_buttontile"."style",
+ "posthog_buttontile"."created_by_id",
+ "posthog_buttontile"."last_modified_at",
+ "posthog_buttontile"."last_modified_by_id",
+ "posthog_buttontile"."team_id",
+ "posthog_dashboardwidget"."id",
+ "posthog_dashboardwidget"."widget_type",
+ "posthog_dashboardwidget"."name",
+ "posthog_dashboardwidget"."description",
+ "posthog_dashboardwidget"."config",
+ "posthog_dashboardwidget"."created_by_id",
+ "posthog_dashboardwidget"."last_modified_at",
+ "posthog_dashboardwidget"."last_modified_by_id",
+ "posthog_dashboardwidget"."team_id",
+ "T10"."id",
+ "T10"."password",
+ "T10"."last_login",
+ "T10"."first_name",
+ "T10"."last_name",
+ "T10"."is_staff",
+ "T10"."date_joined",
+ "T10"."uuid",
+ "T10"."current_organization_id",
+ "T10"."current_team_id",
+ "T10"."email",
+ "T10"."pending_email",
+ "T10"."distinct_id",
+ "T10"."is_email_verified",
+ "T10"."credentials_reviewed_at",
+ "T10"."requested_password_reset_at",
+ "T10"."requested_2fa_reset_at",
+ "T10"."has_seen_product_intro_for",
+ "T10"."strapi_id",
+ "T10"."is_active",
+ "T10"."role_at_organization",
+ "T10"."theme_mode",
+ "T10"."partial_notification_settings",
+ "T10"."anonymize_data",
+ "T10"."allow_impersonation",
+ "T10"."toolbar_mode",
+ "T10"."hedgehog_config",
+ "T10"."allow_sidebar_suggestions",
+ "T10"."shortcut_position",
+ "T10"."passkeys_enabled_for_2fa",
+ "T10"."hide_mcp_hints",
+ "T10"."ui_configuration",
+ "T10"."onboarding_skipped_at",
+ "T10"."onboarding_skipped_reason",
+ "T10"."onboarding_skipped_organization_id",
+ "T10"."onboarding_delegated_to_invite_id",
+ "T10"."onboarding_delegated_to_organization_id",
+ "T10"."onboarding_delegation_accepted_at",
+ "T10"."events_column_config",
+ "T10"."email_opt_in",
+ "T11"."id",
+ "T11"."password",
+ "T11"."last_login",
+ "T11"."first_name",
+ "T11"."last_name",
+ "T11"."is_staff",
+ "T11"."date_joined",
+ "T11"."uuid",
+ "T11"."current_organization_id",
+ "T11"."current_team_id",
+ "T11"."email",
+ "T11"."pending_email",
+ "T11"."distinct_id",
+ "T11"."is_email_verified",
+ "T11"."credentials_reviewed_at",
+ "T11"."requested_password_reset_at",
+ "T11"."requested_2fa_reset_at",
+ "T11"."has_seen_product_intro_for",
+ "T11"."strapi_id",
+ "T11"."is_active",
+ "T11"."role_at_organization",
+ "T11"."theme_mode",
+ "T11"."partial_notification_settings",
+ "T11"."anonymize_data",
+ "T11"."allow_impersonation",
+ "T11"."toolbar_mode",
+ "T11"."hedgehog_config",
+ "T11"."allow_sidebar_suggestions",
+ "T11"."shortcut_position",
+ "T11"."passkeys_enabled_for_2fa",
+ "T11"."hide_mcp_hints",
+ "T11"."ui_configuration",
+ "T11"."onboarding_skipped_at",
+ "T11"."onboarding_skipped_reason",
+ "T11"."onboarding_skipped_organization_id",
+ "T11"."onboarding_delegated_to_invite_id",
+ "T11"."onboarding_delegated_to_organization_id",
+ "T11"."onboarding_delegation_accepted_at",
+ "T11"."events_column_config",
+ "T11"."email_opt_in"
+ FROM "posthog_dashboardtile"
+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
+ LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."id")
+ LEFT OUTER JOIN "posthog_team" ON ("posthog_dashboarditem"."team_id" = "posthog_team"."id")
+ LEFT OUTER JOIN "posthog_user" ON ("posthog_dashboarditem"."created_by_id" = "posthog_user"."id")
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboarditem"."last_modified_by_id" = "T6"."id")
+ LEFT OUTER JOIN "posthog_text" ON ("posthog_dashboardtile"."text_id" = "posthog_text"."id")
+ LEFT OUTER JOIN "posthog_buttontile" ON ("posthog_dashboardtile"."button_tile_id" = "posthog_buttontile"."id")
+ LEFT OUTER JOIN "posthog_dashboardwidget" ON ("posthog_dashboardtile"."widget_id" = "posthog_dashboardwidget"."id")
+ LEFT OUTER JOIN "posthog_user" "T10" ON ("posthog_dashboardwidget"."created_by_id" = "T10"."id")
+ LEFT OUTER JOIN "posthog_user" "T11" ON ("posthog_dashboardwidget"."last_modified_by_id" = "T11"."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_dashboard"."deleted"
+ AND "posthog_dashboardtile"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL)
+ AND (NOT "posthog_dashboarditem"."deleted"
+ OR "posthog_dashboardtile"."insight_id" IS NULL))
+ ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.461
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.457
'''
- SELECT "posthog_organization"."id",
+ 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_listing_dashboards_is_not_nplus1.458
+ '''
+ 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",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -25629,12 +26905,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.462
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.459
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -25772,7 +27049,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.463
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.46
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -25827,7 +27104,62 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.464
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.460
+ '''
+ 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: TestDashboard.test_listing_dashboards_is_not_nplus1.461
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -25850,7 +27182,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.465
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.462
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -25903,9 +27235,9 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.466
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.463
'''
- SELECT COUNT(*) AS "__count"
+ SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
WHERE (NOT ("posthog_dashboard"."deleted")
@@ -25916,7 +27248,69 @@
LIMIT 1)
OR ("posthog_team"."parent_team_id" IS NULL
AND "posthog_dashboard"."team_id" = 99999))
- AND NOT "posthog_dashboard"."deleted")
+ AND "posthog_dashboard"."id" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.464
+ '''
+ SELECT "posthog_dashboard"."id" AS "id",
+ "posthog_dashboard"."name" AS "name"
+ FROM "posthog_dashboard"
+ WHERE (NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboard"."id" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.465
+ '''
+ 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"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL))
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.466
+ '''
+ 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"."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_listing_dashboards_is_not_nplus1.467
@@ -26019,51 +27413,7 @@
# ---
# name: TestDashboard.test_listing_dashboards_is_not_nplus1.468
'''
- 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" = 'dashboard'
- AND NOT ("posthog_filesystem"."shortcut"
- AND "posthog_filesystem"."shortcut" IS NOT NULL))
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.469
- '''
- 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_listing_dashboards_is_not_nplus1.47
- '''
- 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",
@@ -26102,192 +27452,224 @@
"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: TestDashboard.test_listing_dashboards_is_not_nplus1.470
- '''
- 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_listing_dashboards_is_not_nplus1.471
- '''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_taggeditem"
- WHERE ("posthog_taggeditem"."content_type_id" = 99999
- AND "posthog_taggeditem"."object_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.472
- '''
- SELECT "posthog_dashboardtile"."group_key" AS "group_key"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."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_dashboarditem"."deleted"
- OR "posthog_dashboardtile"."insight_id" IS NULL))
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.473
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.469
'''
- 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
+ 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"."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"
+ FROM "posthog_team"
+ WHERE "posthog_team"."id" = 99999
+ LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.474
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.47
'''
- 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
+ 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.475
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.470
'''
- SELECT "posthog_filesystem"."id" AS "id",
- "posthog_filesystem"."path" AS "path"
+ 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" = 'dashboard'
+ AND "posthog_filesystem"."type" = 'insight'
AND NOT ("posthog_filesystem"."shortcut"
AND "posthog_filesystem"."shortcut" IS NOT NULL))
- ORDER BY 1 ASC
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.476
- '''
- 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_listing_dashboards_is_not_nplus1.477
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.471
'''
- 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_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_listing_dashboards_is_not_nplus1.478
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.472
'''
- SELECT "posthog_dashboardtile"."id",
- "posthog_dashboardtile"."dashboard_id",
- "posthog_dashboardtile"."insight_id",
- "posthog_dashboardtile"."text_id",
- "posthog_dashboardtile"."button_tile_id",
- "posthog_dashboardtile"."widget_id",
- "posthog_dashboardtile"."team_id",
- "posthog_dashboardtile"."layouts",
- "posthog_dashboardtile"."color",
- "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",
- "posthog_dashboarditem"."id",
- "posthog_dashboarditem"."name",
- "posthog_dashboarditem"."derived_name",
- "posthog_dashboarditem"."description",
- "posthog_dashboarditem"."team_id",
- "posthog_dashboarditem"."filters",
- "posthog_dashboarditem"."filters_hash",
- "posthog_dashboarditem"."query",
- "posthog_dashboarditem"."query_metadata",
- "posthog_dashboarditem"."order",
- "posthog_dashboarditem"."deleted",
- "posthog_dashboarditem"."saved",
- "posthog_dashboarditem"."created_at",
- "posthog_dashboarditem"."refreshing",
- "posthog_dashboarditem"."created_by_id",
- "posthog_dashboarditem"."is_sample",
- "posthog_dashboarditem"."short_id",
- "posthog_dashboarditem"."favorited",
- "posthog_dashboarditem"."refresh_attempt",
- "posthog_dashboarditem"."last_modified_at",
- "posthog_dashboarditem"."last_modified_by_id",
- "posthog_dashboarditem"."dashboard_id",
- "posthog_dashboarditem"."last_refresh",
- "posthog_dashboarditem"."layouts",
- "posthog_dashboarditem"."color",
- "posthog_dashboarditem"."dive_dashboard_id",
- "posthog_dashboarditem"."updated_at",
- "posthog_dashboarditem"."deprecated_tags",
- "posthog_dashboarditem"."tags",
- "posthog_team"."id",
+ 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_listing_dashboards_is_not_nplus1.473
+ '''
+ SELECT "posthog_team"."id",
"posthog_team"."uuid",
"posthog_team"."organization_id",
"posthog_team"."parent_team_id",
@@ -26372,261 +27754,205 @@
"posthog_team"."extra_settings",
"posthog_team"."modifiers",
"posthog_team"."session_recording_retention_period_days",
- "posthog_team"."plugins_opt_in",
- "posthog_team"."opt_out_capture",
- "posthog_team"."event_names",
- "posthog_team"."event_names_with_usage",
- "posthog_team"."event_properties",
- "posthog_team"."event_properties_with_usage",
- "posthog_team"."event_properties_numerical",
"posthog_team"."external_data_workspace_id",
"posthog_team"."external_data_workspace_last_synced_at",
"posthog_team"."api_query_rate_limit",
- "posthog_team"."revenue_tracking_config",
"posthog_team"."drop_events_older_than",
"posthog_team"."base_currency",
- "posthog_team"."business_model",
- "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_password_reset_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",
- "T6"."id",
- "T6"."password",
- "T6"."last_login",
- "T6"."first_name",
- "T6"."last_name",
- "T6"."is_staff",
- "T6"."date_joined",
- "T6"."uuid",
- "T6"."current_organization_id",
- "T6"."current_team_id",
- "T6"."email",
- "T6"."pending_email",
- "T6"."distinct_id",
- "T6"."is_email_verified",
- "T6"."credentials_reviewed_at",
- "T6"."requested_password_reset_at",
- "T6"."requested_2fa_reset_at",
- "T6"."has_seen_product_intro_for",
- "T6"."strapi_id",
- "T6"."is_active",
- "T6"."role_at_organization",
- "T6"."theme_mode",
- "T6"."partial_notification_settings",
- "T6"."anonymize_data",
- "T6"."allow_impersonation",
- "T6"."toolbar_mode",
- "T6"."hedgehog_config",
- "T6"."allow_sidebar_suggestions",
- "T6"."shortcut_position",
- "T6"."passkeys_enabled_for_2fa",
- "T6"."hide_mcp_hints",
- "T6"."ui_configuration",
- "T6"."onboarding_skipped_at",
- "T6"."onboarding_skipped_reason",
- "T6"."onboarding_skipped_organization_id",
- "T6"."onboarding_delegated_to_invite_id",
- "T6"."onboarding_delegated_to_organization_id",
- "T6"."onboarding_delegation_accepted_at",
- "T6"."events_column_config",
- "T6"."email_opt_in",
- "posthog_text"."id",
- "posthog_text"."body",
- "posthog_text"."agent_context",
- "posthog_text"."created_by_id",
- "posthog_text"."last_modified_at",
- "posthog_text"."last_modified_by_id",
- "posthog_text"."team_id",
- "posthog_buttontile"."id",
- "posthog_buttontile"."url",
- "posthog_buttontile"."text",
- "posthog_buttontile"."placement",
- "posthog_buttontile"."style",
- "posthog_buttontile"."created_by_id",
- "posthog_buttontile"."last_modified_at",
- "posthog_buttontile"."last_modified_by_id",
- "posthog_buttontile"."team_id",
- "posthog_dashboardwidget"."id",
- "posthog_dashboardwidget"."widget_type",
- "posthog_dashboardwidget"."name",
- "posthog_dashboardwidget"."description",
- "posthog_dashboardwidget"."config",
- "posthog_dashboardwidget"."created_by_id",
- "posthog_dashboardwidget"."last_modified_at",
- "posthog_dashboardwidget"."last_modified_by_id",
- "posthog_dashboardwidget"."team_id",
- "T10"."id",
- "T10"."password",
- "T10"."last_login",
- "T10"."first_name",
- "T10"."last_name",
- "T10"."is_staff",
- "T10"."date_joined",
- "T10"."uuid",
- "T10"."current_organization_id",
- "T10"."current_team_id",
- "T10"."email",
- "T10"."pending_email",
- "T10"."distinct_id",
- "T10"."is_email_verified",
- "T10"."credentials_reviewed_at",
- "T10"."requested_password_reset_at",
- "T10"."requested_2fa_reset_at",
- "T10"."has_seen_product_intro_for",
- "T10"."strapi_id",
- "T10"."is_active",
- "T10"."role_at_organization",
- "T10"."theme_mode",
- "T10"."partial_notification_settings",
- "T10"."anonymize_data",
- "T10"."allow_impersonation",
- "T10"."toolbar_mode",
- "T10"."hedgehog_config",
- "T10"."allow_sidebar_suggestions",
- "T10"."shortcut_position",
- "T10"."passkeys_enabled_for_2fa",
- "T10"."hide_mcp_hints",
- "T10"."ui_configuration",
- "T10"."onboarding_skipped_at",
- "T10"."onboarding_skipped_reason",
- "T10"."onboarding_skipped_organization_id",
- "T10"."onboarding_delegated_to_invite_id",
- "T10"."onboarding_delegated_to_organization_id",
- "T10"."onboarding_delegation_accepted_at",
- "T10"."events_column_config",
- "T10"."email_opt_in",
- "T11"."id",
- "T11"."password",
- "T11"."last_login",
- "T11"."first_name",
- "T11"."last_name",
- "T11"."is_staff",
- "T11"."date_joined",
- "T11"."uuid",
- "T11"."current_organization_id",
- "T11"."current_team_id",
- "T11"."email",
- "T11"."pending_email",
- "T11"."distinct_id",
- "T11"."is_email_verified",
- "T11"."credentials_reviewed_at",
- "T11"."requested_password_reset_at",
- "T11"."requested_2fa_reset_at",
- "T11"."has_seen_product_intro_for",
- "T11"."strapi_id",
- "T11"."is_active",
- "T11"."role_at_organization",
- "T11"."theme_mode",
- "T11"."partial_notification_settings",
- "T11"."anonymize_data",
- "T11"."allow_impersonation",
- "T11"."toolbar_mode",
- "T11"."hedgehog_config",
- "T11"."allow_sidebar_suggestions",
- "T11"."shortcut_position",
- "T11"."passkeys_enabled_for_2fa",
- "T11"."hide_mcp_hints",
- "T11"."ui_configuration",
- "T11"."onboarding_skipped_at",
- "T11"."onboarding_skipped_reason",
- "T11"."onboarding_skipped_organization_id",
- "T11"."onboarding_delegated_to_invite_id",
- "T11"."onboarding_delegated_to_organization_id",
- "T11"."onboarding_delegation_accepted_at",
- "T11"."events_column_config",
- "T11"."email_opt_in"
+ "posthog_team"."business_model"
+ FROM "posthog_team"
+ WHERE "posthog_team"."id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.474
+ '''
+ SELECT "posthog_dashboardtile"."id",
+ "posthog_dashboardtile"."dashboard_id",
+ "posthog_dashboardtile"."insight_id",
+ "posthog_dashboardtile"."text_id",
+ "posthog_dashboardtile"."button_tile_id",
+ "posthog_dashboardtile"."widget_id",
+ "posthog_dashboardtile"."team_id",
+ "posthog_dashboardtile"."layouts",
+ "posthog_dashboardtile"."color",
+ "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")
- LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."id")
- LEFT OUTER JOIN "posthog_team" ON ("posthog_dashboarditem"."team_id" = "posthog_team"."id")
- LEFT OUTER JOIN "posthog_user" ON ("posthog_dashboarditem"."created_by_id" = "posthog_user"."id")
- LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboarditem"."last_modified_by_id" = "T6"."id")
- LEFT OUTER JOIN "posthog_text" ON ("posthog_dashboardtile"."text_id" = "posthog_text"."id")
- LEFT OUTER JOIN "posthog_buttontile" ON ("posthog_dashboardtile"."button_tile_id" = "posthog_buttontile"."id")
- LEFT OUTER JOIN "posthog_dashboardwidget" ON ("posthog_dashboardtile"."widget_id" = "posthog_dashboardwidget"."id")
- LEFT OUTER JOIN "posthog_user" "T10" ON ("posthog_dashboardwidget"."created_by_id" = "T10"."id")
- LEFT OUTER JOIN "posthog_user" "T11" ON ("posthog_dashboardwidget"."last_modified_by_id" = "T11"."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_dashboard"."deleted"
- AND "posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND (NOT "posthog_dashboarditem"."deleted"
- OR "posthog_dashboardtile"."insight_id" IS NULL))
- ORDER BY "posthog_dashboarditem"."order" ASC
+ AND "posthog_dashboardtile"."insight_id" = 99999)
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.475
+ '''
+ SELECT "posthog_dashboardtile"."id",
+ "posthog_dashboardtile"."dashboard_id",
+ "posthog_dashboardtile"."insight_id",
+ "posthog_dashboardtile"."text_id",
+ "posthog_dashboardtile"."button_tile_id",
+ "posthog_dashboardtile"."widget_id",
+ "posthog_dashboardtile"."team_id",
+ "posthog_dashboardtile"."layouts",
+ "posthog_dashboardtile"."color",
+ "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_listing_dashboards_is_not_nplus1.476
+ '''
+ 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_listing_dashboards_is_not_nplus1.477
+ '''
+ 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.478
+ '''
+ 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.479
'''
- 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)
+ 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",
+ "customer_analytics_teamcustomeranalyticsconfig"."properties"
+ FROM "customer_analytics_teamcustomeranalyticsconfig"
+ WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
+ LIMIT 21
'''
# ---
# name: TestDashboard.test_listing_dashboards_is_not_nplus1.48
'''
- 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))
+ 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_listing_dashboards_is_not_nplus1.480
+ '''
+ 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_listing_dashboards_is_not_nplus1.481
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -26666,15 +27992,8 @@
"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_listing_dashboards_is_not_nplus1.481
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -26713,9 +28032,10 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
# name: TestDashboard.test_listing_dashboards_is_not_nplus1.482
@@ -27067,55 +28387,16 @@
# ---
# name: TestDashboard.test_listing_dashboards_is_not_nplus1.49
'''
- 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
+ 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.490
@@ -27642,16 +28923,88 @@
# ---
# name: TestDashboard.test_listing_dashboards_is_not_nplus1.50
'''
- 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 "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",
+ "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_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
# name: TestDashboard.test_listing_dashboards_is_not_nplus1.500
@@ -27750,15 +29103,8 @@
"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_listing_dashboards_is_not_nplus1.505
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -27797,12 +29143,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.506
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.505
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -27940,7 +29287,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.507
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.506
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -27995,7 +29342,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.508
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.507
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -28018,7 +29365,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.509
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.508
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -28071,53 +29418,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.51
- '''
- 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_listing_dashboards_is_not_nplus1.510
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.509
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -28137,7 +29438,145 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.511
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.51
+ '''
+ 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"."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: TestDashboard.test_listing_dashboards_is_not_nplus1.510
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -28150,7 +29589,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.512
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.511
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -28163,7 +29602,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.513
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.512
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -28195,7 +29634,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.514
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.513
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -28293,7 +29732,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.515
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.514
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -28339,7 +29778,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.516
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.515
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -28437,7 +29876,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.517
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.516
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -28462,7 +29901,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.518
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.517
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -28480,53 +29919,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.519
- '''
- 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_listing_dashboards_is_not_nplus1.52
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.518
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -28572,7 +29965,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.520
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.519
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -28670,7 +30063,62 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.521
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.52
+ '''
+ 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: TestDashboard.test_listing_dashboards_is_not_nplus1.520
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -28699,7 +30147,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.522
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.521
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -28728,7 +30176,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.523
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.522
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -28748,7 +30196,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.524
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.523
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -28761,7 +30209,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.525
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.524
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -28777,7 +30225,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.526
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.525
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -28795,7 +30243,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.527
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.526
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -28804,7 +30252,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.528
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.527
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -28844,15 +30292,8 @@
"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_listing_dashboards_is_not_nplus1.529
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -28891,12 +30332,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.53
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.528
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -29034,99 +30476,15 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.530
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.529
'''
- 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"."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",
+ 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",
@@ -29166,12 +30524,59 @@
"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
+ 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: TestDashboard.test_listing_dashboards_is_not_nplus1.53
+ '''
+ 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.530
+ '''
+ 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.531
'''
SELECT "posthog_organizationmembership"."id",
@@ -29222,118 +30627,170 @@
"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.532
'''
- 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))
+ 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.533
'''
- 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
+ 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"."quick_filter_ids",
+ "posthog_dashboard"."customization",
+ "posthog_dashboard"."deprecated_tags",
+ "posthog_dashboard"."tags",
+ "posthog_dashboard"."share_token",
+ "posthog_dashboard"."is_shared",
+ "recent_dashboard_views"."viewed_at" AS "last_viewed_at",
+ ("posthog_dashboard"."id")::varchar AS "_ref_id",
+
+ (SELECT "U0"."path" AS "path"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
+ ORDER BY "U0"."id" ASC
+ LIMIT 1) AS "_folder_path",
+
+ (SELECT "U0"."id" AS "id"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
+ ORDER BY 1 ASC
+ LIMIT 1) AS "_folder_id",
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in"
+ 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)))
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboard"."created_by_id" = "T6"."id")
+ WHERE ("posthog_team"."project_id" = 99999
+ AND NOT ("posthog_dashboard"."deleted")
+ AND NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))
+ ORDER BY "posthog_dashboard"."pinned" DESC,
+ "posthog_dashboard"."name" ASC,
+ "posthog_dashboard"."id" ASC
+ LIMIT 300
'''
# ---
# name: TestDashboard.test_listing_dashboards_is_not_nplus1.534
'''
- SELECT "posthog_dashboard"."id" AS "id"
- 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 "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
+ 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" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */)
'''
# ---
# name: TestDashboard.test_listing_dashboards_is_not_nplus1.535
'''
- SELECT "posthog_dashboard"."id" AS "id",
- "posthog_dashboard"."name" AS "name"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
+ SELECT "posthog_taggeditem"."id",
+ "posthog_taggeditem"."tag_id",
+ "posthog_taggeditem"."content_type_id",
+ "posthog_taggeditem"."object_id",
+ "posthog_taggeditem"."object_uuid",
+ "posthog_taggeditem"."team_id",
+ "posthog_tag"."id",
+ "posthog_tag"."name",
+ "posthog_tag"."team_id"
+ 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" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
'''
# ---
# name: TestDashboard.test_listing_dashboards_is_not_nplus1.536
@@ -29575,9 +31032,7 @@
"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.540
@@ -29974,25 +31429,18 @@
# ---
# name: TestDashboard.test_listing_dashboards_is_not_nplus1.55
'''
- 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))
+ 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_listing_dashboards_is_not_nplus1.550
@@ -30504,55 +31952,100 @@
# ---
# name: TestDashboard.test_listing_dashboards_is_not_nplus1.56
'''
- 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
+ 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"."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"
+ FROM "posthog_team"
+ WHERE "posthog_team"."id" = 99999
+ LIMIT 21
'''
# ---
# name: TestDashboard.test_listing_dashboards_is_not_nplus1.560
@@ -30839,120 +32332,6 @@
'''
# ---
# name: TestDashboard.test_listing_dashboards_is_not_nplus1.57
- '''
- 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_listing_dashboards_is_not_nplus1.58
- '''
- 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"."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"
- FROM "posthog_team"
- WHERE "posthog_team"."id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.59
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -30977,6 +32356,37 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.58
+ '''
+ 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_listing_dashboards_is_not_nplus1.59
+ '''
+ 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_listing_dashboards_is_not_nplus1.6
'''
SELECT "posthog_oauthapplication"."redirect_uris",
@@ -31014,37 +32424,6 @@
'''
# ---
# name: TestDashboard.test_listing_dashboards_is_not_nplus1.60
- '''
- 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_listing_dashboards_is_not_nplus1.61
- '''
- 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_listing_dashboards_is_not_nplus1.62
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_taggeditem"
@@ -31052,7 +32431,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.63
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.61
'''
SELECT "posthog_dashboardtile"."group_key" AS "group_key"
FROM "posthog_dashboardtile"
@@ -31066,7 +32445,7 @@
OR "posthog_dashboardtile"."insight_id" IS NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.64
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.62
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -31082,7 +32461,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.65
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.63
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -31098,7 +32477,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.66
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.64
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -31114,7 +32493,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.67
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.65
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -31133,7 +32512,7 @@
WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.68
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.66
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -31153,7 +32532,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.69
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.67
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -31510,43 +32889,7 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.7
- '''
- SELECT "posthog_oauthapplication"."redirect_uris",
- "posthog_oauthapplication"."post_logout_redirect_uris",
- "posthog_oauthapplication"."client_type",
- "posthog_oauthapplication"."authorization_grant_type",
- "posthog_oauthapplication"."client_secret",
- "posthog_oauthapplication"."hash_client_secret",
- "posthog_oauthapplication"."name",
- "posthog_oauthapplication"."skip_authorization",
- "posthog_oauthapplication"."created",
- "posthog_oauthapplication"."updated",
- "posthog_oauthapplication"."algorithm",
- "posthog_oauthapplication"."allowed_origins",
- "posthog_oauthapplication"."id",
- "posthog_oauthapplication"."client_id",
- "posthog_oauthapplication"."organization_id",
- "posthog_oauthapplication"."user_id",
- "posthog_oauthapplication"."logo_uri",
- "posthog_oauthapplication"."is_dcr_client",
- "posthog_oauthapplication"."dcr_client_id_issued_at",
- "posthog_oauthapplication"."is_verified",
- "posthog_oauthapplication"."is_first_party",
- "posthog_oauthapplication"."auth_brand",
- "posthog_oauthapplication"."scopes",
- "posthog_oauthapplication"."optional_scopes",
- "posthog_oauthapplication"."sessions_revoked_at",
- "posthog_oauthapplication"."is_cimd_client",
- "posthog_oauthapplication"."cimd_metadata_last_fetched",
- "posthog_oauthapplication"."jwks_uri",
- "posthog_oauthapplication"."is_provisioning_partner",
- "posthog_oauthapplication"."provisioning_config"
- FROM "posthog_oauthapplication"
- WHERE "posthog_oauthapplication"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.70
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.68
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -31555,7 +32898,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.71
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.69
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -31595,15 +32938,8 @@
"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_listing_dashboards_is_not_nplus1.72
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -31642,12 +32978,49 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.73
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.7
+ '''
+ SELECT "posthog_oauthapplication"."redirect_uris",
+ "posthog_oauthapplication"."post_logout_redirect_uris",
+ "posthog_oauthapplication"."client_type",
+ "posthog_oauthapplication"."authorization_grant_type",
+ "posthog_oauthapplication"."client_secret",
+ "posthog_oauthapplication"."hash_client_secret",
+ "posthog_oauthapplication"."name",
+ "posthog_oauthapplication"."skip_authorization",
+ "posthog_oauthapplication"."created",
+ "posthog_oauthapplication"."updated",
+ "posthog_oauthapplication"."algorithm",
+ "posthog_oauthapplication"."allowed_origins",
+ "posthog_oauthapplication"."id",
+ "posthog_oauthapplication"."client_id",
+ "posthog_oauthapplication"."organization_id",
+ "posthog_oauthapplication"."user_id",
+ "posthog_oauthapplication"."logo_uri",
+ "posthog_oauthapplication"."is_dcr_client",
+ "posthog_oauthapplication"."dcr_client_id_issued_at",
+ "posthog_oauthapplication"."is_verified",
+ "posthog_oauthapplication"."is_first_party",
+ "posthog_oauthapplication"."auth_brand",
+ "posthog_oauthapplication"."scopes",
+ "posthog_oauthapplication"."optional_scopes",
+ "posthog_oauthapplication"."sessions_revoked_at",
+ "posthog_oauthapplication"."is_cimd_client",
+ "posthog_oauthapplication"."cimd_metadata_last_fetched",
+ "posthog_oauthapplication"."jwks_uri",
+ "posthog_oauthapplication"."is_provisioning_partner",
+ "posthog_oauthapplication"."provisioning_config"
+ FROM "posthog_oauthapplication"
+ WHERE "posthog_oauthapplication"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.70
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -31785,7 +33158,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.74
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.71
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -31840,7 +33213,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.75
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.72
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -31863,7 +33236,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.76
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.73
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -31916,7 +33289,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.77
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.74
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -31936,7 +33309,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.78
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.75
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -31949,7 +33322,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.79
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.76
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -31962,22 +33335,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.8
- '''
- SELECT "posthog_cimdverificationtoken"."id",
- "posthog_cimdverificationtoken"."organization_id",
- "posthog_cimdverificationtoken"."label",
- "posthog_cimdverificationtoken"."cimd_url",
- "posthog_cimdverificationtoken"."mask_value",
- "posthog_cimdverificationtoken"."secure_value",
- "posthog_cimdverificationtoken"."created_by_id",
- "posthog_cimdverificationtoken"."created_at",
- "posthog_cimdverificationtoken"."last_used_at"
- FROM "posthog_cimdverificationtoken"
- WHERE "posthog_cimdverificationtoken"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.80
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.77
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -32009,7 +33367,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.81
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.78
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -32107,7 +33465,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.82
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.79
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -32153,7 +33511,22 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.83
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.8
+ '''
+ SELECT "posthog_cimdverificationtoken"."id",
+ "posthog_cimdverificationtoken"."organization_id",
+ "posthog_cimdverificationtoken"."label",
+ "posthog_cimdverificationtoken"."cimd_url",
+ "posthog_cimdverificationtoken"."mask_value",
+ "posthog_cimdverificationtoken"."secure_value",
+ "posthog_cimdverificationtoken"."created_by_id",
+ "posthog_cimdverificationtoken"."created_at",
+ "posthog_cimdverificationtoken"."last_used_at"
+ FROM "posthog_cimdverificationtoken"
+ WHERE "posthog_cimdverificationtoken"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.80
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -32251,7 +33624,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.84
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.81
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -32276,7 +33649,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.85
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.82
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -32294,7 +33667,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.86
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.83
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -32340,7 +33713,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.87
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.84
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -32438,7 +33811,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.88
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.85
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -32467,7 +33840,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.89
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.86
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -32496,22 +33869,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.9
- '''
- SELECT "posthog_cimdverificationtoken"."id",
- "posthog_cimdverificationtoken"."organization_id",
- "posthog_cimdverificationtoken"."label",
- "posthog_cimdverificationtoken"."cimd_url",
- "posthog_cimdverificationtoken"."mask_value",
- "posthog_cimdverificationtoken"."secure_value",
- "posthog_cimdverificationtoken"."created_by_id",
- "posthog_cimdverificationtoken"."created_at",
- "posthog_cimdverificationtoken"."last_used_at"
- FROM "posthog_cimdverificationtoken"
- WHERE "posthog_cimdverificationtoken"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.90
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.87
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -32531,7 +33889,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.91
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.88
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -32544,7 +33902,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.92
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.89
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -32560,7 +33918,22 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.93
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.9
+ '''
+ SELECT "posthog_cimdverificationtoken"."id",
+ "posthog_cimdverificationtoken"."organization_id",
+ "posthog_cimdverificationtoken"."label",
+ "posthog_cimdverificationtoken"."cimd_url",
+ "posthog_cimdverificationtoken"."mask_value",
+ "posthog_cimdverificationtoken"."secure_value",
+ "posthog_cimdverificationtoken"."created_by_id",
+ "posthog_cimdverificationtoken"."created_at",
+ "posthog_cimdverificationtoken"."last_used_at"
+ FROM "posthog_cimdverificationtoken"
+ WHERE "posthog_cimdverificationtoken"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.90
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -32578,7 +33951,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.94
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.91
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."account_group_type_index" AS "account_group_type_index"
FROM "customer_analytics_teamcustomeranalyticsconfig"
@@ -32587,7 +33960,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.95
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.92
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -32596,7 +33969,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.96
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.93
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -32636,15 +34009,8 @@
"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_listing_dashboards_is_not_nplus1.97
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -32683,12 +34049,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.98
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.94
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -32820,13 +34187,91 @@
"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
+ FROM "posthog_team"
+ INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
+ WHERE "posthog_team"."id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.95
+ '''
+ 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: TestDashboard.test_listing_dashboards_is_not_nplus1.99
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.96
+ '''
+ 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.97
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -32876,9 +34321,40 @@
"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.98
+ '''
+ SELECT "posthog_dashboard"."id" AS "id"
+ 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 "posthog_dashboard"."id" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.99
+ '''
+ SELECT "posthog_dashboard"."id" AS "id",
+ "posthog_dashboard"."name" AS "name"
+ FROM "posthog_dashboard"
+ WHERE (NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboard"."id" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
'''
# ---
# name: TestDashboard.test_retrieve_dashboard
@@ -32946,36 +34422,53 @@
"posthog_user"."onboarding_delegated_to_organization_id",
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
- "posthog_user"."email_opt_in"
+ "posthog_user"."email_opt_in",
+ "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_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
WHERE ("posthog_user"."is_active"
AND "posthog_user"."id" = 99999)
'''
# ---
# name: TestDashboard.test_retrieve_dashboard.10
- '''
- 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" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */)
- '''
-# ---
-# name: TestDashboard.test_retrieve_dashboard.11
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -32996,7 +34489,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard.12
+# name: TestDashboard.test_retrieve_dashboard.11
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -33094,7 +34587,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard.13
+# name: TestDashboard.test_retrieve_dashboard.12
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -33119,7 +34612,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard.14
+# name: TestDashboard.test_retrieve_dashboard.13
'''
SELECT "posthog_filesystemshortcut"."id",
"posthog_filesystemshortcut"."team_id",
@@ -33142,7 +34635,7 @@
AND "posthog_filesystemshortcut"."href" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard.15
+# name: TestDashboard.test_retrieve_dashboard.14
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -33162,6 +34655,363 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
+# name: TestDashboard.test_retrieve_dashboard.15
+ '''
+ SELECT "posthog_dashboardtile"."id",
+ "posthog_dashboardtile"."dashboard_id",
+ "posthog_dashboardtile"."insight_id",
+ "posthog_dashboardtile"."text_id",
+ "posthog_dashboardtile"."button_tile_id",
+ "posthog_dashboardtile"."widget_id",
+ "posthog_dashboardtile"."team_id",
+ "posthog_dashboardtile"."layouts",
+ "posthog_dashboardtile"."color",
+ "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",
+ "posthog_dashboarditem"."id",
+ "posthog_dashboarditem"."name",
+ "posthog_dashboarditem"."derived_name",
+ "posthog_dashboarditem"."description",
+ "posthog_dashboarditem"."team_id",
+ "posthog_dashboarditem"."filters",
+ "posthog_dashboarditem"."filters_hash",
+ "posthog_dashboarditem"."query",
+ "posthog_dashboarditem"."query_metadata",
+ "posthog_dashboarditem"."order",
+ "posthog_dashboarditem"."deleted",
+ "posthog_dashboarditem"."saved",
+ "posthog_dashboarditem"."created_at",
+ "posthog_dashboarditem"."refreshing",
+ "posthog_dashboarditem"."created_by_id",
+ "posthog_dashboarditem"."is_sample",
+ "posthog_dashboarditem"."short_id",
+ "posthog_dashboarditem"."favorited",
+ "posthog_dashboarditem"."refresh_attempt",
+ "posthog_dashboarditem"."last_modified_at",
+ "posthog_dashboarditem"."last_modified_by_id",
+ "posthog_dashboarditem"."dashboard_id",
+ "posthog_dashboarditem"."last_refresh",
+ "posthog_dashboarditem"."layouts",
+ "posthog_dashboarditem"."color",
+ "posthog_dashboarditem"."dive_dashboard_id",
+ "posthog_dashboarditem"."updated_at",
+ "posthog_dashboarditem"."deprecated_tags",
+ "posthog_dashboarditem"."tags",
+ "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"."session_recording_retention_period_days",
+ "posthog_team"."plugins_opt_in",
+ "posthog_team"."opt_out_capture",
+ "posthog_team"."event_names",
+ "posthog_team"."event_names_with_usage",
+ "posthog_team"."event_properties",
+ "posthog_team"."event_properties_with_usage",
+ "posthog_team"."event_properties_numerical",
+ "posthog_team"."external_data_workspace_id",
+ "posthog_team"."external_data_workspace_last_synced_at",
+ "posthog_team"."api_query_rate_limit",
+ "posthog_team"."revenue_tracking_config",
+ "posthog_team"."drop_events_older_than",
+ "posthog_team"."base_currency",
+ "posthog_team"."business_model",
+ "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_password_reset_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",
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in",
+ "posthog_text"."id",
+ "posthog_text"."body",
+ "posthog_text"."agent_context",
+ "posthog_text"."created_by_id",
+ "posthog_text"."last_modified_at",
+ "posthog_text"."last_modified_by_id",
+ "posthog_text"."team_id",
+ "posthog_buttontile"."id",
+ "posthog_buttontile"."url",
+ "posthog_buttontile"."text",
+ "posthog_buttontile"."placement",
+ "posthog_buttontile"."style",
+ "posthog_buttontile"."created_by_id",
+ "posthog_buttontile"."last_modified_at",
+ "posthog_buttontile"."last_modified_by_id",
+ "posthog_buttontile"."team_id",
+ "posthog_dashboardwidget"."id",
+ "posthog_dashboardwidget"."widget_type",
+ "posthog_dashboardwidget"."name",
+ "posthog_dashboardwidget"."description",
+ "posthog_dashboardwidget"."config",
+ "posthog_dashboardwidget"."created_by_id",
+ "posthog_dashboardwidget"."last_modified_at",
+ "posthog_dashboardwidget"."last_modified_by_id",
+ "posthog_dashboardwidget"."team_id",
+ "T10"."id",
+ "T10"."password",
+ "T10"."last_login",
+ "T10"."first_name",
+ "T10"."last_name",
+ "T10"."is_staff",
+ "T10"."date_joined",
+ "T10"."uuid",
+ "T10"."current_organization_id",
+ "T10"."current_team_id",
+ "T10"."email",
+ "T10"."pending_email",
+ "T10"."distinct_id",
+ "T10"."is_email_verified",
+ "T10"."credentials_reviewed_at",
+ "T10"."requested_password_reset_at",
+ "T10"."requested_2fa_reset_at",
+ "T10"."has_seen_product_intro_for",
+ "T10"."strapi_id",
+ "T10"."is_active",
+ "T10"."role_at_organization",
+ "T10"."theme_mode",
+ "T10"."partial_notification_settings",
+ "T10"."anonymize_data",
+ "T10"."allow_impersonation",
+ "T10"."toolbar_mode",
+ "T10"."hedgehog_config",
+ "T10"."allow_sidebar_suggestions",
+ "T10"."shortcut_position",
+ "T10"."passkeys_enabled_for_2fa",
+ "T10"."hide_mcp_hints",
+ "T10"."ui_configuration",
+ "T10"."onboarding_skipped_at",
+ "T10"."onboarding_skipped_reason",
+ "T10"."onboarding_skipped_organization_id",
+ "T10"."onboarding_delegated_to_invite_id",
+ "T10"."onboarding_delegated_to_organization_id",
+ "T10"."onboarding_delegation_accepted_at",
+ "T10"."events_column_config",
+ "T10"."email_opt_in",
+ "T11"."id",
+ "T11"."password",
+ "T11"."last_login",
+ "T11"."first_name",
+ "T11"."last_name",
+ "T11"."is_staff",
+ "T11"."date_joined",
+ "T11"."uuid",
+ "T11"."current_organization_id",
+ "T11"."current_team_id",
+ "T11"."email",
+ "T11"."pending_email",
+ "T11"."distinct_id",
+ "T11"."is_email_verified",
+ "T11"."credentials_reviewed_at",
+ "T11"."requested_password_reset_at",
+ "T11"."requested_2fa_reset_at",
+ "T11"."has_seen_product_intro_for",
+ "T11"."strapi_id",
+ "T11"."is_active",
+ "T11"."role_at_organization",
+ "T11"."theme_mode",
+ "T11"."partial_notification_settings",
+ "T11"."anonymize_data",
+ "T11"."allow_impersonation",
+ "T11"."toolbar_mode",
+ "T11"."hedgehog_config",
+ "T11"."allow_sidebar_suggestions",
+ "T11"."shortcut_position",
+ "T11"."passkeys_enabled_for_2fa",
+ "T11"."hide_mcp_hints",
+ "T11"."ui_configuration",
+ "T11"."onboarding_skipped_at",
+ "T11"."onboarding_skipped_reason",
+ "T11"."onboarding_skipped_organization_id",
+ "T11"."onboarding_delegated_to_invite_id",
+ "T11"."onboarding_delegated_to_organization_id",
+ "T11"."onboarding_delegation_accepted_at",
+ "T11"."events_column_config",
+ "T11"."email_opt_in"
+ FROM "posthog_dashboardtile"
+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
+ LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."id")
+ LEFT OUTER JOIN "posthog_team" ON ("posthog_dashboarditem"."team_id" = "posthog_team"."id")
+ LEFT OUTER JOIN "posthog_user" ON ("posthog_dashboarditem"."created_by_id" = "posthog_user"."id")
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboarditem"."last_modified_by_id" = "T6"."id")
+ LEFT OUTER JOIN "posthog_text" ON ("posthog_dashboardtile"."text_id" = "posthog_text"."id")
+ LEFT OUTER JOIN "posthog_buttontile" ON ("posthog_dashboardtile"."button_tile_id" = "posthog_buttontile"."id")
+ LEFT OUTER JOIN "posthog_dashboardwidget" ON ("posthog_dashboardtile"."widget_id" = "posthog_dashboardwidget"."id")
+ LEFT OUTER JOIN "posthog_user" "T10" ON ("posthog_dashboardwidget"."created_by_id" = "T10"."id")
+ LEFT OUTER JOIN "posthog_user" "T11" ON ("posthog_dashboardwidget"."last_modified_by_id" = "T11"."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_dashboard"."deleted"
+ AND "posthog_dashboardtile"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL)
+ AND (NOT "posthog_dashboarditem"."deleted"
+ OR "posthog_dashboardtile"."insight_id" IS NULL))
+ ORDER BY "posthog_dashboarditem"."order" ASC
+ '''
+# ---
# name: TestDashboard.test_retrieve_dashboard.16
'''
SELECT "posthog_dashboardtile"."id",
@@ -33520,52 +35370,6 @@
'''
# ---
# name: TestDashboard.test_retrieve_dashboard.2
- '''
- 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_retrieve_dashboard.3
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -33703,7 +35507,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard.4
+# name: TestDashboard.test_retrieve_dashboard.3
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -33758,7 +35562,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard.5
+# name: TestDashboard.test_retrieve_dashboard.4
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -33781,7 +35585,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard.6
+# name: TestDashboard.test_retrieve_dashboard.5
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -33834,7 +35638,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard.7
+# name: TestDashboard.test_retrieve_dashboard.6
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -33846,7 +35650,7 @@
OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard.8
+# name: TestDashboard.test_retrieve_dashboard.7
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -33868,7 +35672,7 @@
AND "ee_accesscontrol"."role_id" IS NULL)))
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard.9
+# name: TestDashboard.test_retrieve_dashboard.8
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -33970,6 +35774,29 @@
LIMIT 21
'''
# ---
+# name: TestDashboard.test_retrieve_dashboard.9
+ '''
+ 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" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */)
+ '''
+# ---
# name: TestDashboard.test_retrieve_dashboard_list
'''
SELECT "posthog_user"."id",
@@ -34010,15 +35837,8 @@
"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_retrieve_dashboard_list.1
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -34057,177 +35877,13 @@
"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_retrieve_dashboard_list.10
- '''
- 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" = 'dashboard'
- AND NOT ("posthog_filesystem"."shortcut"
- AND "posthog_filesystem"."shortcut" IS NOT NULL))
- '''
-# ---
-# name: TestDashboard.test_retrieve_dashboard_list.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_retrieve_dashboard_list.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_retrieve_dashboard_list.13
- '''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_taggeditem"
- WHERE ("posthog_taggeditem"."content_type_id" = 99999
- AND "posthog_taggeditem"."object_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_retrieve_dashboard_list.14
- '''
- SELECT "posthog_dashboardtile"."group_key" AS "group_key"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."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_dashboarditem"."deleted"
- OR "posthog_dashboardtile"."insight_id" IS NULL))
- '''
-# ---
-# name: TestDashboard.test_retrieve_dashboard_list.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_retrieve_dashboard_list.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_retrieve_dashboard_list.17
- '''
- 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_retrieve_dashboard_list.18
- '''
- 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_retrieve_dashboard_list.19
- '''
- 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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.2
+# name: TestDashboard.test_retrieve_dashboard_list.1
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -34365,7 +36021,147 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.20
+# name: TestDashboard.test_retrieve_dashboard_list.10
+ '''
+ 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_retrieve_dashboard_list.11
+ '''
+ 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_retrieve_dashboard_list.12
+ '''
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_taggeditem"
+ WHERE ("posthog_taggeditem"."content_type_id" = 99999
+ AND "posthog_taggeditem"."object_id" = 99999)
+ '''
+# ---
+# name: TestDashboard.test_retrieve_dashboard_list.13
+ '''
+ SELECT "posthog_dashboardtile"."group_key" AS "group_key"
+ FROM "posthog_dashboardtile"
+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
+ LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."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_dashboarditem"."deleted"
+ OR "posthog_dashboardtile"."insight_id" IS NULL))
+ '''
+# ---
+# name: TestDashboard.test_retrieve_dashboard_list.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_retrieve_dashboard_list.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_retrieve_dashboard_list.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_retrieve_dashboard_list.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_retrieve_dashboard_list.18
+ '''
+ 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_retrieve_dashboard_list.19
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -34722,7 +36518,62 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.21
+# name: TestDashboard.test_retrieve_dashboard_list.2
+ '''
+ 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: TestDashboard.test_retrieve_dashboard_list.20
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -34731,7 +36582,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.22
+# name: TestDashboard.test_retrieve_dashboard_list.21
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -34771,15 +36622,8 @@
"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_retrieve_dashboard_list.23
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -34818,12 +36662,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.24
+# name: TestDashboard.test_retrieve_dashboard_list.22
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -34961,172 +36806,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.25
- '''
- 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: TestDashboard.test_retrieve_dashboard_list.26
- '''
- 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_retrieve_dashboard_list.27
- '''
- 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_retrieve_dashboard_list.28
- '''
- SELECT "ee_role"."organization_id" AS "role__organization_id",
- "ee_rolemembership"."role_id" AS "role_id"
- FROM "ee_rolemembership"
- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_rolemembership"."organization_member_id" = "posthog_organizationmembership"."id")
- INNER JOIN "ee_role" ON ("ee_rolemembership"."role_id" = "ee_role"."id")
- WHERE ("ee_rolemembership"."user_id" = 99999
- AND ("ee_rolemembership"."organization_member_id" IS NULL
- OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
- '''
-# ---
-# name: TestDashboard.test_retrieve_dashboard_list.29
- '''
- 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"
- 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_retrieve_dashboard_list.3
+# name: TestDashboard.test_retrieve_dashboard_list.23
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -35181,7 +36861,117 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.30
+# name: TestDashboard.test_retrieve_dashboard_list.24
+ '''
+ 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_retrieve_dashboard_list.25
+ '''
+ 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_retrieve_dashboard_list.26
+ '''
+ SELECT "ee_role"."organization_id" AS "role__organization_id",
+ "ee_rolemembership"."role_id" AS "role_id"
+ FROM "ee_rolemembership"
+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_rolemembership"."organization_member_id" = "posthog_organizationmembership"."id")
+ INNER JOIN "ee_role" ON ("ee_rolemembership"."role_id" = "ee_role"."id")
+ WHERE ("ee_rolemembership"."user_id" = 99999
+ AND ("ee_rolemembership"."organization_member_id" IS NULL
+ OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
+ '''
+# ---
+# name: TestDashboard.test_retrieve_dashboard_list.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"
+ 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_retrieve_dashboard_list.28
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboard"
@@ -35197,7 +36987,7 @@
AND NOT "posthog_dashboard"."deleted")
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.31
+# name: TestDashboard.test_retrieve_dashboard_list.29
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -35295,7 +37085,30 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.32
+# name: TestDashboard.test_retrieve_dashboard_list.3
+ '''
+ 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_retrieve_dashboard_list.30
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -35320,7 +37133,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.33
+# name: TestDashboard.test_retrieve_dashboard_list.31
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -35332,7 +37145,7 @@
AND NOT ("posthog_dashboardtile"."insight_id" IS NULL))
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.34
+# name: TestDashboard.test_retrieve_dashboard_list.32
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -35351,7 +37164,7 @@
WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.35
+# name: TestDashboard.test_retrieve_dashboard_list.33
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_taggeditem"
@@ -35359,7 +37172,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.36
+# name: TestDashboard.test_retrieve_dashboard_list.34
'''
SELECT "posthog_dashboardtile"."group_key" AS "group_key"
FROM "posthog_dashboardtile"
@@ -35373,7 +37186,7 @@
OR "posthog_dashboardtile"."insight_id" IS NULL))
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.37
+# name: TestDashboard.test_retrieve_dashboard_list.35
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -35389,7 +37202,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.38
+# name: TestDashboard.test_retrieve_dashboard_list.36
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -35405,7 +37218,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.39
+# name: TestDashboard.test_retrieve_dashboard_list.37
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -35421,30 +37234,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.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_retrieve_dashboard_list.40
+# name: TestDashboard.test_retrieve_dashboard_list.38
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -35463,7 +37253,7 @@
WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.41
+# name: TestDashboard.test_retrieve_dashboard_list.39
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -35483,7 +37273,60 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.42
+# name: TestDashboard.test_retrieve_dashboard_list.4
+ '''
+ 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_retrieve_dashboard_list.40
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -35840,7 +37683,7 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.43
+# name: TestDashboard.test_retrieve_dashboard_list.41
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -35849,7 +37692,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.44
+# name: TestDashboard.test_retrieve_dashboard_list.42
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -35889,15 +37732,8 @@
"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_retrieve_dashboard_list.45
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -35936,12 +37772,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.46
+# name: TestDashboard.test_retrieve_dashboard_list.43
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -36079,7 +37916,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.47
+# name: TestDashboard.test_retrieve_dashboard_list.44
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -36134,7 +37971,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.48
+# name: TestDashboard.test_retrieve_dashboard_list.45
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -36157,60 +37994,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.49
- '''
- 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_retrieve_dashboard_list.5
+# name: TestDashboard.test_retrieve_dashboard_list.46
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -36263,7 +38047,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.50
+# name: TestDashboard.test_retrieve_dashboard_list.47
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -36275,7 +38059,7 @@
OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.51
+# name: TestDashboard.test_retrieve_dashboard_list.48
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -36297,7 +38081,7 @@
AND "ee_accesscontrol"."role_id" IS NULL)))
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.52
+# name: TestDashboard.test_retrieve_dashboard_list.49
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboard"
@@ -36311,6 +38095,167 @@
AND NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))
'''
# ---
+# name: TestDashboard.test_retrieve_dashboard_list.5
+ '''
+ SELECT "ee_role"."organization_id" AS "role__organization_id",
+ "ee_rolemembership"."role_id" AS "role_id"
+ FROM "ee_rolemembership"
+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_rolemembership"."organization_member_id" = "posthog_organizationmembership"."id")
+ INNER JOIN "ee_role" ON ("ee_rolemembership"."role_id" = "ee_role"."id")
+ WHERE ("ee_rolemembership"."user_id" = 99999
+ AND ("ee_rolemembership"."organization_member_id" IS NULL
+ OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
+ '''
+# ---
+# name: TestDashboard.test_retrieve_dashboard_list.50
+ '''
+ 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"."quick_filter_ids",
+ "posthog_dashboard"."customization",
+ "posthog_dashboard"."deprecated_tags",
+ "posthog_dashboard"."tags",
+ "posthog_dashboard"."share_token",
+ "posthog_dashboard"."is_shared",
+ "recent_dashboard_views"."viewed_at" AS "last_viewed_at",
+ ("posthog_dashboard"."id")::varchar AS "_ref_id",
+
+ (SELECT "U0"."path" AS "path"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
+ ORDER BY "U0"."id" ASC
+ LIMIT 1) AS "_folder_path",
+
+ (SELECT "U0"."id" AS "id"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
+ ORDER BY 1 ASC
+ LIMIT 1) AS "_folder_id",
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in"
+ 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)))
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboard"."created_by_id" = "T6"."id")
+ WHERE ("posthog_team"."project_id" = 99999
+ AND NOT ("posthog_dashboard"."deleted")
+ AND NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))
+ ORDER BY "posthog_dashboard"."pinned" DESC,
+ "posthog_dashboard"."name" ASC,
+ "posthog_dashboard"."id" ASC
+ LIMIT 100
+ '''
+# ---
+# name: TestDashboard.test_retrieve_dashboard_list.51
+ '''
+ 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" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */)
+ '''
+# ---
+# name: TestDashboard.test_retrieve_dashboard_list.52
+ '''
+ SELECT "posthog_taggeditem"."id",
+ "posthog_taggeditem"."tag_id",
+ "posthog_taggeditem"."content_type_id",
+ "posthog_taggeditem"."object_id",
+ "posthog_taggeditem"."object_uuid",
+ "posthog_taggeditem"."team_id",
+ "posthog_tag"."id",
+ "posthog_tag"."name",
+ "posthog_tag"."team_id"
+ 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" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
+ '''
+# ---
# name: TestDashboard.test_retrieve_dashboard_list.53
'''
SELECT "posthog_dashboard"."id",
@@ -36461,18 +38406,6 @@
'''
# ---
# name: TestDashboard.test_retrieve_dashboard_list.6
- '''
- SELECT "ee_role"."organization_id" AS "role__organization_id",
- "ee_rolemembership"."role_id" AS "role_id"
- FROM "ee_rolemembership"
- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_rolemembership"."organization_member_id" = "posthog_organizationmembership"."id")
- INNER JOIN "ee_role" ON ("ee_rolemembership"."role_id" = "ee_role"."id")
- WHERE ("ee_rolemembership"."user_id" = 99999
- AND ("ee_rolemembership"."organization_member_id" IS NULL
- OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
- '''
-# ---
-# name: TestDashboard.test_retrieve_dashboard_list.7
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -36494,7 +38427,7 @@
AND "ee_accesscontrol"."role_id" IS NULL)))
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.8
+# name: TestDashboard.test_retrieve_dashboard_list.7
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboard"
@@ -36510,7 +38443,7 @@
AND NOT "posthog_dashboard"."deleted")
'''
# ---
-# name: TestDashboard.test_retrieve_dashboard_list.9
+# name: TestDashboard.test_retrieve_dashboard_list.8
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -36608,3 +38541,28 @@
LIMIT 21
'''
# ---
+# name: TestDashboard.test_retrieve_dashboard_list.9
+ '''
+ 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" = 'dashboard'
+ AND NOT ("posthog_filesystem"."shortcut"
+ AND "posthog_filesystem"."shortcut" IS NOT NULL))
+ '''
+# ---
diff --git a/posthog/api/test/dashboards/test_dashboard.py b/posthog/api/test/dashboards/test_dashboard.py
index 1b7f87ccdb23..0c0c0f7dfdeb 100644
--- a/posthog/api/test/dashboards/test_dashboard.py
+++ b/posthog/api/test/dashboards/test_dashboard.py
@@ -111,7 +111,7 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):
for dashboard_name in dashboard_names:
self.dashboard_api.create_dashboard({"name": dashboard_name})
- with self.assertNumQueries(13):
+ with self.assertNumQueries(12):
response_data = self.dashboard_api.list_dashboards()
self.assertEqual(
[dashboard["name"] for dashboard in response_data["results"]],
@@ -175,7 +175,7 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):
self.dashboard_api.create_dashboard({"name": "also tagged", "tags": ["tag2"]})
self.dashboard_api.create_dashboard({"name": "not tagged"})
- with self.assertNumQueries(13):
+ with self.assertNumQueries(12):
response = self.dashboard_api.list_dashboards(
expected_status=status.HTTP_200_OK, query_params={"tags": ["tag"]}
)
@@ -189,7 +189,7 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):
self.dashboard_api.create_dashboard({"name": "not tagged"})
self.dashboard_api.create_dashboard({"name": "not with the right tag", "tags": ["wrong-tag"]})
- with self.assertNumQueries(13):
+ with self.assertNumQueries(12):
response = self.dashboard_api.list_dashboards(
expected_status=status.HTTP_200_OK, query_params={"tags": ["tag", "tag2"]}
)
@@ -1151,7 +1151,7 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):
with mute_selected_signals():
dashboard_id, _ = self.dashboard_api.create_dashboard({"name": "dashboard"})
- baseline = 9
+ baseline = 8
# Each dashboard GET that materializes at least one insight runner performs one
# property-access-control feature check, memoized across all runners on the dashboard
# by `get_restricted_properties_for_team`'s per-scope cache. It costs no Postgres
@@ -1244,7 +1244,7 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):
self.client.force_login(user_with_collaboration)
- with self.assertNumQueries(9):
+ with self.assertNumQueries(8):
self.dashboard_api.list_dashboards()
for i in range(5):
@@ -1252,7 +1252,7 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):
for j in range(3):
self.dashboard_api.create_insight({"dashboards": [dashboard_id], "name": f"insight-{j}"})
- with self.assertNumQueries(FuzzyInt(11, 13)):
+ with self.assertNumQueries(FuzzyInt(10, 12)):
self.dashboard_api.list_dashboards(query_params={"limit": 300})
def test_listing_dashboards_does_not_include_tiles(self) -> None:
diff --git a/posthog/api/test/notebooks/__snapshots__/test_notebook.ambr b/posthog/api/test/notebooks/__snapshots__/test_notebook.ambr
index 88eaf33ecdf8..f9942a259736 100644
--- a/posthog/api/test/notebooks/__snapshots__/test_notebook.ambr
+++ b/posthog/api/test/notebooks/__snapshots__/test_notebook.ambr
@@ -39,15 +39,8 @@
"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: TestNotebooks.test_updates_notebook.1
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -86,60 +79,106 @@
"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: TestNotebooks.test_updates_notebook.10
- '''
- 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"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
WHERE ("posthog_user"."is_active"
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestNotebooks.test_updates_notebook.11
+# name: TestNotebooks.test_updates_notebook.1
'''
- SELECT "posthog_organization"."id",
+ 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"."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",
@@ -178,12 +217,13 @@
"posthog_organization"."personalization",
"posthog_organization"."domain_whitelist",
"posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ FROM "posthog_team"
+ INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
+ WHERE "posthog_team"."id" = 99999
LIMIT 21
'''
# ---
-# name: TestNotebooks.test_updates_notebook.12
+# name: TestNotebooks.test_updates_notebook.10
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -321,7 +361,7 @@
LIMIT 21
'''
# ---
-# name: TestNotebooks.test_updates_notebook.13
+# name: TestNotebooks.test_updates_notebook.11
'''
SELECT "posthog_project"."updated_at",
"posthog_project"."id",
@@ -337,7 +377,7 @@
LIMIT 21
'''
# ---
-# name: TestNotebooks.test_updates_notebook.14
+# name: TestNotebooks.test_updates_notebook.12
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -392,7 +432,7 @@
LIMIT 21
'''
# ---
-# name: TestNotebooks.test_updates_notebook.15
+# name: TestNotebooks.test_updates_notebook.13
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -415,7 +455,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestNotebooks.test_updates_notebook.16
+# name: TestNotebooks.test_updates_notebook.14
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -468,7 +508,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestNotebooks.test_updates_notebook.17
+# name: TestNotebooks.test_updates_notebook.15
'''
SELECT "posthog_notebook"."id",
"posthog_notebook"."short_id",
@@ -675,7 +715,7 @@
LIMIT 21
'''
# ---
-# name: TestNotebooks.test_updates_notebook.18
+# name: TestNotebooks.test_updates_notebook.16
'''
SELECT "posthog_notebook"."id",
"posthog_notebook"."short_id",
@@ -699,7 +739,7 @@
LIMIT 21
'''
# ---
-# name: TestNotebooks.test_updates_notebook.19
+# name: TestNotebooks.test_updates_notebook.17
'''
SELECT "posthog_notebook"."id",
"posthog_notebook"."short_id",
@@ -725,7 +765,7 @@
UPDATE
'''
# ---
-# name: TestNotebooks.test_updates_notebook.2
+# name: TestNotebooks.test_updates_notebook.18
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -817,8 +857,15 @@
"posthog_team"."api_query_rate_limit",
"posthog_team"."drop_events_older_than",
"posthog_team"."base_currency",
- "posthog_team"."business_model",
- "posthog_organization"."id",
+ "posthog_team"."business_model"
+ FROM "posthog_team"
+ WHERE "posthog_team"."id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestNotebooks.test_updates_notebook.19
+ '''
+ SELECT "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -857,157 +904,28 @@
"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
+ FROM "posthog_organization"
+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ LIMIT 21
+ '''
+# ---
+# name: TestNotebooks.test_updates_notebook.2
+ '''
+ SELECT "posthog_project"."updated_at",
+ "posthog_project"."id",
+ "posthog_project"."organization_id",
+ "posthog_project"."name",
+ "posthog_project"."logo_media_id",
+ "posthog_project"."created_at",
+ "posthog_project"."product_description",
+ "posthog_project"."is_pending_deletion",
+ "posthog_project"."deletion_scheduled_at"
+ FROM "posthog_project"
+ WHERE "posthog_project"."id" = 99999
LIMIT 21
'''
# ---
# name: TestNotebooks.test_updates_notebook.20
- '''
- 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"."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"
- FROM "posthog_team"
- WHERE "posthog_team"."id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestNotebooks.test_updates_notebook.21
- '''
- 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: TestNotebooks.test_updates_notebook.22
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -1032,7 +950,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestNotebooks.test_updates_notebook.23
+# name: TestNotebooks.test_updates_notebook.21
'''
SELECT "posthog_filesystemshortcut"."id",
"posthog_filesystemshortcut"."team_id",
@@ -1055,7 +973,7 @@
AND "posthog_filesystemshortcut"."href" IS NOT NULL))
'''
# ---
-# name: TestNotebooks.test_updates_notebook.24
+# name: TestNotebooks.test_updates_notebook.22
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -1074,7 +992,7 @@
WHERE "posthog_sharingconfiguration"."notebook_id" = '00000000000000000000000000000000'::uuid
'''
# ---
-# name: TestNotebooks.test_updates_notebook.25
+# name: TestNotebooks.test_updates_notebook.23
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -1093,7 +1011,7 @@
WHERE "posthog_sharingconfiguration"."notebook_id" = '00000000000000000000000000000000'::uuid
'''
# ---
-# name: TestNotebooks.test_updates_notebook.26
+# name: TestNotebooks.test_updates_notebook.24
'''
SELECT "posthog_resourcenotebook"."id",
"posthog_resourcenotebook"."notebook_id",
@@ -1103,7 +1021,7 @@
WHERE "posthog_resourcenotebook"."notebook_id" = '00000000000000000000000000000000'::uuid
'''
# ---
-# name: TestNotebooks.test_updates_notebook.27
+# name: TestNotebooks.test_updates_notebook.25
'''
SELECT "posthog_resourcenotebook"."id",
"posthog_resourcenotebook"."notebook_id",
@@ -1113,7 +1031,7 @@
WHERE "posthog_resourcenotebook"."notebook_id" = '00000000000000000000000000000000'::uuid
'''
# ---
-# name: TestNotebooks.test_updates_notebook.28
+# name: TestNotebooks.test_updates_notebook.26
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -1160,7 +1078,7 @@
LIMIT 21
'''
# ---
-# name: TestNotebooks.test_updates_notebook.29
+# name: TestNotebooks.test_updates_notebook.27
'''
SELECT "posthog_resourcenotebook"."id",
"posthog_resourcenotebook"."account_id"
@@ -1171,23 +1089,7 @@
LIMIT 1
'''
# ---
-# name: TestNotebooks.test_updates_notebook.3
- '''
- SELECT "posthog_project"."updated_at",
- "posthog_project"."id",
- "posthog_project"."organization_id",
- "posthog_project"."name",
- "posthog_project"."logo_media_id",
- "posthog_project"."created_at",
- "posthog_project"."product_description",
- "posthog_project"."is_pending_deletion",
- "posthog_project"."deletion_scheduled_at"
- FROM "posthog_project"
- WHERE "posthog_project"."id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestNotebooks.test_updates_notebook.30
+# name: TestNotebooks.test_updates_notebook.28
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -1227,15 +1129,8 @@
"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: TestNotebooks.test_updates_notebook.31
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -1274,12 +1169,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestNotebooks.test_updates_notebook.32
+# name: TestNotebooks.test_updates_notebook.29
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1417,7 +1313,62 @@
LIMIT 21
'''
# ---
-# name: TestNotebooks.test_updates_notebook.33
+# name: TestNotebooks.test_updates_notebook.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: TestNotebooks.test_updates_notebook.30
'''
SELECT "posthog_project"."updated_at",
"posthog_project"."id",
@@ -1433,7 +1384,7 @@
LIMIT 21
'''
# ---
-# name: TestNotebooks.test_updates_notebook.34
+# name: TestNotebooks.test_updates_notebook.31
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1488,7 +1439,7 @@
LIMIT 21
'''
# ---
-# name: TestNotebooks.test_updates_notebook.35
+# name: TestNotebooks.test_updates_notebook.32
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -1511,7 +1462,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestNotebooks.test_updates_notebook.36
+# name: TestNotebooks.test_updates_notebook.33
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1564,7 +1515,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestNotebooks.test_updates_notebook.37
+# name: TestNotebooks.test_updates_notebook.34
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_activitylog"
@@ -1572,7 +1523,7 @@
AND "posthog_activitylog"."team_id" = 99999)
'''
# ---
-# name: TestNotebooks.test_updates_notebook.38
+# name: TestNotebooks.test_updates_notebook.35
'''
SELECT "posthog_activitylog"."id",
"posthog_activitylog"."team_id",
@@ -1639,61 +1590,6 @@
'''
# ---
# name: TestNotebooks.test_updates_notebook.4
- '''
- 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: TestNotebooks.test_updates_notebook.5
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -1716,7 +1612,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestNotebooks.test_updates_notebook.6
+# name: TestNotebooks.test_updates_notebook.5
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1769,7 +1665,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestNotebooks.test_updates_notebook.7
+# name: TestNotebooks.test_updates_notebook.6
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -1794,7 +1690,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestNotebooks.test_updates_notebook.8
+# name: TestNotebooks.test_updates_notebook.7
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1892,7 +1788,7 @@
LIMIT 21
'''
# ---
-# name: TestNotebooks.test_updates_notebook.9
+# name: TestNotebooks.test_updates_notebook.8
'''
SELECT "posthog_resourcenotebook"."id",
"posthog_resourcenotebook"."account_id"
@@ -1903,3 +1799,89 @@
LIMIT 1
'''
# ---
+# name: TestNotebooks.test_updates_notebook.9
+ '''
+ 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",
+ "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_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
+ '''
+# ---
diff --git a/posthog/api/test/test_cohort.py b/posthog/api/test/test_cohort.py
index 8987f83e4169..9b0ef9ee4b84 100644
--- a/posthog/api/test/test_cohort.py
+++ b/posthog/api/test/test_cohort.py
@@ -452,7 +452,7 @@ class TestCohort(TestExportMixin, ClickhouseTestMixin, APIBaseTest, QueryMatchin
)
self.assertEqual(response.status_code, 201, response.content)
- with self.assertNumQueries(12):
+ with self.assertNumQueries(11):
response = self.client.get(f"/api/projects/{self.team.id}/cohorts")
assert len(response.json()["results"]) == 1
@@ -467,7 +467,7 @@ class TestCohort(TestExportMixin, ClickhouseTestMixin, APIBaseTest, QueryMatchin
)
self.assertEqual(response.status_code, 201, response.content)
- with self.assertNumQueries(12):
+ with self.assertNumQueries(11):
response = self.client.get(f"/api/projects/{self.team.id}/cohorts")
assert len(response.json()["results"]) == 3
diff --git a/posthog/api/test/test_event.py b/posthog/api/test/test_event.py
index af3785c7c677..12a5d741686f 100644
--- a/posthog/api/test/test_event.py
+++ b/posthog/api/test/test_event.py
@@ -117,7 +117,7 @@ class TestEvents(ClickhouseTestMixin, APIBaseTest):
# HogQL database build. +1 for the flag-cache TTL instance setting, cold-cache here but
# TTL-cached per worker in production. +1 for the organization's flag_evaluations mode lookup in
# the HogQL database build.
- with self.assertNumQueries(17):
+ with self.assertNumQueries(16):
response = self.client.get(f"/api/projects/{self.team.id}/events/?event=event_name").json()
assert response["results"][0]["event"] == "event_name"
@@ -155,7 +155,7 @@ class TestEvents(ClickhouseTestMixin, APIBaseTest):
# +1 for the saved-expressions fetch in the HogQL database build. +1 for the flag-cache
# TTL instance setting, cold-cache here but TTL-cached per worker in production. +1 for
# the organization's flag_evaluations mode lookup in the HogQL database build.
- expected_queries = 24 if settings.CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA else 25
+ expected_queries = 23 if settings.CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA else 24
with self.assertNumQueries(expected_queries):
response = self.client.get(
diff --git a/posthog/api/test/test_my_notifications.py b/posthog/api/test/test_my_notifications.py
index cb9a83bd3e28..c55a17017142 100644
--- a/posthog/api/test/test_my_notifications.py
+++ b/posthog/api/test/test_my_notifications.py
@@ -349,7 +349,7 @@ class TestMyNotifications(APIBaseTest, QueryMatchingTest):
user=user, defaults={"last_viewed_activity_date": f"2023-0{i}-17T04:36:50Z"}
)
- with self.assertNumQueries(FuzzyInt(18, 18)):
+ with self.assertNumQueries(FuzzyInt(17, 17)):
self.client.get(f"/api/projects/{self.team.id}/my_notifications")
def test_microsecond_precision_mismatch(self):
diff --git a/posthog/api/test/test_person.py b/posthog/api/test/test_person.py
index 199b7283414b..3235d57fbd43 100644
--- a/posthog/api/test/test_person.py
+++ b/posthog/api/test/test_person.py
@@ -2257,7 +2257,7 @@ class TestPerson(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):
# kill-switch and flag-cache TTL instance settings, cold-cache here but TTL-cached per
# worker in production. +1 for the organization's flag_evaluations mode lookup in the HogQL
# database build.
- with self.assertNumQueries(18):
+ with self.assertNumQueries(17):
response = self.client.get("/api/person/?limit=10").json()
self.assertEqual(len(response["results"]), 9)
returned_ids += [x["distinct_ids"][0] for x in response["results"]]
@@ -2272,7 +2272,7 @@ class TestPerson(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):
# 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. +1 for the
# revenue analytics config, which each request reads on its own Team instance.
- with self.assertNumQueries(22):
+ with self.assertNumQueries(21):
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_preflight.py b/posthog/api/test/test_preflight.py
index 1ca15ed27937..e953707046d5 100644
--- a/posthog/api/test/test_preflight.py
+++ b/posthog/api/test/test_preflight.py
@@ -262,7 +262,7 @@ class TestPreflight(APIBaseTest, QueryMatchingTest):
def test_cloud_preflight_limited_db_queries(self):
with self.is_cloud(True):
# :IMPORTANT: This code is hit _every_ web request on cloud so avoid ever increasing db load.
- with self.assertNumQueries(5): # session, user, team, organization and slack instance setting.
+ with self.assertNumQueries(4): # session, user with organization, team and slack instance setting.
response = self.client.get("/_preflight/")
assert response.status_code == status.HTTP_200_OK
diff --git a/posthog/middleware.py b/posthog/middleware.py
index b683fb2ec913..1516ce297d5c 100644
--- a/posthog/middleware.py
+++ b/posthog/middleware.py
@@ -8,11 +8,14 @@ from collections.abc import Callable
from contextlib import nullcontext, suppress
from datetime import UTC, datetime, timedelta
from enum import StrEnum
+from functools import partial
from ipaddress import ip_address, ip_network
-from typing import Optional, cast
+from typing import Any, Optional, cast
from django.conf import settings
+from django.contrib import auth
from django.contrib.auth import BACKEND_SESSION_KEY, logout
+from django.contrib.auth.middleware import AuthenticationMiddleware as DjangoAuthenticationMiddleware
from django.core.cache import cache
from django.core.exceptions import MiddlewareNotUsed
from django.db import (
@@ -26,6 +29,7 @@ from django.shortcuts import redirect
from django.urls import Resolver404, resolve
from django.utils.cache import add_never_cache_headers
from django.utils.deprecation import MiddlewareMixin
+from django.utils.functional import SimpleLazyObject
from django.utils.http import http_date, url_has_allowed_host_and_scheme
import structlog
@@ -1186,6 +1190,34 @@ def get_impersonated_session_expires_at(request: HttpRequest) -> Optional[dateti
return min(idle_expiry_time, total_expiry_time)
+def _get_session_user(request: HttpRequest) -> Any:
+ if not hasattr(request, "_cached_user"):
+ with User.objects.joining_current_organization():
+ setattr(request, "_cached_user", auth.get_user(request)) # noqa: B010
+ return getattr(request, "_cached_user") # noqa: B009
+
+
+async def _aget_session_user(request: HttpRequest) -> Any:
+ if not hasattr(request, "_acached_user"):
+ with User.objects.joining_current_organization():
+ setattr(request, "_acached_user", await auth.aget_user(request)) # noqa: B010
+ return getattr(request, "_acached_user") # noqa: B009
+
+
+class AuthenticationMiddleware(DjangoAuthenticationMiddleware):
+ """Load the session user with its current organization in one query.
+
+ The 2FA and verified-domain checks in `SessionAuthentication` read `user.organization` on every
+ session request, so a separate lazy load costs one query each time.
+ """
+
+ def process_request(self, request: HttpRequest) -> None:
+ super().process_request(request)
+ # The attribute names match Django's middleware, because AdminImpersonationMiddleware writes `_cached_user`.
+ setattr(request, "user", SimpleLazyObject(lambda: _get_session_user(request))) # noqa: B010
+ setattr(request, "auser", partial(_aget_session_user, request)) # noqa: B010
+
+
class AdminImpersonationMiddleware:
"""
During impersonation, allow the original (staff) user to keep using the admin panel.
diff --git a/posthog/models/user.py b/posthog/models/user.py
index 1da48b0615cf..6da1f792b7f6 100644
--- a/posthog/models/user.py
+++ b/posthog/models/user.py
@@ -1,4 +1,6 @@
-from collections.abc import Callable, Collection
+from collections.abc import Callable, Collection, Iterator
+from contextlib import contextmanager
+from contextvars import ContextVar
from functools import cached_property
from typing import TYPE_CHECKING, Any, NoReturn, Optional, Self, TypedDict, cast
@@ -127,11 +129,26 @@ ROLE_CHOICES = (
)
+_join_current_organization: ContextVar[bool] = ContextVar("user_join_current_organization", default=False)
+
+
class UserManager(BaseUserManager):
"""Define a model manager for User model with no username field."""
def get_queryset(self):
- return super().get_queryset().defer(*DEFERED_ATTRS)
+ queryset = super().get_queryset().defer(*DEFERED_ATTRS)
+ if _join_current_organization.get():
+ queryset = queryset.select_related("current_organization")
+ return queryset
+
+ @contextmanager
+ def joining_current_organization(self) -> Iterator[None]:
+ # Authentication backends load the user through this manager, and we cannot pass them a queryset.
+ token = _join_current_organization.set(True)
+ try:
+ yield
+ finally:
+ _join_current_organization.reset(token)
use_in_migrations = True
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 ab1581293efb..6bc57a076cb4 100644
--- a/posthog/session_recordings/test/__snapshots__/test_session_recording_playlist.ambr
+++ b/posthog/session_recordings/test/__snapshots__/test_session_recording_playlist.ambr
@@ -50,219 +50,6 @@
'''
# ---
# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.10
- '''
- SELECT "posthog_sessionrecordingplaylist"."id",
- "posthog_sessionrecordingplaylist"."short_id",
- "posthog_sessionrecordingplaylist"."name",
- "posthog_sessionrecordingplaylist"."derived_name",
- "posthog_sessionrecordingplaylist"."description",
- "posthog_sessionrecordingplaylist"."team_id",
- "posthog_sessionrecordingplaylist"."pinned",
- "posthog_sessionrecordingplaylist"."deleted",
- "posthog_sessionrecordingplaylist"."filters",
- "posthog_sessionrecordingplaylist"."type",
- "posthog_sessionrecordingplaylist"."created_at",
- "posthog_sessionrecordingplaylist"."created_by_id",
- "posthog_sessionrecordingplaylist"."last_modified_at",
- "posthog_sessionrecordingplaylist"."last_modified_by_id",
- "posthog_sessionrecordingplaylist"."last_counted_at",
- "posthog_sessionrecordingplaylist"."is_static",
- "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"."session_recording_retention_period_days",
- "posthog_team"."plugins_opt_in",
- "posthog_team"."opt_out_capture",
- "posthog_team"."event_names",
- "posthog_team"."event_names_with_usage",
- "posthog_team"."event_properties",
- "posthog_team"."event_properties_with_usage",
- "posthog_team"."event_properties_numerical",
- "posthog_team"."external_data_workspace_id",
- "posthog_team"."external_data_workspace_last_synced_at",
- "posthog_team"."api_query_rate_limit",
- "posthog_team"."revenue_tracking_config",
- "posthog_team"."drop_events_older_than",
- "posthog_team"."base_currency",
- "posthog_team"."business_model",
- "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_password_reset_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",
- "T4"."id",
- "T4"."password",
- "T4"."last_login",
- "T4"."first_name",
- "T4"."last_name",
- "T4"."is_staff",
- "T4"."date_joined",
- "T4"."uuid",
- "T4"."current_organization_id",
- "T4"."current_team_id",
- "T4"."email",
- "T4"."pending_email",
- "T4"."distinct_id",
- "T4"."is_email_verified",
- "T4"."credentials_reviewed_at",
- "T4"."requested_password_reset_at",
- "T4"."requested_2fa_reset_at",
- "T4"."has_seen_product_intro_for",
- "T4"."strapi_id",
- "T4"."is_active",
- "T4"."role_at_organization",
- "T4"."theme_mode",
- "T4"."partial_notification_settings",
- "T4"."anonymize_data",
- "T4"."allow_impersonation",
- "T4"."toolbar_mode",
- "T4"."hedgehog_config",
- "T4"."allow_sidebar_suggestions",
- "T4"."shortcut_position",
- "T4"."passkeys_enabled_for_2fa",
- "T4"."hide_mcp_hints",
- "T4"."ui_configuration",
- "T4"."onboarding_skipped_at",
- "T4"."onboarding_skipped_reason",
- "T4"."onboarding_skipped_organization_id",
- "T4"."onboarding_delegated_to_invite_id",
- "T4"."onboarding_delegated_to_organization_id",
- "T4"."onboarding_delegation_accepted_at",
- "T4"."events_column_config",
- "T4"."email_opt_in"
- FROM "posthog_sessionrecordingplaylist"
- INNER JOIN "posthog_team" ON ("posthog_sessionrecordingplaylist"."team_id" = "posthog_team"."id")
- LEFT OUTER JOIN "posthog_user" ON ("posthog_sessionrecordingplaylist"."created_by_id" = "posthog_user"."id")
- LEFT OUTER JOIN "posthog_user" "T4" ON ("posthog_sessionrecordingplaylist"."last_modified_by_id" = "T4"."id")
- WHERE (NOT "posthog_sessionrecordingplaylist"."deleted"
- AND NOT "posthog_sessionrecordingplaylist"."deleted"
- AND "posthog_sessionrecordingplaylist"."type" = 'filters'
- AND "posthog_sessionrecordingplaylist"."team_id" = 99999
- AND NOT "posthog_sessionrecordingplaylist"."deleted"
- AND NOT "posthog_sessionrecordingplaylist"."deleted"
- AND "posthog_sessionrecordingplaylist"."type" = 'filters')
- ORDER BY "posthog_sessionrecordingplaylist"."last_modified_at" DESC,
- "posthog_sessionrecordingplaylist"."id" ASC
- LIMIT 100
- '''
-# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.11
'''
SELECT "posthog_sessionrecordingplaylistitem"."playlist_id" AS "playlist_id",
COUNT("posthog_sessionrecordingplaylistitem"."id") AS "c"
@@ -282,7 +69,7 @@
GROUP BY 1
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.12
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.11
'''
SELECT "posthog_sessionrecordingplaylistitem"."playlist_id" AS "playlist_id",
"posthog_sessionrecordingplaylistitem"."recording_id" AS "recording_id"
@@ -301,7 +88,7 @@
AND "posthog_sessionrecording"."start_time" IS NOT NULL))
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.13
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.12
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -341,15 +128,8 @@
"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: TestSessionRecordingPlaylist.test_filters_playlist_by_type.14
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -388,12 +168,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.15
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.13
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -531,7 +312,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.16
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.14
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -586,7 +367,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.17
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.15
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -609,7 +390,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.18
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.16
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -662,7 +443,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.19
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.17
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_sessionrecordingplaylist"
@@ -675,32 +456,7 @@
AND "posthog_sessionrecordingplaylist"."type" = 'collection')
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.2
- '''
- 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" = 'session_recording_playlist'
- AND NOT ("posthog_filesystem"."shortcut"
- AND "posthog_filesystem"."shortcut" IS NOT NULL))
- '''
-# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.20
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.18
'''
SELECT "posthog_sessionrecordingplaylist"."id",
"posthog_sessionrecordingplaylist"."short_id",
@@ -913,7 +669,7 @@
LIMIT 94
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.21
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.19
'''
SELECT "posthog_sessionrecordingplaylistitem"."playlist_id" AS "playlist_id",
COUNT("posthog_sessionrecordingplaylistitem"."id") AS "c"
@@ -933,7 +689,32 @@
GROUP BY 1
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.22
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.2
+ '''
+ 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" = 'session_recording_playlist'
+ AND NOT ("posthog_filesystem"."shortcut"
+ AND "posthog_filesystem"."shortcut" IS NOT NULL))
+ '''
+# ---
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.20
'''
SELECT "posthog_sessionrecordingplaylistitem"."playlist_id" AS "playlist_id",
"posthog_sessionrecordingplaylistitem"."recording_id" AS "recording_id"
@@ -952,7 +733,7 @@
AND "posthog_sessionrecording"."start_time" IS NOT NULL))
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.23
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.21
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
FROM "posthog_sessionrecordingviewed"
@@ -961,7 +742,7 @@
AND "posthog_sessionrecordingviewed"."session_id" IN ('00000000-0000-0000-0000-000000000000'))
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.24
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.22
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_sessionrecordingviewed"
@@ -969,7 +750,7 @@
AND "posthog_sessionrecordingviewed"."user_id" = 99999)
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.25
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.23
'''
SELECT COUNT(*)
FROM
@@ -981,7 +762,7 @@
AND NOT ("posthog_comment"."item_id" IS NULL))) subquery
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.26
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.24
'''
SELECT COUNT(*)
FROM
@@ -992,7 +773,7 @@
AND NOT ("posthog_sharingconfiguration"."recording_id" IS NULL))) subquery
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.27
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.25
'''
SELECT COUNT(*)
FROM
@@ -1007,7 +788,7 @@
AND "posthog_exportedasset"."export_context" IS NOT NULL))) subquery
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.28
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.26
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -1016,7 +797,7 @@
LIMIT 1
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.29
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.27
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -1081,53 +862,7 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.3
- '''
- 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: TestSessionRecordingPlaylist.test_filters_playlist_by_type.30
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.28
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -1140,7 +875,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.31
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.29
'''
SELECT "posthog_externaldatasource"."created_by_id",
"posthog_externaldatasource"."created_at",
@@ -1178,7 +913,93 @@
AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.32
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.3
+ '''
+ 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",
+ "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_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
+ '''
+# ---
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.30
'''
SELECT "posthog_datawarehousejoin"."created_by_id",
"posthog_datawarehousejoin"."created_at",
@@ -1198,7 +1019,7 @@
AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.33
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.31
'''
SELECT "data_tools_datawarehouseexpression"."deleted",
"data_tools_datawarehouseexpression"."deleted_at",
@@ -1217,7 +1038,7 @@
AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.34
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.32
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -1250,7 +1071,7 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.35
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.33
'''
SELECT "posthog_propertydefinition"."id",
"posthog_propertydefinition"."team_id",
@@ -1274,7 +1095,7 @@
5 /* ... */))
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.36
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.34
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -1314,15 +1135,8 @@
"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: TestSessionRecordingPlaylist.test_filters_playlist_by_type.37
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -1361,12 +1175,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.38
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.35
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1504,7 +1319,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.39
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.36
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1559,9 +1374,39 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.4
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.37
+ '''
+ 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.38
'''
- SELECT "posthog_organization"."id",
+ 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",
@@ -1600,43 +1445,115 @@
"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
+ FROM "posthog_organizationmembership"
+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
+ WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.40
+# 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))
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_sessionrecordingplaylist"
+ WHERE (NOT "posthog_sessionrecordingplaylist"."deleted"
+ AND NOT "posthog_sessionrecordingplaylist"."deleted"
+ AND "posthog_sessionrecordingplaylist"."team_id" = 99999
+ AND NOT "posthog_sessionrecordingplaylist"."deleted"
+ AND NOT "posthog_sessionrecordingplaylist"."deleted")
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.41
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.4
'''
- 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",
+ 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"."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",
@@ -1676,23 +1593,13 @@
"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: TestSessionRecordingPlaylist.test_filters_playlist_by_type.42
- '''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_sessionrecordingplaylist"
- WHERE (NOT "posthog_sessionrecordingplaylist"."deleted"
- AND NOT "posthog_sessionrecordingplaylist"."deleted"
- AND "posthog_sessionrecordingplaylist"."team_id" = 99999
- AND NOT "posthog_sessionrecordingplaylist"."deleted"
- AND NOT "posthog_sessionrecordingplaylist"."deleted")
+ FROM "posthog_team"
+ INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
+ WHERE "posthog_team"."id" = 99999
+ LIMIT 21
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.43
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.40
'''
SELECT "posthog_sessionrecordingplaylist"."id",
"posthog_sessionrecordingplaylist"."short_id",
@@ -1903,7 +1810,7 @@
LIMIT 94
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.44
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.41
'''
SELECT "posthog_sessionrecordingplaylistitem"."playlist_id" AS "playlist_id",
COUNT("posthog_sessionrecordingplaylistitem"."id") AS "c"
@@ -1923,7 +1830,7 @@
GROUP BY 1
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.45
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.42
'''
SELECT "posthog_sessionrecordingplaylistitem"."playlist_id" AS "playlist_id",
"posthog_sessionrecordingplaylistitem"."recording_id" AS "recording_id"
@@ -1942,7 +1849,7 @@
AND "posthog_sessionrecording"."start_time" IS NOT NULL))
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.46
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.43
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
FROM "posthog_sessionrecordingviewed"
@@ -1951,7 +1858,7 @@
AND "posthog_sessionrecordingviewed"."session_id" IN ('00000000-0000-0000-0000-000000000000'))
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.47
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.44
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_sessionrecordingviewed"
@@ -1959,6 +1866,44 @@
AND "posthog_sessionrecordingviewed"."user_id" = 99999)
'''
# ---
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.45
+ '''
+ SELECT COUNT(*)
+ FROM
+ (SELECT DISTINCT "posthog_comment"."item_id" AS "item_id"
+ FROM "posthog_comment"
+ WHERE (NOT "posthog_comment"."deleted"
+ AND "posthog_comment"."scope" = 'Replay'
+ AND "posthog_comment"."team_id" = 99999
+ AND NOT ("posthog_comment"."item_id" IS NULL))) subquery
+ '''
+# ---
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.46
+ '''
+ SELECT COUNT(*)
+ FROM
+ (SELECT DISTINCT "posthog_sharingconfiguration"."recording_id" AS "recording__session_id"
+ FROM "posthog_sharingconfiguration"
+ WHERE ("posthog_sharingconfiguration"."enabled"
+ AND "posthog_sharingconfiguration"."team_id" = 99999
+ AND NOT ("posthog_sharingconfiguration"."recording_id" IS NULL))) subquery
+ '''
+# ---
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.47
+ '''
+ 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.48
'''
SELECT COUNT(*)
@@ -1984,97 +1929,13 @@
# ---
# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.5
'''
- 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"."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",
+ 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",
@@ -2114,9 +1975,10 @@
"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
+ 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
'''
# ---
@@ -2136,61 +1998,6 @@
'''
# ---
# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.6
- '''
- 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: TestSessionRecordingPlaylist.test_filters_playlist_by_type.7
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -2213,7 +2020,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.8
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.7
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -2266,7 +2073,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.9
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.8
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_sessionrecordingplaylist"
@@ -2279,3 +2086,216 @@
AND "posthog_sessionrecordingplaylist"."type" = 'filters')
'''
# ---
+# name: TestSessionRecordingPlaylist.test_filters_playlist_by_type.9
+ '''
+ SELECT "posthog_sessionrecordingplaylist"."id",
+ "posthog_sessionrecordingplaylist"."short_id",
+ "posthog_sessionrecordingplaylist"."name",
+ "posthog_sessionrecordingplaylist"."derived_name",
+ "posthog_sessionrecordingplaylist"."description",
+ "posthog_sessionrecordingplaylist"."team_id",
+ "posthog_sessionrecordingplaylist"."pinned",
+ "posthog_sessionrecordingplaylist"."deleted",
+ "posthog_sessionrecordingplaylist"."filters",
+ "posthog_sessionrecordingplaylist"."type",
+ "posthog_sessionrecordingplaylist"."created_at",
+ "posthog_sessionrecordingplaylist"."created_by_id",
+ "posthog_sessionrecordingplaylist"."last_modified_at",
+ "posthog_sessionrecordingplaylist"."last_modified_by_id",
+ "posthog_sessionrecordingplaylist"."last_counted_at",
+ "posthog_sessionrecordingplaylist"."is_static",
+ "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"."session_recording_retention_period_days",
+ "posthog_team"."plugins_opt_in",
+ "posthog_team"."opt_out_capture",
+ "posthog_team"."event_names",
+ "posthog_team"."event_names_with_usage",
+ "posthog_team"."event_properties",
+ "posthog_team"."event_properties_with_usage",
+ "posthog_team"."event_properties_numerical",
+ "posthog_team"."external_data_workspace_id",
+ "posthog_team"."external_data_workspace_last_synced_at",
+ "posthog_team"."api_query_rate_limit",
+ "posthog_team"."revenue_tracking_config",
+ "posthog_team"."drop_events_older_than",
+ "posthog_team"."base_currency",
+ "posthog_team"."business_model",
+ "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_password_reset_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",
+ "T4"."id",
+ "T4"."password",
+ "T4"."last_login",
+ "T4"."first_name",
+ "T4"."last_name",
+ "T4"."is_staff",
+ "T4"."date_joined",
+ "T4"."uuid",
+ "T4"."current_organization_id",
+ "T4"."current_team_id",
+ "T4"."email",
+ "T4"."pending_email",
+ "T4"."distinct_id",
+ "T4"."is_email_verified",
+ "T4"."credentials_reviewed_at",
+ "T4"."requested_password_reset_at",
+ "T4"."requested_2fa_reset_at",
+ "T4"."has_seen_product_intro_for",
+ "T4"."strapi_id",
+ "T4"."is_active",
+ "T4"."role_at_organization",
+ "T4"."theme_mode",
+ "T4"."partial_notification_settings",
+ "T4"."anonymize_data",
+ "T4"."allow_impersonation",
+ "T4"."toolbar_mode",
+ "T4"."hedgehog_config",
+ "T4"."allow_sidebar_suggestions",
+ "T4"."shortcut_position",
+ "T4"."passkeys_enabled_for_2fa",
+ "T4"."hide_mcp_hints",
+ "T4"."ui_configuration",
+ "T4"."onboarding_skipped_at",
+ "T4"."onboarding_skipped_reason",
+ "T4"."onboarding_skipped_organization_id",
+ "T4"."onboarding_delegated_to_invite_id",
+ "T4"."onboarding_delegated_to_organization_id",
+ "T4"."onboarding_delegation_accepted_at",
+ "T4"."events_column_config",
+ "T4"."email_opt_in"
+ FROM "posthog_sessionrecordingplaylist"
+ INNER JOIN "posthog_team" ON ("posthog_sessionrecordingplaylist"."team_id" = "posthog_team"."id")
+ LEFT OUTER JOIN "posthog_user" ON ("posthog_sessionrecordingplaylist"."created_by_id" = "posthog_user"."id")
+ LEFT OUTER JOIN "posthog_user" "T4" ON ("posthog_sessionrecordingplaylist"."last_modified_by_id" = "T4"."id")
+ WHERE (NOT "posthog_sessionrecordingplaylist"."deleted"
+ AND NOT "posthog_sessionrecordingplaylist"."deleted"
+ AND "posthog_sessionrecordingplaylist"."type" = 'filters'
+ AND "posthog_sessionrecordingplaylist"."team_id" = 99999
+ AND NOT "posthog_sessionrecordingplaylist"."deleted"
+ AND NOT "posthog_sessionrecordingplaylist"."deleted"
+ AND "posthog_sessionrecordingplaylist"."type" = 'filters')
+ ORDER BY "posthog_sessionrecordingplaylist"."last_modified_at" DESC,
+ "posthog_sessionrecordingplaylist"."id" ASC
+ LIMIT 100
+ '''
+# ---
diff --git a/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr b/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr
index db8e451d4801..8b8a64c7c48a 100644
--- a/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr
+++ b/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr
@@ -47,15 +47,8 @@
"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_get_session_recordings_returns_newest_first.1
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -94,174 +87,13 @@
"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_get_session_recordings_returns_newest_first.10
- '''
- 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_get_session_recordings_returns_newest_first.11
- '''
- 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_get_session_recordings_returns_newest_first.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_get_session_recordings_returns_newest_first.13
- '''
- SELECT "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"
- FROM "posthog_datawarehousetable"
- LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")
- WHERE ("posthog_datawarehousetable"."team_id" = 99999
- AND NOT ("posthog_datawarehousetable"."deleted"
- AND "posthog_datawarehousetable"."deleted" IS NOT NULL)
- AND NOT ("posthog_externaldatasource"."deleted"
- AND "posthog_externaldatasource"."deleted" IS NOT NULL)
- AND NOT ("posthog_externaldatasource"."access_method" = 'direct'
- AND "posthog_externaldatasource"."access_method" IS NOT NULL))
- ORDER BY "posthog_datawarehousetable"."created_at" DESC
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.14
- '''
- SELECT "posthog_sessionrecording"."id",
- "posthog_sessionrecording"."session_id",
- "posthog_sessionrecording"."team_id",
- "posthog_sessionrecording"."created_at",
- "posthog_sessionrecording"."deleted",
- "posthog_sessionrecording"."distinct_id",
- "posthog_sessionrecording"."duration",
- "posthog_sessionrecording"."active_seconds",
- "posthog_sessionrecording"."inactive_seconds",
- "posthog_sessionrecording"."start_time",
- "posthog_sessionrecording"."end_time",
- "posthog_sessionrecording"."click_count",
- "posthog_sessionrecording"."keypress_count",
- "posthog_sessionrecording"."mouse_activity_count",
- "posthog_sessionrecording"."console_log_count",
- "posthog_sessionrecording"."console_warn_count",
- "posthog_sessionrecording"."console_error_count",
- "posthog_sessionrecording"."start_url",
- "posthog_sessionrecording"."retention_period_days"
- FROM "posthog_sessionrecording"
- WHERE ("posthog_sessionrecording"."session_id" IN ('middle_session',
- 'new_session',
- 'old_session')
- AND "posthog_sessionrecording"."team_id" = 99999)
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.15
- '''
- SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
- FROM "posthog_sessionrecordingviewed"
- WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999
- AND "posthog_sessionrecordingviewed"."user_id" = 99999
- AND "posthog_sessionrecordingviewed"."session_id" IN ('new_session',
- 'middle_session',
- 'old_session'))
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.16
- '''
- 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 ('new_session',
- 'middle_session',
- 'old_session')
- AND "posthog_sessionrecordingviewed"."team_id" = 99999
- AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.2
+# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.1
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -399,72 +231,209 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.3
+# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.10
'''
- 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
+ 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_get_session_recordings_returns_newest_first.4
+# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.11
'''
- 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",
+ 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_get_session_recordings_returns_newest_first.12
+ '''
+ SELECT "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"
+ FROM "posthog_datawarehousetable"
+ LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")
+ WHERE ("posthog_datawarehousetable"."team_id" = 99999
+ AND NOT ("posthog_datawarehousetable"."deleted"
+ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)
+ AND NOT ("posthog_externaldatasource"."deleted"
+ AND "posthog_externaldatasource"."deleted" IS NOT NULL)
+ AND NOT ("posthog_externaldatasource"."access_method" = 'direct'
+ AND "posthog_externaldatasource"."access_method" IS NOT NULL))
+ ORDER BY "posthog_datawarehousetable"."created_at" DESC
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.13
+ '''
+ SELECT "posthog_sessionrecording"."id",
+ "posthog_sessionrecording"."session_id",
+ "posthog_sessionrecording"."team_id",
+ "posthog_sessionrecording"."created_at",
+ "posthog_sessionrecording"."deleted",
+ "posthog_sessionrecording"."distinct_id",
+ "posthog_sessionrecording"."duration",
+ "posthog_sessionrecording"."active_seconds",
+ "posthog_sessionrecording"."inactive_seconds",
+ "posthog_sessionrecording"."start_time",
+ "posthog_sessionrecording"."end_time",
+ "posthog_sessionrecording"."click_count",
+ "posthog_sessionrecording"."keypress_count",
+ "posthog_sessionrecording"."mouse_activity_count",
+ "posthog_sessionrecording"."console_log_count",
+ "posthog_sessionrecording"."console_warn_count",
+ "posthog_sessionrecording"."console_error_count",
+ "posthog_sessionrecording"."start_url",
+ "posthog_sessionrecording"."retention_period_days"
+ FROM "posthog_sessionrecording"
+ WHERE ("posthog_sessionrecording"."session_id" IN ('middle_session',
+ 'new_session',
+ 'old_session')
+ AND "posthog_sessionrecording"."team_id" = 99999)
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.14
+ '''
+ SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
+ FROM "posthog_sessionrecordingviewed"
+ WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999
+ AND "posthog_sessionrecordingviewed"."user_id" = 99999
+ AND "posthog_sessionrecordingviewed"."session_id" IN ('new_session',
+ 'middle_session',
+ 'old_session'))
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.15
+ '''
+ 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 ('new_session',
+ 'middle_session',
+ 'old_session')
+ AND "posthog_sessionrecordingviewed"."team_id" = 99999
+ AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.16
+ '''
+ 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 ('new_session',
+ 'middle_session',
+ 'old_session')
+ AND "posthog_sessionrecordingviewed"."team_id" = 99999
+ AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.2
+ '''
+ 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_get_session_recordings_returns_newest_first.3
+ '''
+ 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")
@@ -477,7 +446,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.5
+# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.4
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -530,7 +499,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.6
+# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.5
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -539,7 +508,7 @@
LIMIT 1
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.7
+# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.6
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -594,7 +563,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.8
+# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.7
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -659,7 +628,7 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.9
+# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.8
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -672,6 +641,44 @@
LIMIT 21
'''
# ---
+# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.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_get_session_recordings_scenarios_0_basic_listing
'''
SELECT "posthog_user"."id",
@@ -712,15 +719,8 @@
"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_get_session_recordings_scenarios_0_basic_listing.1
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -759,171 +759,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.10
- '''
- 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_get_session_recordings_scenarios_0_basic_listing.11
- '''
- 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_get_session_recordings_scenarios_0_basic_listing.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_get_session_recordings_scenarios_0_basic_listing.13
- '''
- SELECT "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"
- FROM "posthog_datawarehousetable"
- LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")
- WHERE ("posthog_datawarehousetable"."team_id" = 99999
- AND NOT ("posthog_datawarehousetable"."deleted"
- AND "posthog_datawarehousetable"."deleted" IS NOT NULL)
- AND NOT ("posthog_externaldatasource"."deleted"
- AND "posthog_externaldatasource"."deleted" IS NOT NULL)
- AND NOT ("posthog_externaldatasource"."access_method" = 'direct'
- AND "posthog_externaldatasource"."access_method" IS NOT NULL))
- ORDER BY "posthog_datawarehousetable"."created_at" DESC
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.14
- '''
- SELECT "posthog_sessionrecording"."id",
- "posthog_sessionrecording"."session_id",
- "posthog_sessionrecording"."team_id",
- "posthog_sessionrecording"."created_at",
- "posthog_sessionrecording"."deleted",
- "posthog_sessionrecording"."distinct_id",
- "posthog_sessionrecording"."duration",
- "posthog_sessionrecording"."active_seconds",
- "posthog_sessionrecording"."inactive_seconds",
- "posthog_sessionrecording"."start_time",
- "posthog_sessionrecording"."end_time",
- "posthog_sessionrecording"."click_count",
- "posthog_sessionrecording"."keypress_count",
- "posthog_sessionrecording"."mouse_activity_count",
- "posthog_sessionrecording"."console_log_count",
- "posthog_sessionrecording"."console_warn_count",
- "posthog_sessionrecording"."console_error_count",
- "posthog_sessionrecording"."start_url",
- "posthog_sessionrecording"."retention_period_days"
- FROM "posthog_sessionrecording"
- WHERE ("posthog_sessionrecording"."session_id" IN ('session1',
- 'session2')
- AND "posthog_sessionrecording"."team_id" = 99999)
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.15
- '''
- SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
- FROM "posthog_sessionrecordingviewed"
- WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999
- AND "posthog_sessionrecordingviewed"."user_id" = 99999
- AND "posthog_sessionrecordingviewed"."session_id" IN ('session2',
- 'session1'))
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.16
- '''
- 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 ('session2',
- 'session1')
- AND "posthog_sessionrecordingviewed"."team_id" = 99999
- AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.2
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.1
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1061,89 +903,222 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.3
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.10
'''
- 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
+ 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_get_session_recordings_scenarios_0_basic_listing.4
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.11
'''
- 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))
+ 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_get_session_recordings_scenarios_0_basic_listing.5
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.12
'''
- SELECT "posthog_organizationmembership"."id",
- "posthog_organizationmembership"."organization_id",
- "posthog_organizationmembership"."user_id",
+ SELECT "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"
+ FROM "posthog_datawarehousetable"
+ LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")
+ WHERE ("posthog_datawarehousetable"."team_id" = 99999
+ AND NOT ("posthog_datawarehousetable"."deleted"
+ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)
+ AND NOT ("posthog_externaldatasource"."deleted"
+ AND "posthog_externaldatasource"."deleted" IS NOT NULL)
+ AND NOT ("posthog_externaldatasource"."access_method" = 'direct'
+ AND "posthog_externaldatasource"."access_method" IS NOT NULL))
+ ORDER BY "posthog_datawarehousetable"."created_at" DESC
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.13
+ '''
+ SELECT "posthog_sessionrecording"."id",
+ "posthog_sessionrecording"."session_id",
+ "posthog_sessionrecording"."team_id",
+ "posthog_sessionrecording"."created_at",
+ "posthog_sessionrecording"."deleted",
+ "posthog_sessionrecording"."distinct_id",
+ "posthog_sessionrecording"."duration",
+ "posthog_sessionrecording"."active_seconds",
+ "posthog_sessionrecording"."inactive_seconds",
+ "posthog_sessionrecording"."start_time",
+ "posthog_sessionrecording"."end_time",
+ "posthog_sessionrecording"."click_count",
+ "posthog_sessionrecording"."keypress_count",
+ "posthog_sessionrecording"."mouse_activity_count",
+ "posthog_sessionrecording"."console_log_count",
+ "posthog_sessionrecording"."console_warn_count",
+ "posthog_sessionrecording"."console_error_count",
+ "posthog_sessionrecording"."start_url",
+ "posthog_sessionrecording"."retention_period_days"
+ FROM "posthog_sessionrecording"
+ WHERE ("posthog_sessionrecording"."session_id" IN ('session1',
+ 'session2')
+ AND "posthog_sessionrecording"."team_id" = 99999)
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.14
+ '''
+ SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
+ FROM "posthog_sessionrecordingviewed"
+ WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999
+ AND "posthog_sessionrecordingviewed"."user_id" = 99999
+ AND "posthog_sessionrecordingviewed"."session_id" IN ('session2',
+ 'session1'))
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.15
+ '''
+ 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 ('session2',
+ 'session1')
+ AND "posthog_sessionrecordingviewed"."team_id" = 99999
+ AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.16
+ '''
+ 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 ('session2',
+ 'session1')
+ AND "posthog_sessionrecordingviewed"."team_id" = 99999
+ AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.2
+ '''
+ 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_get_session_recordings_scenarios_0_basic_listing.3
+ '''
+ 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_get_session_recordings_scenarios_0_basic_listing.4
+ '''
+ SELECT "posthog_organizationmembership"."id",
+ "posthog_organizationmembership"."organization_id",
+ "posthog_organizationmembership"."user_id",
"posthog_organizationmembership"."level",
"posthog_organizationmembership"."joined_at",
"posthog_organizationmembership"."updated_at",
@@ -1192,7 +1167,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.6
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.5
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -1201,7 +1176,7 @@
LIMIT 1
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.7
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.6
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1256,7 +1231,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.8
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.7
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -1321,7 +1296,7 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.9
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.8
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -1334,6 +1309,44 @@
LIMIT 21
'''
# ---
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.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_get_session_recordings_scenarios_1_multiple_snapshots
'''
SELECT "posthog_user"."id",
@@ -1374,15 +1387,8 @@
"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_get_session_recordings_scenarios_1_multiple_snapshots.1
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -1421,168 +1427,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.10
- '''
- 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_get_session_recordings_scenarios_1_multiple_snapshots.11
- '''
- 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_get_session_recordings_scenarios_1_multiple_snapshots.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_get_session_recordings_scenarios_1_multiple_snapshots.13
- '''
- SELECT "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"
- FROM "posthog_datawarehousetable"
- LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")
- WHERE ("posthog_datawarehousetable"."team_id" = 99999
- AND NOT ("posthog_datawarehousetable"."deleted"
- AND "posthog_datawarehousetable"."deleted" IS NOT NULL)
- AND NOT ("posthog_externaldatasource"."deleted"
- AND "posthog_externaldatasource"."deleted" IS NOT NULL)
- AND NOT ("posthog_externaldatasource"."access_method" = 'direct'
- AND "posthog_externaldatasource"."access_method" IS NOT NULL))
- ORDER BY "posthog_datawarehousetable"."created_at" DESC
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.14
- '''
- SELECT "posthog_sessionrecording"."id",
- "posthog_sessionrecording"."session_id",
- "posthog_sessionrecording"."team_id",
- "posthog_sessionrecording"."created_at",
- "posthog_sessionrecording"."deleted",
- "posthog_sessionrecording"."distinct_id",
- "posthog_sessionrecording"."duration",
- "posthog_sessionrecording"."active_seconds",
- "posthog_sessionrecording"."inactive_seconds",
- "posthog_sessionrecording"."start_time",
- "posthog_sessionrecording"."end_time",
- "posthog_sessionrecording"."click_count",
- "posthog_sessionrecording"."keypress_count",
- "posthog_sessionrecording"."mouse_activity_count",
- "posthog_sessionrecording"."console_log_count",
- "posthog_sessionrecording"."console_warn_count",
- "posthog_sessionrecording"."console_error_count",
- "posthog_sessionrecording"."start_url",
- "posthog_sessionrecording"."retention_period_days"
- FROM "posthog_sessionrecording"
- WHERE ("posthog_sessionrecording"."session_id" IN ('session_with_duration')
- AND "posthog_sessionrecording"."team_id" = 99999)
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.15
- '''
- SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
- FROM "posthog_sessionrecordingviewed"
- WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999
- AND "posthog_sessionrecordingviewed"."user_id" = 99999
- AND "posthog_sessionrecordingviewed"."session_id" IN ('session_with_duration'))
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.16
- '''
- 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 ('session_with_duration')
- AND "posthog_sessionrecordingviewed"."team_id" = 99999
- AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.2
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.1
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1720,100 +1571,229 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.3
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.10
'''
- 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
+ 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_get_session_recordings_scenarios_1_multiple_snapshots.4
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.11
'''
- 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))
+ 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_get_session_recordings_scenarios_1_multiple_snapshots.5
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.12
'''
- 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",
+ SELECT "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"
+ FROM "posthog_datawarehousetable"
+ LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")
+ WHERE ("posthog_datawarehousetable"."team_id" = 99999
+ AND NOT ("posthog_datawarehousetable"."deleted"
+ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)
+ AND NOT ("posthog_externaldatasource"."deleted"
+ AND "posthog_externaldatasource"."deleted" IS NOT NULL)
+ AND NOT ("posthog_externaldatasource"."access_method" = 'direct'
+ AND "posthog_externaldatasource"."access_method" IS NOT NULL))
+ ORDER BY "posthog_datawarehousetable"."created_at" DESC
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.13
+ '''
+ SELECT "posthog_sessionrecording"."id",
+ "posthog_sessionrecording"."session_id",
+ "posthog_sessionrecording"."team_id",
+ "posthog_sessionrecording"."created_at",
+ "posthog_sessionrecording"."deleted",
+ "posthog_sessionrecording"."distinct_id",
+ "posthog_sessionrecording"."duration",
+ "posthog_sessionrecording"."active_seconds",
+ "posthog_sessionrecording"."inactive_seconds",
+ "posthog_sessionrecording"."start_time",
+ "posthog_sessionrecording"."end_time",
+ "posthog_sessionrecording"."click_count",
+ "posthog_sessionrecording"."keypress_count",
+ "posthog_sessionrecording"."mouse_activity_count",
+ "posthog_sessionrecording"."console_log_count",
+ "posthog_sessionrecording"."console_warn_count",
+ "posthog_sessionrecording"."console_error_count",
+ "posthog_sessionrecording"."start_url",
+ "posthog_sessionrecording"."retention_period_days"
+ FROM "posthog_sessionrecording"
+ WHERE ("posthog_sessionrecording"."session_id" IN ('session_with_duration')
+ AND "posthog_sessionrecording"."team_id" = 99999)
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.14
+ '''
+ SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
+ FROM "posthog_sessionrecordingviewed"
+ WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999
+ AND "posthog_sessionrecordingviewed"."user_id" = 99999
+ AND "posthog_sessionrecordingviewed"."session_id" IN ('session_with_duration'))
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.15
+ '''
+ 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 ('session_with_duration')
+ AND "posthog_sessionrecordingviewed"."team_id" = 99999
+ AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.16
+ '''
+ 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 ('session_with_duration')
+ AND "posthog_sessionrecordingviewed"."team_id" = 99999
+ AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.2
+ '''
+ 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_get_session_recordings_scenarios_1_multiple_snapshots.3
+ '''
+ 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_get_session_recordings_scenarios_1_multiple_snapshots.4
+ '''
+ 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",
@@ -1851,7 +1831,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.6
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.5
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -1860,7 +1840,7 @@
LIMIT 1
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.7
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.6
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1915,7 +1895,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.8
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.7
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -1980,7 +1960,7 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.9
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.8
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -1993,6 +1973,44 @@
LIMIT 21
'''
# ---
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.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_get_session_recordings_scenarios_2_many_distinct_ids
'''
SELECT "posthog_user"."id",
@@ -2033,15 +2051,8 @@
"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_get_session_recordings_scenarios_2_many_distinct_ids.1
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -2080,168 +2091,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.10
- '''
- 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_get_session_recordings_scenarios_2_many_distinct_ids.11
- '''
- 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_get_session_recordings_scenarios_2_many_distinct_ids.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_get_session_recordings_scenarios_2_many_distinct_ids.13
- '''
- SELECT "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"
- FROM "posthog_datawarehousetable"
- LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")
- WHERE ("posthog_datawarehousetable"."team_id" = 99999
- AND NOT ("posthog_datawarehousetable"."deleted"
- AND "posthog_datawarehousetable"."deleted" IS NOT NULL)
- AND NOT ("posthog_externaldatasource"."deleted"
- AND "posthog_externaldatasource"."deleted" IS NOT NULL)
- AND NOT ("posthog_externaldatasource"."access_method" = 'direct'
- AND "posthog_externaldatasource"."access_method" IS NOT NULL))
- ORDER BY "posthog_datawarehousetable"."created_at" DESC
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.14
- '''
- SELECT "posthog_sessionrecording"."id",
- "posthog_sessionrecording"."session_id",
- "posthog_sessionrecording"."team_id",
- "posthog_sessionrecording"."created_at",
- "posthog_sessionrecording"."deleted",
- "posthog_sessionrecording"."distinct_id",
- "posthog_sessionrecording"."duration",
- "posthog_sessionrecording"."active_seconds",
- "posthog_sessionrecording"."inactive_seconds",
- "posthog_sessionrecording"."start_time",
- "posthog_sessionrecording"."end_time",
- "posthog_sessionrecording"."click_count",
- "posthog_sessionrecording"."keypress_count",
- "posthog_sessionrecording"."mouse_activity_count",
- "posthog_sessionrecording"."console_log_count",
- "posthog_sessionrecording"."console_warn_count",
- "posthog_sessionrecording"."console_error_count",
- "posthog_sessionrecording"."start_url",
- "posthog_sessionrecording"."retention_period_days"
- FROM "posthog_sessionrecording"
- WHERE ("posthog_sessionrecording"."session_id" IN ('session_many_ids')
- AND "posthog_sessionrecording"."team_id" = 99999)
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.15
- '''
- SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
- FROM "posthog_sessionrecordingviewed"
- WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999
- AND "posthog_sessionrecordingviewed"."user_id" = 99999
- AND "posthog_sessionrecordingviewed"."session_id" IN ('session_many_ids'))
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.16
- '''
- 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 ('session_many_ids')
- AND "posthog_sessionrecordingviewed"."team_id" = 99999
- AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.2
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.1
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -2379,93 +2235,222 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.3
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.10
'''
- 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
+ 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_get_session_recordings_scenarios_2_many_distinct_ids.4
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.11
'''
- 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))
+ 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_get_session_recordings_scenarios_2_many_distinct_ids.5
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.12
'''
- 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",
+ SELECT "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"
+ FROM "posthog_datawarehousetable"
+ LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")
+ WHERE ("posthog_datawarehousetable"."team_id" = 99999
+ AND NOT ("posthog_datawarehousetable"."deleted"
+ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)
+ AND NOT ("posthog_externaldatasource"."deleted"
+ AND "posthog_externaldatasource"."deleted" IS NOT NULL)
+ AND NOT ("posthog_externaldatasource"."access_method" = 'direct'
+ AND "posthog_externaldatasource"."access_method" IS NOT NULL))
+ ORDER BY "posthog_datawarehousetable"."created_at" DESC
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.13
+ '''
+ SELECT "posthog_sessionrecording"."id",
+ "posthog_sessionrecording"."session_id",
+ "posthog_sessionrecording"."team_id",
+ "posthog_sessionrecording"."created_at",
+ "posthog_sessionrecording"."deleted",
+ "posthog_sessionrecording"."distinct_id",
+ "posthog_sessionrecording"."duration",
+ "posthog_sessionrecording"."active_seconds",
+ "posthog_sessionrecording"."inactive_seconds",
+ "posthog_sessionrecording"."start_time",
+ "posthog_sessionrecording"."end_time",
+ "posthog_sessionrecording"."click_count",
+ "posthog_sessionrecording"."keypress_count",
+ "posthog_sessionrecording"."mouse_activity_count",
+ "posthog_sessionrecording"."console_log_count",
+ "posthog_sessionrecording"."console_warn_count",
+ "posthog_sessionrecording"."console_error_count",
+ "posthog_sessionrecording"."start_url",
+ "posthog_sessionrecording"."retention_period_days"
+ FROM "posthog_sessionrecording"
+ WHERE ("posthog_sessionrecording"."session_id" IN ('session_many_ids')
+ AND "posthog_sessionrecording"."team_id" = 99999)
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.14
+ '''
+ SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
+ FROM "posthog_sessionrecordingviewed"
+ WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999
+ AND "posthog_sessionrecordingviewed"."user_id" = 99999
+ AND "posthog_sessionrecordingviewed"."session_id" IN ('session_many_ids'))
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.15
+ '''
+ 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 ('session_many_ids')
+ AND "posthog_sessionrecordingviewed"."team_id" = 99999
+ AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.16
+ '''
+ 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 ('session_many_ids')
+ AND "posthog_sessionrecordingviewed"."team_id" = 99999
+ AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.2
+ '''
+ 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_get_session_recordings_scenarios_2_many_distinct_ids.3
+ '''
+ 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_get_session_recordings_scenarios_2_many_distinct_ids.4
+ '''
+ 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",
@@ -2510,7 +2495,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.6
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.5
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -2519,7 +2504,7 @@
LIMIT 1
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.7
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.6
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -2574,7 +2559,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.8
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.7
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -2639,7 +2624,7 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.9
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.8
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -2652,6 +2637,44 @@
LIMIT 21
'''
# ---
+# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.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_get_session_recordings_sorted_0_descending_original_
'''
SELECT "posthog_user"."id",
@@ -2692,15 +2715,8 @@
"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_get_session_recordings_sorted_0_descending_original_.1
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -2739,171 +2755,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.10
- '''
- 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_get_session_recordings_sorted_0_descending_original_.11
- '''
- 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_get_session_recordings_sorted_0_descending_original_.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_get_session_recordings_sorted_0_descending_original_.13
- '''
- SELECT "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"
- FROM "posthog_datawarehousetable"
- LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")
- WHERE ("posthog_datawarehousetable"."team_id" = 99999
- AND NOT ("posthog_datawarehousetable"."deleted"
- AND "posthog_datawarehousetable"."deleted" IS NOT NULL)
- AND NOT ("posthog_externaldatasource"."deleted"
- AND "posthog_externaldatasource"."deleted" IS NOT NULL)
- AND NOT ("posthog_externaldatasource"."access_method" = 'direct'
- AND "posthog_externaldatasource"."access_method" IS NOT NULL))
- ORDER BY "posthog_datawarehousetable"."created_at" DESC
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.14
- '''
- SELECT "posthog_sessionrecording"."id",
- "posthog_sessionrecording"."session_id",
- "posthog_sessionrecording"."team_id",
- "posthog_sessionrecording"."created_at",
- "posthog_sessionrecording"."deleted",
- "posthog_sessionrecording"."distinct_id",
- "posthog_sessionrecording"."duration",
- "posthog_sessionrecording"."active_seconds",
- "posthog_sessionrecording"."inactive_seconds",
- "posthog_sessionrecording"."start_time",
- "posthog_sessionrecording"."end_time",
- "posthog_sessionrecording"."click_count",
- "posthog_sessionrecording"."keypress_count",
- "posthog_sessionrecording"."mouse_activity_count",
- "posthog_sessionrecording"."console_log_count",
- "posthog_sessionrecording"."console_warn_count",
- "posthog_sessionrecording"."console_error_count",
- "posthog_sessionrecording"."start_url",
- "posthog_sessionrecording"."retention_period_days"
- FROM "posthog_sessionrecording"
- WHERE ("posthog_sessionrecording"."session_id" IN ('at_base_time',
- 'at_base_time_plus_20')
- AND "posthog_sessionrecording"."team_id" = 99999)
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.15
- '''
- SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
- FROM "posthog_sessionrecordingviewed"
- WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999
- AND "posthog_sessionrecordingviewed"."user_id" = 99999
- AND "posthog_sessionrecordingviewed"."session_id" IN ('at_base_time_plus_20',
- 'at_base_time'))
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.16
- '''
- 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 ('at_base_time_plus_20',
- 'at_base_time')
- AND "posthog_sessionrecordingviewed"."team_id" = 99999
- AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.2
+# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.1
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -3041,97 +2899,230 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.3
+# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.10
'''
- 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
+ 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_get_session_recordings_sorted_0_descending_original_.4
+# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.11
'''
- 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))
+ 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_get_session_recordings_sorted_0_descending_original_.5
+# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.12
'''
- 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",
+ SELECT "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"
+ FROM "posthog_datawarehousetable"
+ LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")
+ WHERE ("posthog_datawarehousetable"."team_id" = 99999
+ AND NOT ("posthog_datawarehousetable"."deleted"
+ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)
+ AND NOT ("posthog_externaldatasource"."deleted"
+ AND "posthog_externaldatasource"."deleted" IS NOT NULL)
+ AND NOT ("posthog_externaldatasource"."access_method" = 'direct'
+ AND "posthog_externaldatasource"."access_method" IS NOT NULL))
+ ORDER BY "posthog_datawarehousetable"."created_at" DESC
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.13
+ '''
+ SELECT "posthog_sessionrecording"."id",
+ "posthog_sessionrecording"."session_id",
+ "posthog_sessionrecording"."team_id",
+ "posthog_sessionrecording"."created_at",
+ "posthog_sessionrecording"."deleted",
+ "posthog_sessionrecording"."distinct_id",
+ "posthog_sessionrecording"."duration",
+ "posthog_sessionrecording"."active_seconds",
+ "posthog_sessionrecording"."inactive_seconds",
+ "posthog_sessionrecording"."start_time",
+ "posthog_sessionrecording"."end_time",
+ "posthog_sessionrecording"."click_count",
+ "posthog_sessionrecording"."keypress_count",
+ "posthog_sessionrecording"."mouse_activity_count",
+ "posthog_sessionrecording"."console_log_count",
+ "posthog_sessionrecording"."console_warn_count",
+ "posthog_sessionrecording"."console_error_count",
+ "posthog_sessionrecording"."start_url",
+ "posthog_sessionrecording"."retention_period_days"
+ FROM "posthog_sessionrecording"
+ WHERE ("posthog_sessionrecording"."session_id" IN ('at_base_time',
+ 'at_base_time_plus_20')
+ AND "posthog_sessionrecording"."team_id" = 99999)
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.14
+ '''
+ SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
+ FROM "posthog_sessionrecordingviewed"
+ WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999
+ AND "posthog_sessionrecordingviewed"."user_id" = 99999
+ AND "posthog_sessionrecordingviewed"."session_id" IN ('at_base_time_plus_20',
+ 'at_base_time'))
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.15
+ '''
+ 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 ('at_base_time_plus_20',
+ 'at_base_time')
+ AND "posthog_sessionrecordingviewed"."team_id" = 99999
+ AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.16
+ '''
+ 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 ('at_base_time_plus_20',
+ 'at_base_time')
+ AND "posthog_sessionrecordingviewed"."team_id" = 99999
+ AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.2
+ '''
+ 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_get_session_recordings_sorted_0_descending_original_.3
+ '''
+ 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_get_session_recordings_sorted_0_descending_original_.4
+ '''
+ 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",
@@ -3172,7 +3163,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.6
+# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.5
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -3181,7 +3172,7 @@
LIMIT 1
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.7
+# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.6
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -3236,7 +3227,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.8
+# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.7
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -3301,7 +3292,7 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.9
+# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.8
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -3314,6 +3305,44 @@
LIMIT 21
'''
# ---
+# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.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_get_session_recordings_sorted_1_descending
'''
SELECT "posthog_user"."id",
@@ -3354,15 +3383,8 @@
"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_get_session_recordings_sorted_1_descending.1
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -3401,171 +3423,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.10
- '''
- 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_get_session_recordings_sorted_1_descending.11
- '''
- 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_get_session_recordings_sorted_1_descending.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_get_session_recordings_sorted_1_descending.13
- '''
- SELECT "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"
- FROM "posthog_datawarehousetable"
- LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")
- WHERE ("posthog_datawarehousetable"."team_id" = 99999
- AND NOT ("posthog_datawarehousetable"."deleted"
- AND "posthog_datawarehousetable"."deleted" IS NOT NULL)
- AND NOT ("posthog_externaldatasource"."deleted"
- AND "posthog_externaldatasource"."deleted" IS NOT NULL)
- AND NOT ("posthog_externaldatasource"."access_method" = 'direct'
- AND "posthog_externaldatasource"."access_method" IS NOT NULL))
- ORDER BY "posthog_datawarehousetable"."created_at" DESC
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.14
- '''
- SELECT "posthog_sessionrecording"."id",
- "posthog_sessionrecording"."session_id",
- "posthog_sessionrecording"."team_id",
- "posthog_sessionrecording"."created_at",
- "posthog_sessionrecording"."deleted",
- "posthog_sessionrecording"."distinct_id",
- "posthog_sessionrecording"."duration",
- "posthog_sessionrecording"."active_seconds",
- "posthog_sessionrecording"."inactive_seconds",
- "posthog_sessionrecording"."start_time",
- "posthog_sessionrecording"."end_time",
- "posthog_sessionrecording"."click_count",
- "posthog_sessionrecording"."keypress_count",
- "posthog_sessionrecording"."mouse_activity_count",
- "posthog_sessionrecording"."console_log_count",
- "posthog_sessionrecording"."console_warn_count",
- "posthog_sessionrecording"."console_error_count",
- "posthog_sessionrecording"."start_url",
- "posthog_sessionrecording"."retention_period_days"
- FROM "posthog_sessionrecording"
- WHERE ("posthog_sessionrecording"."session_id" IN ('at_base_time',
- 'at_base_time_plus_20')
- AND "posthog_sessionrecording"."team_id" = 99999)
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.15
- '''
- SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
- FROM "posthog_sessionrecordingviewed"
- WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999
- AND "posthog_sessionrecordingviewed"."user_id" = 99999
- AND "posthog_sessionrecordingviewed"."session_id" IN ('at_base_time_plus_20',
- 'at_base_time'))
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.16
- '''
- 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 ('at_base_time_plus_20',
- 'at_base_time')
- AND "posthog_sessionrecordingviewed"."team_id" = 99999
- AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.2
+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.1
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -3703,89 +3567,222 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.3
+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.10
'''
- 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
+ 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_get_session_recordings_sorted_1_descending.4
+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.11
'''
- 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))
+ 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_get_session_recordings_sorted_1_descending.5
+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.12
'''
- SELECT "posthog_organizationmembership"."id",
- "posthog_organizationmembership"."organization_id",
- "posthog_organizationmembership"."user_id",
+ SELECT "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"
+ FROM "posthog_datawarehousetable"
+ LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")
+ WHERE ("posthog_datawarehousetable"."team_id" = 99999
+ AND NOT ("posthog_datawarehousetable"."deleted"
+ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)
+ AND NOT ("posthog_externaldatasource"."deleted"
+ AND "posthog_externaldatasource"."deleted" IS NOT NULL)
+ AND NOT ("posthog_externaldatasource"."access_method" = 'direct'
+ AND "posthog_externaldatasource"."access_method" IS NOT NULL))
+ ORDER BY "posthog_datawarehousetable"."created_at" DESC
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.13
+ '''
+ SELECT "posthog_sessionrecording"."id",
+ "posthog_sessionrecording"."session_id",
+ "posthog_sessionrecording"."team_id",
+ "posthog_sessionrecording"."created_at",
+ "posthog_sessionrecording"."deleted",
+ "posthog_sessionrecording"."distinct_id",
+ "posthog_sessionrecording"."duration",
+ "posthog_sessionrecording"."active_seconds",
+ "posthog_sessionrecording"."inactive_seconds",
+ "posthog_sessionrecording"."start_time",
+ "posthog_sessionrecording"."end_time",
+ "posthog_sessionrecording"."click_count",
+ "posthog_sessionrecording"."keypress_count",
+ "posthog_sessionrecording"."mouse_activity_count",
+ "posthog_sessionrecording"."console_log_count",
+ "posthog_sessionrecording"."console_warn_count",
+ "posthog_sessionrecording"."console_error_count",
+ "posthog_sessionrecording"."start_url",
+ "posthog_sessionrecording"."retention_period_days"
+ FROM "posthog_sessionrecording"
+ WHERE ("posthog_sessionrecording"."session_id" IN ('at_base_time',
+ 'at_base_time_plus_20')
+ AND "posthog_sessionrecording"."team_id" = 99999)
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.14
+ '''
+ SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
+ FROM "posthog_sessionrecordingviewed"
+ WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999
+ AND "posthog_sessionrecordingviewed"."user_id" = 99999
+ AND "posthog_sessionrecordingviewed"."session_id" IN ('at_base_time_plus_20',
+ 'at_base_time'))
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.15
+ '''
+ 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 ('at_base_time_plus_20',
+ 'at_base_time')
+ AND "posthog_sessionrecordingviewed"."team_id" = 99999
+ AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.16
+ '''
+ 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 ('at_base_time_plus_20',
+ 'at_base_time')
+ AND "posthog_sessionrecordingviewed"."team_id" = 99999
+ AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.2
+ '''
+ 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_get_session_recordings_sorted_1_descending.3
+ '''
+ 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_get_session_recordings_sorted_1_descending.4
+ '''
+ SELECT "posthog_organizationmembership"."id",
+ "posthog_organizationmembership"."organization_id",
+ "posthog_organizationmembership"."user_id",
"posthog_organizationmembership"."level",
"posthog_organizationmembership"."joined_at",
"posthog_organizationmembership"."updated_at",
@@ -3834,7 +3831,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.6
+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.5
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -3843,7 +3840,7 @@
LIMIT 1
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.7
+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.6
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -3898,7 +3895,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.8
+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.7
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -3963,7 +3960,7 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.9
+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.8
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -3976,6 +3973,44 @@
LIMIT 21
'''
# ---
+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.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_get_session_recordings_sorted_2_ascending
'''
SELECT "posthog_user"."id",
@@ -4016,15 +4051,8 @@
"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_get_session_recordings_sorted_2_ascending.1
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -4063,171 +4091,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.10
- '''
- 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_get_session_recordings_sorted_2_ascending.11
- '''
- 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_get_session_recordings_sorted_2_ascending.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_get_session_recordings_sorted_2_ascending.13
- '''
- SELECT "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"
- FROM "posthog_datawarehousetable"
- LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")
- WHERE ("posthog_datawarehousetable"."team_id" = 99999
- AND NOT ("posthog_datawarehousetable"."deleted"
- AND "posthog_datawarehousetable"."deleted" IS NOT NULL)
- AND NOT ("posthog_externaldatasource"."deleted"
- AND "posthog_externaldatasource"."deleted" IS NOT NULL)
- AND NOT ("posthog_externaldatasource"."access_method" = 'direct'
- AND "posthog_externaldatasource"."access_method" IS NOT NULL))
- ORDER BY "posthog_datawarehousetable"."created_at" DESC
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.14
- '''
- SELECT "posthog_sessionrecording"."id",
- "posthog_sessionrecording"."session_id",
- "posthog_sessionrecording"."team_id",
- "posthog_sessionrecording"."created_at",
- "posthog_sessionrecording"."deleted",
- "posthog_sessionrecording"."distinct_id",
- "posthog_sessionrecording"."duration",
- "posthog_sessionrecording"."active_seconds",
- "posthog_sessionrecording"."inactive_seconds",
- "posthog_sessionrecording"."start_time",
- "posthog_sessionrecording"."end_time",
- "posthog_sessionrecording"."click_count",
- "posthog_sessionrecording"."keypress_count",
- "posthog_sessionrecording"."mouse_activity_count",
- "posthog_sessionrecording"."console_log_count",
- "posthog_sessionrecording"."console_warn_count",
- "posthog_sessionrecording"."console_error_count",
- "posthog_sessionrecording"."start_url",
- "posthog_sessionrecording"."retention_period_days"
- FROM "posthog_sessionrecording"
- WHERE ("posthog_sessionrecording"."session_id" IN ('at_base_time',
- 'at_base_time_plus_20')
- AND "posthog_sessionrecording"."team_id" = 99999)
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.15
- '''
- SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
- FROM "posthog_sessionrecordingviewed"
- WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999
- AND "posthog_sessionrecordingviewed"."user_id" = 99999
- AND "posthog_sessionrecordingviewed"."session_id" IN ('at_base_time',
- 'at_base_time_plus_20'))
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.16
- '''
- 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 ('at_base_time',
- 'at_base_time_plus_20')
- AND "posthog_sessionrecordingviewed"."team_id" = 99999
- AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
- '''
-# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.2
+# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.1
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -4365,97 +4235,230 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.3
+# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.10
'''
- 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
+ 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_get_session_recordings_sorted_2_ascending.4
+# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.11
'''
- 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))
+ 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_get_session_recordings_sorted_2_ascending.5
+# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.12
'''
- 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",
+ SELECT "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"
+ FROM "posthog_datawarehousetable"
+ LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")
+ WHERE ("posthog_datawarehousetable"."team_id" = 99999
+ AND NOT ("posthog_datawarehousetable"."deleted"
+ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)
+ AND NOT ("posthog_externaldatasource"."deleted"
+ AND "posthog_externaldatasource"."deleted" IS NOT NULL)
+ AND NOT ("posthog_externaldatasource"."access_method" = 'direct'
+ AND "posthog_externaldatasource"."access_method" IS NOT NULL))
+ ORDER BY "posthog_datawarehousetable"."created_at" DESC
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.13
+ '''
+ SELECT "posthog_sessionrecording"."id",
+ "posthog_sessionrecording"."session_id",
+ "posthog_sessionrecording"."team_id",
+ "posthog_sessionrecording"."created_at",
+ "posthog_sessionrecording"."deleted",
+ "posthog_sessionrecording"."distinct_id",
+ "posthog_sessionrecording"."duration",
+ "posthog_sessionrecording"."active_seconds",
+ "posthog_sessionrecording"."inactive_seconds",
+ "posthog_sessionrecording"."start_time",
+ "posthog_sessionrecording"."end_time",
+ "posthog_sessionrecording"."click_count",
+ "posthog_sessionrecording"."keypress_count",
+ "posthog_sessionrecording"."mouse_activity_count",
+ "posthog_sessionrecording"."console_log_count",
+ "posthog_sessionrecording"."console_warn_count",
+ "posthog_sessionrecording"."console_error_count",
+ "posthog_sessionrecording"."start_url",
+ "posthog_sessionrecording"."retention_period_days"
+ FROM "posthog_sessionrecording"
+ WHERE ("posthog_sessionrecording"."session_id" IN ('at_base_time',
+ 'at_base_time_plus_20')
+ AND "posthog_sessionrecording"."team_id" = 99999)
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.14
+ '''
+ SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
+ FROM "posthog_sessionrecordingviewed"
+ WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999
+ AND "posthog_sessionrecordingviewed"."user_id" = 99999
+ AND "posthog_sessionrecordingviewed"."session_id" IN ('at_base_time',
+ 'at_base_time_plus_20'))
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.15
+ '''
+ 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 ('at_base_time',
+ 'at_base_time_plus_20')
+ AND "posthog_sessionrecordingviewed"."team_id" = 99999
+ AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.16
+ '''
+ 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 ('at_base_time',
+ 'at_base_time_plus_20')
+ AND "posthog_sessionrecordingviewed"."team_id" = 99999
+ AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
+ '''
+# ---
+# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.2
+ '''
+ 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_get_session_recordings_sorted_2_ascending.3
+ '''
+ 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_get_session_recordings_sorted_2_ascending.4
+ '''
+ 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",
@@ -4496,7 +4499,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.6
+# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.5
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -4505,7 +4508,7 @@
LIMIT 1
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.7
+# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.6
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -4560,7 +4563,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.8
+# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.7
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -4625,7 +4628,7 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.9
+# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.8
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -4638,6 +4641,44 @@
LIMIT 21
'''
# ---
+# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.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
'''
SELECT "posthog_user"."id",
@@ -4678,15 +4719,8 @@
"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.1
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -4725,96 +4759,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.10
- '''
- 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
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.1
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -4952,267 +4903,92 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.102
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.10
'''
- 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
+ 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.103
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.100
'''
- 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))
+ 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"."query_updated_at",
+ "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.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"."query_updated_at",
- "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.108
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.101
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -5225,7 +5001,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.109
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.102
'''
SELECT "posthog_externaldatasource"."created_by_id",
"posthog_externaldatasource"."created_at",
@@ -5263,27 +5039,7 @@
AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.11
- '''
- 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.110
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.103
'''
SELECT "posthog_datawarehousejoin"."created_by_id",
"posthog_datawarehousejoin"."created_at",
@@ -5303,7 +5059,7 @@
AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.111
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.104
'''
SELECT "data_tools_datawarehouseexpression"."deleted",
"data_tools_datawarehouseexpression"."deleted_at",
@@ -5322,7 +5078,7 @@
AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.112
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.105
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -5355,7 +5111,7 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.113
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.106
'''
SELECT "posthog_sessionrecording"."id",
"posthog_sessionrecording"."session_id",
@@ -5386,7 +5142,7 @@
AND "posthog_sessionrecording"."team_id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.114
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.107
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
FROM "posthog_sessionrecordingviewed"
@@ -5400,7 +5156,7 @@
'1'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.115
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.108
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id",
"posthog_user"."email" AS "user__email"
@@ -5416,7 +5172,7 @@
AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.116
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.109
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -5456,15 +5212,8 @@
"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.117
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -5503,12 +5252,32 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.118
+# 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
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -5646,7 +5415,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.119
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.111
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -5701,26 +5470,7 @@
LIMIT 21
'''
# ---
-# 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
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.112
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -5743,7 +5493,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.121
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.113
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -5796,7 +5546,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.122
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.114
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -5805,7 +5555,7 @@
LIMIT 1
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.123
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.115
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -5860,7 +5610,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.124
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.116
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -5925,7 +5675,7 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.125
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.117
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -5938,7 +5688,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.126
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.118
'''
SELECT "posthog_externaldatasource"."created_by_id",
"posthog_externaldatasource"."created_at",
@@ -5976,7 +5726,7 @@
AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.127
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.119
'''
SELECT "posthog_datawarehousejoin"."created_by_id",
"posthog_datawarehousejoin"."created_at",
@@ -5996,26 +5746,7 @@
AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
'''
# ---
-# 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
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.12
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -6048,7 +5779,26 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.13
+# 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
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -6081,7 +5831,7 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.130
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.122
'''
SELECT "posthog_sessionrecording"."id",
"posthog_sessionrecording"."session_id",
@@ -6113,7 +5863,7 @@
AND "posthog_sessionrecording"."team_id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.131
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.123
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
FROM "posthog_sessionrecordingviewed"
@@ -6128,7 +5878,7 @@
'1'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.132
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.124
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id",
"posthog_user"."email" AS "user__email"
@@ -6145,7 +5895,7 @@
AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.133
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.125
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -6185,15 +5935,8 @@
"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.134
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -6232,12 +5975,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.135
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.126
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -6375,7 +6119,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.136
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.127
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -6430,7 +6174,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.137
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.128
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -6453,7 +6197,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.138
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.129
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -6506,16 +6250,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# 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"
- 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.14
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.13
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -6555,13 +6290,62 @@
"posthog_user"."onboarding_delegated_to_organization_id",
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
- "posthog_user"."email_opt_in"
+ "posthog_user"."email_opt_in",
+ "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_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
WHERE ("posthog_user"."is_active"
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.140
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.130
+ '''
+ 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.131
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -6616,7 +6400,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.141
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.132
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -6681,7 +6465,7 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.142
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.133
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -6694,7 +6478,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.143
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.134
'''
SELECT "posthog_externaldatasource"."created_by_id",
"posthog_externaldatasource"."created_at",
@@ -6732,7 +6516,7 @@
AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.144
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.135
'''
SELECT "posthog_datawarehousejoin"."created_by_id",
"posthog_datawarehousejoin"."created_at",
@@ -6752,7 +6536,7 @@
AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.145
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.136
'''
SELECT "data_tools_datawarehouseexpression"."deleted",
"data_tools_datawarehouseexpression"."deleted_at",
@@ -6771,7 +6555,7 @@
AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.146
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.137
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -6804,7 +6588,7 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.147
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.138
'''
SELECT "posthog_sessionrecording"."id",
"posthog_sessionrecording"."session_id",
@@ -6837,7 +6621,7 @@
AND "posthog_sessionrecording"."team_id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.148
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.139
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
FROM "posthog_sessionrecordingviewed"
@@ -6853,27 +6637,100 @@
'1'))
'''
# ---
-# 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
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.14
'''
- SELECT "posthog_organization"."id",
+ 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"."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",
@@ -6912,12 +6769,31 @@
"posthog_organization"."personalization",
"posthog_organization"."domain_whitelist",
"posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ 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.150
+# 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
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -6957,15 +6833,8 @@
"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.151
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -7004,12 +6873,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.152
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.142
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -7147,7 +7017,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.153
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.143
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -7202,7 +7072,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.154
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.144
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -7225,7 +7095,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.155
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.145
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -7278,7 +7148,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.156
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.146
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -7287,7 +7157,7 @@
LIMIT 1
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.157
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.147
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -7342,7 +7212,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.158
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.148
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -7407,7 +7277,7 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.159
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.149
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -7420,99 +7290,15 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.16
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.15
'''
- 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"."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",
+ 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",
@@ -7552,13 +7338,14 @@
"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
+ 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.160
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.150
'''
SELECT "posthog_externaldatasource"."created_by_id",
"posthog_externaldatasource"."created_at",
@@ -7596,7 +7383,7 @@
AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.161
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.151
'''
SELECT "posthog_datawarehousejoin"."created_by_id",
"posthog_datawarehousejoin"."created_at",
@@ -7616,7 +7403,7 @@
AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.162
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.152
'''
SELECT "data_tools_datawarehouseexpression"."deleted",
"data_tools_datawarehouseexpression"."deleted_at",
@@ -7635,7 +7422,7 @@
AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.163
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.153
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -7668,7 +7455,7 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.164
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.154
'''
SELECT "posthog_sessionrecording"."id",
"posthog_sessionrecording"."session_id",
@@ -7702,7 +7489,7 @@
AND "posthog_sessionrecording"."team_id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.165
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.155
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
FROM "posthog_sessionrecordingviewed"
@@ -7719,7 +7506,7 @@
'1'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.166
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.156
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id",
"posthog_user"."email" AS "user__email"
@@ -7738,7 +7525,7 @@
AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.167
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.157
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -7778,15 +7565,8 @@
"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.168
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -7825,12 +7605,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.169
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.158
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -7968,7 +7749,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.17
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.159
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -8023,7 +7804,53 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.170
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.16
+ '''
+ 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.160
+ '''
+ 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.161
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -8073,88 +7900,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: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.171
- '''
- 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.172
- '''
- 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.173
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.162
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -8163,7 +7912,7 @@
LIMIT 1
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.174
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.163
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -8218,7 +7967,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.175
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.164
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -8283,7 +8032,7 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.176
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.165
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -8296,7 +8045,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.177
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.166
'''
SELECT "posthog_externaldatasource"."created_by_id",
"posthog_externaldatasource"."created_at",
@@ -8334,7 +8083,7 @@
AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.178
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.167
'''
SELECT "posthog_datawarehousejoin"."created_by_id",
"posthog_datawarehousejoin"."created_at",
@@ -8354,7 +8103,7 @@
AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.179
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.168
'''
SELECT "data_tools_datawarehouseexpression"."deleted",
"data_tools_datawarehouseexpression"."deleted_at",
@@ -8373,30 +8122,7 @@
AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
'''
# ---
-# 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
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.169
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -8429,7 +8155,60 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.181
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.17
+ '''
+ 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.170
'''
SELECT "posthog_sessionrecording"."id",
"posthog_sessionrecording"."session_id",
@@ -8464,7 +8243,7 @@
AND "posthog_sessionrecording"."team_id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.182
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.171
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
FROM "posthog_sessionrecordingviewed"
@@ -8482,7 +8261,7 @@
'1'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.183
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.172
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id",
"posthog_user"."email" AS "user__email"
@@ -8502,7 +8281,16 @@
AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.19
+# 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"
+ 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.174
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -8552,212 +8340,12 @@
"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: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.2
- '''
- 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"."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.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",
- "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.22
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.175
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -8822,7 +8410,7 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.23
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.176
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -8835,7 +8423,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.24
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.177
'''
SELECT "posthog_externaldatasource"."created_by_id",
"posthog_externaldatasource"."created_at",
@@ -8873,7 +8461,7 @@
AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.25
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.178
'''
SELECT "posthog_datawarehousejoin"."created_by_id",
"posthog_datawarehousejoin"."created_at",
@@ -8893,7 +8481,7 @@
AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.26
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.179
'''
SELECT "data_tools_datawarehouseexpression"."deleted",
"data_tools_datawarehouseexpression"."deleted_at",
@@ -8912,7 +8500,16 @@
AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.27
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.18
+ '''
+ 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.180
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -8945,7 +8542,7 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.28
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.181
'''
SELECT "posthog_sessionrecording"."id",
"posthog_sessionrecording"."session_id",
@@ -8967,20 +8564,58 @@
"posthog_sessionrecording"."start_url",
"posthog_sessionrecording"."retention_period_days"
FROM "posthog_sessionrecording"
- WHERE ("posthog_sessionrecording"."session_id" IN ('1')
+ WHERE ("posthog_sessionrecording"."session_id" IN ('1',
+ '10',
+ '2',
+ '3',
+ '4',
+ '5',
+ '6',
+ '7',
+ '8',
+ '9')
AND "posthog_sessionrecording"."team_id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.29
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.182
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
FROM "posthog_sessionrecordingviewed"
WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999
AND "posthog_sessionrecordingviewed"."user_id" = 99999
- AND "posthog_sessionrecordingviewed"."session_id" IN ('1'))
+ AND "posthog_sessionrecordingviewed"."session_id" IN ('9',
+ '8',
+ '7',
+ '6',
+ '5',
+ '4',
+ '3',
+ '2',
+ '10',
+ '1'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.3
+# 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"
+ FROM "posthog_sessionrecordingviewed"
+ INNER JOIN "posthog_user" ON ("posthog_sessionrecordingviewed"."user_id" = "posthog_user"."id")
+ WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('9',
+ '8',
+ '7',
+ '6',
+ '5',
+ '4',
+ '3',
+ '2',
+ '10',
+ '1')
+ AND "posthog_sessionrecordingviewed"."team_id" = 99999
+ AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.19
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -9035,66 +8670,16 @@
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"
- FROM "posthog_sessionrecordingviewed"
- INNER JOIN "posthog_user" ON ("posthog_sessionrecordingviewed"."user_id" = "posthog_user"."id")
- WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('1')
- AND "posthog_sessionrecordingviewed"."team_id" = 99999
- AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
- '''
-# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.31
- '''
- 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.32
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.2
'''
- SELECT "posthog_organization"."id",
+ 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",
@@ -9133,12 +8718,1066 @@
"posthog_organization"."personalization",
"posthog_organization"."domain_whitelist",
"posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ 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.20
+ '''
+ 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"."query_updated_at",
+ "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.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: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.22
+ '''
+ 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.23
+ '''
+ 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.24
+ '''
+ 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.25
+ '''
+ SELECT "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"
+ FROM "posthog_datawarehousetable"
+ LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")
+ WHERE ("posthog_datawarehousetable"."team_id" = 99999
+ AND NOT ("posthog_datawarehousetable"."deleted"
+ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)
+ AND NOT ("posthog_externaldatasource"."deleted"
+ AND "posthog_externaldatasource"."deleted" IS NOT NULL)
+ AND NOT ("posthog_externaldatasource"."access_method" = 'direct'
+ AND "posthog_externaldatasource"."access_method" IS NOT NULL))
+ ORDER BY "posthog_datawarehousetable"."created_at" DESC
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.26
+ '''
+ SELECT "posthog_sessionrecording"."id",
+ "posthog_sessionrecording"."session_id",
+ "posthog_sessionrecording"."team_id",
+ "posthog_sessionrecording"."created_at",
+ "posthog_sessionrecording"."deleted",
+ "posthog_sessionrecording"."distinct_id",
+ "posthog_sessionrecording"."duration",
+ "posthog_sessionrecording"."active_seconds",
+ "posthog_sessionrecording"."inactive_seconds",
+ "posthog_sessionrecording"."start_time",
+ "posthog_sessionrecording"."end_time",
+ "posthog_sessionrecording"."click_count",
+ "posthog_sessionrecording"."keypress_count",
+ "posthog_sessionrecording"."mouse_activity_count",
+ "posthog_sessionrecording"."console_log_count",
+ "posthog_sessionrecording"."console_warn_count",
+ "posthog_sessionrecording"."console_error_count",
+ "posthog_sessionrecording"."start_url",
+ "posthog_sessionrecording"."retention_period_days"
+ FROM "posthog_sessionrecording"
+ WHERE ("posthog_sessionrecording"."session_id" IN ('1')
+ AND "posthog_sessionrecording"."team_id" = 99999)
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.27
+ '''
+ SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
+ FROM "posthog_sessionrecordingviewed"
+ WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999
+ AND "posthog_sessionrecordingviewed"."user_id" = 99999
+ AND "posthog_sessionrecordingviewed"."session_id" IN ('1'))
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.28
+ '''
+ 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 ('1')
+ AND "posthog_sessionrecordingviewed"."team_id" = 99999
+ AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.29
+ '''
+ 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",
+ "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_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.3
+ '''
+ 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.30
+ '''
+ 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"."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.31
+ '''
+ 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.32
+ '''
+ 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.33
+ '''
+ 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.34
+ '''
+ 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.35
+ '''
+ 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.36
+ '''
+ 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"."query_updated_at",
+ "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.37
+ '''
+ 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.33
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.38
+ '''
+ 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.39
+ '''
+ 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.4
+ '''
+ 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.40
+ '''
+ 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.41
+ '''
+ SELECT "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"
+ FROM "posthog_datawarehousetable"
+ LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")
+ WHERE ("posthog_datawarehousetable"."team_id" = 99999
+ AND NOT ("posthog_datawarehousetable"."deleted"
+ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)
+ AND NOT ("posthog_externaldatasource"."deleted"
+ AND "posthog_externaldatasource"."deleted" IS NOT NULL)
+ AND NOT ("posthog_externaldatasource"."access_method" = 'direct'
+ AND "posthog_externaldatasource"."access_method" IS NOT NULL))
+ ORDER BY "posthog_datawarehousetable"."created_at" DESC
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.42
+ '''
+ SELECT "posthog_sessionrecording"."id",
+ "posthog_sessionrecording"."session_id",
+ "posthog_sessionrecording"."team_id",
+ "posthog_sessionrecording"."created_at",
+ "posthog_sessionrecording"."deleted",
+ "posthog_sessionrecording"."distinct_id",
+ "posthog_sessionrecording"."duration",
+ "posthog_sessionrecording"."active_seconds",
+ "posthog_sessionrecording"."inactive_seconds",
+ "posthog_sessionrecording"."start_time",
+ "posthog_sessionrecording"."end_time",
+ "posthog_sessionrecording"."click_count",
+ "posthog_sessionrecording"."keypress_count",
+ "posthog_sessionrecording"."mouse_activity_count",
+ "posthog_sessionrecording"."console_log_count",
+ "posthog_sessionrecording"."console_warn_count",
+ "posthog_sessionrecording"."console_error_count",
+ "posthog_sessionrecording"."start_url",
+ "posthog_sessionrecording"."retention_period_days"
+ FROM "posthog_sessionrecording"
+ WHERE ("posthog_sessionrecording"."session_id" IN ('1',
+ '2')
+ AND "posthog_sessionrecording"."team_id" = 99999)
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.43
+ '''
+ SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
+ FROM "posthog_sessionrecordingviewed"
+ WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999
+ AND "posthog_sessionrecordingviewed"."user_id" = 99999
+ AND "posthog_sessionrecordingviewed"."session_id" IN ('2',
+ '1'))
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.44
+ '''
+ 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 ('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.45
+ '''
+ 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",
+ "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_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
+ '''
+# ---
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.46
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -9276,7 +9915,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.34
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.47
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -9331,7 +9970,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.35
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.48
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -9354,7 +9993,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.36
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.49
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -9407,7 +10046,16 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.37
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.5
+ '''
+ 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.50
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -9416,7 +10064,7 @@
LIMIT 1
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.38
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.51
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -9471,7 +10119,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.39
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.52
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -9536,30 +10184,7 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# 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.53
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -9572,7 +10197,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.41
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.54
'''
SELECT "posthog_externaldatasource"."created_by_id",
"posthog_externaldatasource"."created_at",
@@ -9610,7 +10235,7 @@
AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.42
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.55
'''
SELECT "posthog_datawarehousejoin"."created_by_id",
"posthog_datawarehousejoin"."created_at",
@@ -9630,7 +10255,7 @@
AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.43
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.56
'''
SELECT "data_tools_datawarehouseexpression"."deleted",
"data_tools_datawarehouseexpression"."deleted_at",
@@ -9649,7 +10274,7 @@
AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.44
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.57
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -9682,7 +10307,7 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.45
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.58
'''
SELECT "posthog_sessionrecording"."id",
"posthog_sessionrecording"."session_id",
@@ -9705,33 +10330,91 @@
"posthog_sessionrecording"."retention_period_days"
FROM "posthog_sessionrecording"
WHERE ("posthog_sessionrecording"."session_id" IN ('1',
- '2')
+ '2',
+ '3')
AND "posthog_sessionrecording"."team_id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.46
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.59
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
FROM "posthog_sessionrecordingviewed"
WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999
AND "posthog_sessionrecordingviewed"."user_id" = 99999
- AND "posthog_sessionrecordingviewed"."session_id" IN ('2',
+ AND "posthog_sessionrecordingviewed"."session_id" IN ('3',
+ '2',
'1'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.47
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.6
+ '''
+ 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.60
'''
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 ('2',
+ WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('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.48
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.61
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -9771,67 +10454,7 @@
"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.49
- '''
- 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.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_user"."email_opt_in",
"posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
@@ -9871,12 +10494,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.50
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.62
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -10014,7 +10638,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.51
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.63
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -10069,7 +10693,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.52
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.64
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -10092,7 +10716,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.53
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.65
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -10145,7 +10769,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.54
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.66
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -10154,7 +10778,7 @@
LIMIT 1
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.55
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.67
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -10209,7 +10833,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.56
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.68
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -10274,7 +10898,7 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.57
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.69
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -10287,7 +10911,72 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.58
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.7
+ '''
+ 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"."query_updated_at",
+ "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.70
'''
SELECT "posthog_externaldatasource"."created_by_id",
"posthog_externaldatasource"."created_at",
@@ -10325,7 +11014,7 @@
AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.59
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.71
'''
SELECT "posthog_datawarehousejoin"."created_by_id",
"posthog_datawarehousejoin"."created_at",
@@ -10345,16 +11034,7 @@
AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
'''
# ---
-# 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.72
'''
SELECT "data_tools_datawarehouseexpression"."deleted",
"data_tools_datawarehouseexpression"."deleted_at",
@@ -10373,7 +11053,7 @@
AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.61
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.73
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -10406,7 +11086,7 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.62
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.74
'''
SELECT "posthog_sessionrecording"."id",
"posthog_sessionrecording"."session_id",
@@ -10430,35 +11110,38 @@
FROM "posthog_sessionrecording"
WHERE ("posthog_sessionrecording"."session_id" IN ('1',
'2',
- '3')
+ '3',
+ '4')
AND "posthog_sessionrecording"."team_id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.63
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.75
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
FROM "posthog_sessionrecordingviewed"
WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999
AND "posthog_sessionrecordingviewed"."user_id" = 99999
- AND "posthog_sessionrecordingviewed"."session_id" IN ('3',
+ AND "posthog_sessionrecordingviewed"."session_id" IN ('4',
+ '3',
'2',
'1'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.64
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.76
'''
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 ('3',
+ WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('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.65
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.77
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -10498,15 +11181,8 @@
"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.66
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -10545,12 +11221,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.67
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.78
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -10688,7 +11365,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.68
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.79
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -10743,7 +11420,20 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.69
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.8
+ '''
+ 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.80
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -10766,62 +11456,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# 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
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.81
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -10874,7 +11509,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.71
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.82
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -10883,7 +11518,7 @@
LIMIT 1
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.72
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.83
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -10938,7 +11573,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.73
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.84
'''
SELECT "posthog_datawarehousesavedquery"."created_by_id",
"posthog_datawarehousesavedquery"."created_at",
@@ -11003,7 +11638,7 @@
ORDER BY "posthog_datawarehousesavedquery"."name" ASC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.74
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.85
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -11016,7 +11651,7 @@
LIMIT 21
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.75
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.86
'''
SELECT "posthog_externaldatasource"."created_by_id",
"posthog_externaldatasource"."created_at",
@@ -11054,7 +11689,7 @@
AND "posthog_externaldatasource"."source_type" IN ('Stripe'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.76
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.87
'''
SELECT "posthog_datawarehousejoin"."created_by_id",
"posthog_datawarehousejoin"."created_at",
@@ -11074,7 +11709,7 @@
AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.77
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.88
'''
SELECT "data_tools_datawarehouseexpression"."deleted",
"data_tools_datawarehouseexpression"."deleted_at",
@@ -11093,7 +11728,7 @@
AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.78
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.89
'''
SELECT "posthog_datawarehousetable"."created_by_id",
"posthog_datawarehousetable"."created_at",
@@ -11126,7 +11761,45 @@
ORDER BY "posthog_datawarehousetable"."created_at" DESC
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.79
+# 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
'''
SELECT "posthog_sessionrecording"."id",
"posthog_sessionrecording"."session_id",
@@ -11151,94 +11824,32 @@
WHERE ("posthog_sessionrecording"."session_id" IN ('1',
'2',
'3',
- '4')
+ '4',
+ '5')
AND "posthog_sessionrecording"."team_id" = 99999)
'''
# ---
-# 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"."query_updated_at",
- "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.91
'''
SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
FROM "posthog_sessionrecordingviewed"
WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999
AND "posthog_sessionrecordingviewed"."user_id" = 99999
- AND "posthog_sessionrecordingviewed"."session_id" IN ('4',
+ AND "posthog_sessionrecordingviewed"."session_id" IN ('5',
+ '4',
'3',
'2',
'1'))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.81
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.92
'''
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 ('4',
+ WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('5',
+ '4',
'3',
'2',
'1')
@@ -11246,7 +11857,7 @@
AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.82
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.93
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -11286,15 +11897,8 @@
"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.83
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -11333,12 +11937,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.84
+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.94
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -11385,246 +11990,52 @@
"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"."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.85
- '''
- 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.86
- '''
- 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.87
- '''
- 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.88
- '''
- 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.89
- '''
- 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_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"."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",
@@ -11664,315 +12075,204 @@
"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.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",
- "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"."query_updated_at",
- "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.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
+ 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.92
- '''
- 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.93
- '''
- 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.94
- '''
- 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.95
'''
- SELECT "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"
- FROM "posthog_datawarehousetable"
- LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")
- WHERE ("posthog_datawarehousetable"."team_id" = 99999
- AND NOT ("posthog_datawarehousetable"."deleted"
- AND "posthog_datawarehousetable"."deleted" IS NOT NULL)
- AND NOT ("posthog_externaldatasource"."deleted"
- AND "posthog_externaldatasource"."deleted" IS NOT NULL)
- AND NOT ("posthog_externaldatasource"."access_method" = 'direct'
- AND "posthog_externaldatasource"."access_method" IS NOT NULL))
- ORDER BY "posthog_datawarehousetable"."created_at" DESC
+ 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.96
'''
- SELECT "posthog_sessionrecording"."id",
- "posthog_sessionrecording"."session_id",
- "posthog_sessionrecording"."team_id",
- "posthog_sessionrecording"."created_at",
- "posthog_sessionrecording"."deleted",
- "posthog_sessionrecording"."distinct_id",
- "posthog_sessionrecording"."duration",
- "posthog_sessionrecording"."active_seconds",
- "posthog_sessionrecording"."inactive_seconds",
- "posthog_sessionrecording"."start_time",
- "posthog_sessionrecording"."end_time",
- "posthog_sessionrecording"."click_count",
- "posthog_sessionrecording"."keypress_count",
- "posthog_sessionrecording"."mouse_activity_count",
- "posthog_sessionrecording"."console_log_count",
- "posthog_sessionrecording"."console_warn_count",
- "posthog_sessionrecording"."console_error_count",
- "posthog_sessionrecording"."start_url",
- "posthog_sessionrecording"."retention_period_days"
- FROM "posthog_sessionrecording"
- WHERE ("posthog_sessionrecording"."session_id" IN ('1',
- '2',
- '3',
- '4',
- '5')
- AND "posthog_sessionrecording"."team_id" = 99999)
+ 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.97
'''
- SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"
- FROM "posthog_sessionrecordingviewed"
- WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999
- AND "posthog_sessionrecordingviewed"."user_id" = 99999
- AND "posthog_sessionrecordingviewed"."session_id" IN ('5',
- '4',
- '3',
- '2',
- '1'))
+ 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.98
'''
- 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 ('5',
- '4',
- '3',
- '2',
- '1')
- AND "posthog_sessionrecordingviewed"."team_id" = 99999
- AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))
+ 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.99
'''
- 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_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
'''
# ---
diff --git a/posthog/session_recordings/test/test_session_recording_playlist.py b/posthog/session_recordings/test/test_session_recording_playlist.py
index 888804012d0d..05363b1867e9 100644
--- a/posthog/session_recordings/test/test_session_recording_playlist.py
+++ b/posthog/session_recordings/test/test_session_recording_playlist.py
@@ -337,11 +337,11 @@ class TestSessionRecordingPlaylist(APIBaseTest, QueryMatchingTest):
)
def test_can_create_many_playlists_without_n_plus_1(self):
- with self.assertNumQueries(12 * 50 + 1):
+ with self.assertNumQueries(11 * 50 + 1):
for i in range(50):
self._create_playlist({"name": f"test-{i}", "type": "collection"})
- with self.assertNumQueries(12 * 100):
+ with self.assertNumQueries(11 * 100):
for i in range(100):
self._create_playlist({"name": f"test-{i}", "type": "collection"})
diff --git a/posthog/settings/web.py b/posthog/settings/web.py
index 8983f72b859b..68f70402989a 100644
--- a/posthog/settings/web.py
+++ b/posthog/settings/web.py
@@ -211,7 +211,7 @@ MIDDLEWARE = [
"posthog.middleware.EnvironmentsRewriteMiddleware",
"posthog.middleware.CsrfOrKeyViewMiddleware",
"posthog.middleware.QueryTimeCountingMiddleware",
- "django.contrib.auth.middleware.AuthenticationMiddleware",
+ "posthog.middleware.AuthenticationMiddleware",
# Must run immediately after AuthenticationMiddleware so downstream middleware
# (activity logging, structlog binding, etc.) sees the swapped staff user on /admin/* paths.
"posthog.middleware.AdminImpersonationMiddleware",
diff --git a/products/actions/backend/api/test/__snapshots__/test_action.ambr b/products/actions/backend/api/test/__snapshots__/test_action.ambr
index 1f658911de2d..9b97bec86e05 100644
--- a/products/actions/backend/api/test/__snapshots__/test_action.ambr
+++ b/products/actions/backend/api/test/__snapshots__/test_action.ambr
@@ -39,15 +39,8 @@
"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: TestActionApi.test_listing_actions_is_not_nplus1.1
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -86,12 +79,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestActionApi.test_listing_actions_is_not_nplus1.10
+# name: TestActionApi.test_listing_actions_is_not_nplus1.1
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -229,23 +223,7 @@
LIMIT 21
'''
# ---
-# name: TestActionApi.test_listing_actions_is_not_nplus1.11
- '''
- SELECT "posthog_project"."updated_at",
- "posthog_project"."id",
- "posthog_project"."organization_id",
- "posthog_project"."name",
- "posthog_project"."logo_media_id",
- "posthog_project"."created_at",
- "posthog_project"."product_description",
- "posthog_project"."is_pending_deletion",
- "posthog_project"."deletion_scheduled_at"
- FROM "posthog_project"
- WHERE "posthog_project"."id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestActionApi.test_listing_actions_is_not_nplus1.12
+# name: TestActionApi.test_listing_actions_is_not_nplus1.10
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -300,7 +278,7 @@
LIMIT 21
'''
# ---
-# name: TestActionApi.test_listing_actions_is_not_nplus1.13
+# name: TestActionApi.test_listing_actions_is_not_nplus1.11
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -323,7 +301,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestActionApi.test_listing_actions_is_not_nplus1.14
+# name: TestActionApi.test_listing_actions_is_not_nplus1.12
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -376,7 +354,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestActionApi.test_listing_actions_is_not_nplus1.15
+# name: TestActionApi.test_listing_actions_is_not_nplus1.13
'''
SELECT "posthog_action"."id",
"posthog_action"."name",
@@ -459,7 +437,7 @@
"posthog_action"."name" ASC
'''
# ---
-# name: TestActionApi.test_listing_actions_is_not_nplus1.16
+# name: TestActionApi.test_listing_actions_is_not_nplus1.14
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -480,7 +458,7 @@
5 /* ... */))
'''
# ---
-# name: TestActionApi.test_listing_actions_is_not_nplus1.17
+# name: TestActionApi.test_listing_actions_is_not_nplus1.15
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -520,151 +498,7 @@
"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: TestActionApi.test_listing_actions_is_not_nplus1.18
- '''
- 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: TestActionApi.test_listing_actions_is_not_nplus1.19
- '''
- 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"."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_user"."email_opt_in",
"posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
@@ -704,13 +538,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestActionApi.test_listing_actions_is_not_nplus1.2
+# name: TestActionApi.test_listing_actions_is_not_nplus1.16
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -848,7 +682,7 @@
LIMIT 21
'''
# ---
-# name: TestActionApi.test_listing_actions_is_not_nplus1.20
+# name: TestActionApi.test_listing_actions_is_not_nplus1.17
'''
SELECT "posthog_project"."updated_at",
"posthog_project"."id",
@@ -864,7 +698,7 @@
LIMIT 21
'''
# ---
-# name: TestActionApi.test_listing_actions_is_not_nplus1.21
+# name: TestActionApi.test_listing_actions_is_not_nplus1.18
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -919,7 +753,7 @@
LIMIT 21
'''
# ---
-# name: TestActionApi.test_listing_actions_is_not_nplus1.22
+# name: TestActionApi.test_listing_actions_is_not_nplus1.19
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -942,7 +776,23 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestActionApi.test_listing_actions_is_not_nplus1.23
+# name: TestActionApi.test_listing_actions_is_not_nplus1.2
+ '''
+ SELECT "posthog_project"."updated_at",
+ "posthog_project"."id",
+ "posthog_project"."organization_id",
+ "posthog_project"."name",
+ "posthog_project"."logo_media_id",
+ "posthog_project"."created_at",
+ "posthog_project"."product_description",
+ "posthog_project"."is_pending_deletion",
+ "posthog_project"."deletion_scheduled_at"
+ FROM "posthog_project"
+ WHERE "posthog_project"."id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestActionApi.test_listing_actions_is_not_nplus1.20
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -995,7 +845,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestActionApi.test_listing_actions_is_not_nplus1.24
+# name: TestActionApi.test_listing_actions_is_not_nplus1.21
'''
SELECT "posthog_action"."id",
"posthog_action"."name",
@@ -1078,7 +928,7 @@
"posthog_action"."name" ASC
'''
# ---
-# name: TestActionApi.test_listing_actions_is_not_nplus1.25
+# name: TestActionApi.test_listing_actions_is_not_nplus1.22
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -1100,22 +950,6 @@
'''
# ---
# name: TestActionApi.test_listing_actions_is_not_nplus1.3
- '''
- SELECT "posthog_project"."updated_at",
- "posthog_project"."id",
- "posthog_project"."organization_id",
- "posthog_project"."name",
- "posthog_project"."logo_media_id",
- "posthog_project"."created_at",
- "posthog_project"."product_description",
- "posthog_project"."is_pending_deletion",
- "posthog_project"."deletion_scheduled_at"
- FROM "posthog_project"
- WHERE "posthog_project"."id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestActionApi.test_listing_actions_is_not_nplus1.4
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1170,7 +1004,7 @@
LIMIT 21
'''
# ---
-# name: TestActionApi.test_listing_actions_is_not_nplus1.5
+# name: TestActionApi.test_listing_actions_is_not_nplus1.4
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -1193,7 +1027,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestActionApi.test_listing_actions_is_not_nplus1.6
+# name: TestActionApi.test_listing_actions_is_not_nplus1.5
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1246,7 +1080,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestActionApi.test_listing_actions_is_not_nplus1.7
+# name: TestActionApi.test_listing_actions_is_not_nplus1.6
'''
SELECT "posthog_action"."id",
"posthog_action"."name",
@@ -1329,7 +1163,7 @@
"posthog_action"."name" ASC
'''
# ---
-# name: TestActionApi.test_listing_actions_is_not_nplus1.8
+# name: TestActionApi.test_listing_actions_is_not_nplus1.7
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -1369,15 +1203,146 @@
"posthog_user"."onboarding_delegated_to_organization_id",
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
- "posthog_user"."email_opt_in"
+ "posthog_user"."email_opt_in",
+ "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_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
WHERE ("posthog_user"."is_active"
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestActionApi.test_listing_actions_is_not_nplus1.9
+# name: TestActionApi.test_listing_actions_is_not_nplus1.8
'''
- SELECT "posthog_organization"."id",
+ 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"."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",
@@ -1416,8 +1381,25 @@
"posthog_organization"."personalization",
"posthog_organization"."domain_whitelist",
"posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ FROM "posthog_team"
+ INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
+ WHERE "posthog_team"."id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestActionApi.test_listing_actions_is_not_nplus1.9
+ '''
+ SELECT "posthog_project"."updated_at",
+ "posthog_project"."id",
+ "posthog_project"."organization_id",
+ "posthog_project"."name",
+ "posthog_project"."logo_media_id",
+ "posthog_project"."created_at",
+ "posthog_project"."product_description",
+ "posthog_project"."is_pending_deletion",
+ "posthog_project"."deletion_scheduled_at"
+ FROM "posthog_project"
+ WHERE "posthog_project"."id" = 99999
LIMIT 21
'''
# ---
diff --git a/products/actions/backend/api/test/test_action.py b/products/actions/backend/api/test/test_action.py
index 552f06cbea6f..a1e70ad5052c 100644
--- a/products/actions/backend/api/test/test_action.py
+++ b/products/actions/backend/api/test/test_action.py
@@ -509,7 +509,7 @@ class TestActionApi(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):
self.client.get(f"/api/projects/{self.team.id}/actions/")
# No actions yet, so no tags prefetch query
- with self.assertNumQueries(9), snapshot_postgres_queries_context(self):
+ with self.assertNumQueries(8), snapshot_postgres_queries_context(self):
self.client.get(f"/api/projects/{self.team.id}/actions/")
Action.objects.create(
@@ -519,7 +519,7 @@ class TestActionApi(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):
)
# With actions, there's an extra tags prefetch query
- with self.assertNumQueries(10), snapshot_postgres_queries_context(self):
+ with self.assertNumQueries(9), snapshot_postgres_queries_context(self):
self.client.get(f"/api/projects/{self.team.id}/actions/")
Action.objects.create(
@@ -528,7 +528,7 @@ class TestActionApi(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):
created_by=User.objects.create_and_join(self.organization, "b", ""),
)
- with self.assertNumQueries(10), snapshot_postgres_queries_context(self):
+ with self.assertNumQueries(9), snapshot_postgres_queries_context(self):
self.client.get(f"/api/projects/{self.team.id}/actions/")
@parameterized.expand(
diff --git a/products/annotations/backend/api/test/__snapshots__/test_annotation.ambr b/products/annotations/backend/api/test/__snapshots__/test_annotation.ambr
index fd6d94c089c1..ed3170b72a65 100644
--- a/products/annotations/backend/api/test/__snapshots__/test_annotation.ambr
+++ b/products/annotations/backend/api/test/__snapshots__/test_annotation.ambr
@@ -39,15 +39,8 @@
"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: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.1
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -86,12 +79,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.10
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.1
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -229,23 +223,7 @@
LIMIT 21
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.11
- '''
- SELECT "posthog_project"."updated_at",
- "posthog_project"."id",
- "posthog_project"."organization_id",
- "posthog_project"."name",
- "posthog_project"."logo_media_id",
- "posthog_project"."created_at",
- "posthog_project"."product_description",
- "posthog_project"."is_pending_deletion",
- "posthog_project"."deletion_scheduled_at"
- FROM "posthog_project"
- WHERE "posthog_project"."id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.12
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.10
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -300,7 +278,7 @@
LIMIT 21
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.13
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.11
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -323,7 +301,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.14
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.12
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -376,7 +354,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.15
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.13
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_annotation"
@@ -394,7 +372,7 @@
OR "posthog_annotation"."team_id" = 99999))
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.16
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.14
'''
SELECT "posthog_annotation"."id",
"posthog_annotation"."content",
@@ -521,7 +499,7 @@
LIMIT 1000
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.17
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.15
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -561,151 +539,7 @@
"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: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.18
- '''
- 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: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.19
- '''
- 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"."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_user"."email_opt_in",
"posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
@@ -745,13 +579,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.2
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.16
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -889,7 +723,7 @@
LIMIT 21
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.20
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.17
'''
SELECT "posthog_project"."updated_at",
"posthog_project"."id",
@@ -905,7 +739,7 @@
LIMIT 21
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.21
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.18
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -960,7 +794,7 @@
LIMIT 21
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.22
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.19
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -983,7 +817,23 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.23
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.2
+ '''
+ SELECT "posthog_project"."updated_at",
+ "posthog_project"."id",
+ "posthog_project"."organization_id",
+ "posthog_project"."name",
+ "posthog_project"."logo_media_id",
+ "posthog_project"."created_at",
+ "posthog_project"."product_description",
+ "posthog_project"."is_pending_deletion",
+ "posthog_project"."deletion_scheduled_at"
+ FROM "posthog_project"
+ WHERE "posthog_project"."id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.20
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1036,7 +886,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.24
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.21
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_annotation"
@@ -1054,7 +904,7 @@
OR "posthog_annotation"."team_id" = 99999))
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.25
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.22
'''
SELECT "posthog_annotation"."id",
"posthog_annotation"."content",
@@ -1181,7 +1031,7 @@
LIMIT 1000
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.26
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.23
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -1221,15 +1071,8 @@
"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: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.27
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -1268,12 +1111,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.28
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.24
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1411,7 +1255,7 @@
LIMIT 21
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.29
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.25
'''
SELECT "posthog_project"."updated_at",
"posthog_project"."id",
@@ -1427,23 +1271,7 @@
LIMIT 21
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.3
- '''
- SELECT "posthog_project"."updated_at",
- "posthog_project"."id",
- "posthog_project"."organization_id",
- "posthog_project"."name",
- "posthog_project"."logo_media_id",
- "posthog_project"."created_at",
- "posthog_project"."product_description",
- "posthog_project"."is_pending_deletion",
- "posthog_project"."deletion_scheduled_at"
- FROM "posthog_project"
- WHERE "posthog_project"."id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.30
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.26
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1498,7 +1326,7 @@
LIMIT 21
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.31
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.27
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -1521,7 +1349,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.32
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.28
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1574,7 +1402,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.33
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.29
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_annotation"
@@ -1592,7 +1420,62 @@
OR "posthog_annotation"."team_id" = 99999))
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.34
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.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: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.30
'''
SELECT "posthog_annotation"."id",
"posthog_annotation"."content",
@@ -1720,61 +1603,6 @@
'''
# ---
# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.4
- '''
- 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: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.5
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -1797,7 +1625,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.6
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.5
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1850,7 +1678,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.7
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.6
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_annotation"
@@ -1868,7 +1696,7 @@
OR "posthog_annotation"."team_id" = 99999))
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.8
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.7
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -1908,15 +1736,146 @@
"posthog_user"."onboarding_delegated_to_organization_id",
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
- "posthog_user"."email_opt_in"
+ "posthog_user"."email_opt_in",
+ "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_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
WHERE ("posthog_user"."is_active"
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.9
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.8
'''
- SELECT "posthog_organization"."id",
+ 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"."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",
@@ -1955,8 +1914,25 @@
"posthog_organization"."personalization",
"posthog_organization"."domain_whitelist",
"posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ FROM "posthog_team"
+ INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
+ WHERE "posthog_team"."id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.9
+ '''
+ SELECT "posthog_project"."updated_at",
+ "posthog_project"."id",
+ "posthog_project"."organization_id",
+ "posthog_project"."name",
+ "posthog_project"."logo_media_id",
+ "posthog_project"."created_at",
+ "posthog_project"."product_description",
+ "posthog_project"."is_pending_deletion",
+ "posthog_project"."deletion_scheduled_at"
+ FROM "posthog_project"
+ WHERE "posthog_project"."id" = 99999
LIMIT 21
'''
# ---
diff --git a/products/cdp/backend/api/test/__snapshots__/test_plugin.ambr b/products/cdp/backend/api/test/__snapshots__/test_plugin.ambr
index 55d585f992af..75a46f15208d 100644
--- a/products/cdp/backend/api/test/__snapshots__/test_plugin.ambr
+++ b/products/cdp/backend/api/test/__snapshots__/test_plugin.ambr
@@ -39,67 +39,7 @@
"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: TestPluginAPI.test_listing_plugins_is_not_nplus1.1
- '''
- 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: TestPluginAPI.test_listing_plugins_is_not_nplus1.10
- '''
- 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_user"."email_opt_in",
"posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
@@ -139,14 +79,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.11
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.1
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -192,7 +131,7 @@
LIMIT 21
'''
# ---
-# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.12
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.10
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -247,7 +186,7 @@
LIMIT 21
'''
# ---
-# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.13
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.11
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_plugin"
@@ -261,7 +200,7 @@
AND "U1"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid)))
'''
# ---
-# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.14
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.12
'''
SELECT "posthog_plugin"."id",
"posthog_plugin"."organization_id",
@@ -341,7 +280,7 @@
LIMIT 100
'''
# ---
-# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.15
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.13
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -381,15 +320,8 @@
"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: TestPluginAPI.test_listing_plugins_is_not_nplus1.16
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -428,12 +360,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.17
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.14
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -479,7 +412,7 @@
LIMIT 21
'''
# ---
-# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.18
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.15
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -534,53 +467,7 @@
LIMIT 21
'''
# ---
-# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.19
- '''
- 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: TestPluginAPI.test_listing_plugins_is_not_nplus1.2
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.16
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -626,7 +513,7 @@
LIMIT 21
'''
# ---
-# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.20
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.17
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -681,7 +568,7 @@
LIMIT 21
'''
# ---
-# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.21
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.18
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_plugin"
@@ -695,7 +582,7 @@
AND "U1"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid)))
'''
# ---
-# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.22
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.19
'''
SELECT "posthog_plugin"."id",
"posthog_plugin"."organization_id",
@@ -775,7 +662,62 @@
LIMIT 100
'''
# ---
-# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.23
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.2
+ '''
+ 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: TestPluginAPI.test_listing_plugins_is_not_nplus1.20
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -815,15 +757,8 @@
"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: TestPluginAPI.test_listing_plugins_is_not_nplus1.24
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -862,12 +797,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.25
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.21
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -913,7 +849,7 @@
LIMIT 21
'''
# ---
-# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.26
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.22
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -968,7 +904,7 @@
LIMIT 21
'''
# ---
-# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.27
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.23
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -1014,7 +950,7 @@
LIMIT 21
'''
# ---
-# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.28
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.24
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1069,7 +1005,7 @@
LIMIT 21
'''
# ---
-# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.29
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.25
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_plugin"
@@ -1083,62 +1019,7 @@
AND "U1"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid)))
'''
# ---
-# name: TestPluginAPI.test_listing_plugins_is_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: TestPluginAPI.test_listing_plugins_is_not_nplus1.30
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.26
'''
SELECT "posthog_plugin"."id",
"posthog_plugin"."organization_id",
@@ -1218,7 +1099,7 @@
LIMIT 100
'''
# ---
-# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.4
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.3
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -1264,7 +1145,7 @@
LIMIT 21
'''
# ---
-# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.5
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.4
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1319,7 +1200,7 @@
LIMIT 21
'''
# ---
-# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.6
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.5
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_plugin"
@@ -1333,7 +1214,7 @@
AND "U1"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid)))
'''
# ---
-# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.7
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.6
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -1373,13 +1254,53 @@
"posthog_user"."onboarding_delegated_to_organization_id",
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
- "posthog_user"."email_opt_in"
+ "posthog_user"."email_opt_in",
+ "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_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
WHERE ("posthog_user"."is_active"
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.8
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.7
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -1425,6 +1346,61 @@
LIMIT 21
'''
# ---
+# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.8
+ '''
+ 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: TestPluginAPI.test_listing_plugins_is_not_nplus1.9
'''
SELECT "posthog_organization"."id",
diff --git a/products/cdp/backend/api/test/test_plugin.py b/products/cdp/backend/api/test/test_plugin.py
index efc292acdf42..ba76584a9ebb 100644
--- a/products/cdp/backend/api/test/test_plugin.py
+++ b/products/cdp/backend/api/test/test_plugin.py
@@ -976,22 +976,22 @@ class TestPluginAPI(APIBaseTest, QueryMatchingTest):
@snapshot_postgres_queries
def test_listing_plugins_is_not_nplus1(self, _mock_get, _mock_reload) -> None:
- with self.assertNumQueries(9):
+ with self.assertNumQueries(8):
self._assert_number_of_when_listed_plugins(0)
Plugin.objects.create(organization=self.organization)
- with self.assertNumQueries(9):
+ with self.assertNumQueries(8):
self._assert_number_of_when_listed_plugins(1)
Plugin.objects.create(organization=self.organization)
- with self.assertNumQueries(9):
+ with self.assertNumQueries(8):
self._assert_number_of_when_listed_plugins(2)
Plugin.objects.create(organization=self.organization)
- with self.assertNumQueries(9):
+ with self.assertNumQueries(8):
self._assert_number_of_when_listed_plugins(3)
def _assert_number_of_when_listed_plugins(self, expected_plugins_count: int) -> None:
diff --git a/products/conversations/backend/api/tests/test_tickets.py b/products/conversations/backend/api/tests/test_tickets.py
index e1ec39b8c269..2b8f66ee07c8 100644
--- a/products/conversations/backend/api/tests/test_tickets.py
+++ b/products/conversations/backend/api/tests/test_tickets.py
@@ -974,7 +974,7 @@ class TestTicketAPI(APIBaseTest):
# Person reads go through personhog, so both page sizes should use the same database queries.
for limit in (2, 3):
- with self.subTest(limit=limit), self.assertNumQueries(10):
+ with self.subTest(limit=limit), self.assertNumQueries(9):
response = self.client.get(f"{list_url}?limit={limit}")
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.json()["count"], 3)
diff --git a/products/customer_analytics/backend/test/test_views.py b/products/customer_analytics/backend/test/test_views.py
index c3ecf775d257..ff6f9c8495ba 100644
--- a/products/customer_analytics/backend/test/test_views.py
+++ b/products/customer_analytics/backend/test/test_views.py
@@ -1115,7 +1115,7 @@ class TestAccountViewSet(APIBaseTest):
account.tagged_items.create(tag=billing_tag)
account.tagged_items.create(tag=urgent_tag)
- with self.assertNumQueries(12):
+ with self.assertNumQueries(11):
# Query budget for a tag-filtered account list. Constant regardless of result count
# because tagged_items and notebooks are prefetched once. If a query is added, please
# confirm it does not scale with the number of accounts before raising the limit:
diff --git a/products/data_warehouse/backend/tests/api/test_data_warehouse.py b/products/data_warehouse/backend/tests/api/test_data_warehouse.py
index 947724576084..569b3c5837c1 100644
--- a/products/data_warehouse/backend/tests/api/test_data_warehouse.py
+++ b/products/data_warehouse/backend/tests/api/test_data_warehouse.py
@@ -526,7 +526,7 @@ class TestDataWarehouseAPI(APIBaseTest):
finished_at=timezone.now(),
)
- with self.assertNumQueries(14):
+ with self.assertNumQueries(13):
response = self.client.get(f"{endpoint}?days=1")
data = response.json()
@@ -562,7 +562,7 @@ class TestDataWarehouseAPI(APIBaseTest):
finished_at=timezone.now() - timedelta(days=10),
)
- with self.assertNumQueries(14):
+ with self.assertNumQueries(13):
response = self.client.get(f"{endpoint}?days=30")
data = response.json()
@@ -668,7 +668,7 @@ class TestDataWarehouseAPI(APIBaseTest):
)
DataModelingJob.objects.filter(pk=modeling_job.pk).update(created_at=today_start + timedelta(hours=4))
- with self.assertNumQueries(14):
+ with self.assertNumQueries(13):
response = self.client.get(f"{endpoint}?days=7")
data = response.json()
diff --git a/products/experiments/backend/test/test_presentation_api.py b/products/experiments/backend/test/test_presentation_api.py
index 974f8b4db197..5975dc483e9f 100644
--- a/products/experiments/backend/test/test_presentation_api.py
+++ b/products/experiments/backend/test/test_presentation_api.py
@@ -547,7 +547,7 @@ class TestExperimentCRUD(_HoistFlagConfigClientMixin, APILicensedTest):
# Query count must stay flat as rows grow — five experiments must not cost more than one.
self.assertLessEqual(len(five_rows.captured_queries), len(single_row.captured_queries))
# The list serializer stamps no calculation keys, so the saved metrics cost no extra query.
- self.assertEqual(len(five_rows.captured_queries), 15)
+ self.assertEqual(len(five_rows.captured_queries), 14)
def test_experiment_detail_with_saved_metrics_reads_each_relation_once(self) -> None:
experiment = self._create_fully_populated_experiment(0)
@@ -564,7 +564,7 @@ class TestExperimentCRUD(_HoistFlagConfigClientMixin, APILicensedTest):
# The saved-metric fingerprints reuse the prefetched links and add one read of the team's
# experiment settings, whatever the number of saved metrics.
- with self.assertNumQueries(17):
+ with self.assertNumQueries(16):
response = self.client.get(f"/api/projects/{self.team.id}/experiments/{experiment.id}/")
self.assertEqual(response.status_code, status.HTTP_200_OK)
@@ -3897,7 +3897,7 @@ class TestExperimentCRUD(_HoistFlagConfigClientMixin, APILicensedTest):
# TODO: Make sure permission bool doesn't cause n + 1
# +1 query for survey internal flag IDs lookup, +1 for the project's replay gates
- with self.assertNumQueries(21):
+ with self.assertNumQueries(20):
response = self.client.get(f"/api/projects/{self.team.id}/feature_flags")
self.assertEqual(response.status_code, status.HTTP_200_OK)
result = response.json()
diff --git a/products/feature_flags/backend/api/test/__snapshots__/test_feature_flag.ambr b/products/feature_flags/backend/api/test/__snapshots__/test_feature_flag.ambr
index 5b61429afc84..009cd9ffeb83 100644
--- a/products/feature_flags/backend/api/test/__snapshots__/test_feature_flag.ambr
+++ b/products/feature_flags/backend/api/test/__snapshots__/test_feature_flag.ambr
@@ -711,15 +711,146 @@
"posthog_user"."onboarding_delegated_to_organization_id",
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
- "posthog_user"."email_opt_in"
+ "posthog_user"."email_opt_in",
+ "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_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
WHERE ("posthog_user"."is_active"
AND "posthog_user"."id" = 99999)
'''
# ---
# name: TestFeatureFlag.test_creating_static_cohort.1
'''
- SELECT "posthog_organization"."id",
+ 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"."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",
@@ -758,33 +889,13 @@
"posthog_organization"."personalization",
"posthog_organization"."domain_whitelist",
"posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ FROM "posthog_team"
+ INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
+ WHERE "posthog_team"."id" = 99999
LIMIT 21
'''
# ---
# name: TestFeatureFlag.test_creating_static_cohort.10
- '''
- SELECT "posthog_taggeditem"."id",
- "posthog_taggeditem"."tag_id",
- "posthog_taggeditem"."content_type_id",
- "posthog_taggeditem"."object_id",
- "posthog_taggeditem"."object_uuid",
- "posthog_taggeditem"."team_id",
- "posthog_tag"."id",
- "posthog_tag"."name",
- "posthog_tag"."team_id"
- 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" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestFeatureFlag.test_creating_static_cohort.11
'''
SELECT "posthog_experiment"."id",
"posthog_experiment"."name",
@@ -800,7 +911,7 @@
5 /* ... */))
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.12
+# name: TestFeatureFlag.test_creating_static_cohort.11
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -898,7 +1009,7 @@
LIMIT 21
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.13
+# name: TestFeatureFlag.test_creating_static_cohort.12
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -923,7 +1034,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.14
+# name: TestFeatureFlag.test_creating_static_cohort.13
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -948,7 +1059,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.15
+# name: TestFeatureFlag.test_creating_static_cohort.14
'''
SELECT "posthog_filesystemshortcut"."id",
"posthog_filesystemshortcut"."team_id",
@@ -971,7 +1082,7 @@
AND "posthog_filesystemshortcut"."href" IS NOT NULL))
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.16
+# name: TestFeatureFlag.test_creating_static_cohort.15
'''
SELECT "posthog_team"."id",
"posthog_team"."project_id"
@@ -980,7 +1091,7 @@
LIMIT 21
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.17
+# name: TestFeatureFlag.test_creating_static_cohort.16
'''
SELECT "posthog_cohort"."id",
"posthog_cohort"."name",
@@ -1019,7 +1130,7 @@
LIMIT 21
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.18
+# name: TestFeatureFlag.test_creating_static_cohort.17
'''
SELECT "posthog_featureflag"."id",
"posthog_featureflag"."key",
@@ -1050,7 +1161,7 @@
LIMIT 21
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.19
+# name: TestFeatureFlag.test_creating_static_cohort.18
'''
SELECT "feature_flags_teamfeatureflagsconfig"."property_matching_version" AS "property_matching_version"
FROM "feature_flags_teamfeatureflagsconfig"
@@ -1059,7 +1170,7 @@
LIMIT 1
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.2
+# name: TestFeatureFlag.test_creating_static_cohort.19
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1151,151 +1262,29 @@
"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"
+ "posthog_team"."business_model"
FROM "posthog_team"
- INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
WHERE "posthog_team"."id" = 99999
LIMIT 21
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.20
+# name: TestFeatureFlag.test_creating_static_cohort.2
'''
- 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"."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"
- FROM "posthog_team"
- WHERE "posthog_team"."id" = 99999
+ SELECT "posthog_project"."updated_at",
+ "posthog_project"."id",
+ "posthog_project"."organization_id",
+ "posthog_project"."name",
+ "posthog_project"."logo_media_id",
+ "posthog_project"."created_at",
+ "posthog_project"."product_description",
+ "posthog_project"."is_pending_deletion",
+ "posthog_project"."deletion_scheduled_at"
+ FROM "posthog_project"
+ WHERE "posthog_project"."id" = 99999
LIMIT 21
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.21
+# name: TestFeatureFlag.test_creating_static_cohort.20
'''
SELECT 1 AS "a"
FROM "posthog_cohort"
@@ -1311,7 +1300,7 @@
LIMIT 1
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.22
+# name: TestFeatureFlag.test_creating_static_cohort.21
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1409,7 +1398,7 @@
LIMIT 21
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.23
+# name: TestFeatureFlag.test_creating_static_cohort.22
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -1434,7 +1423,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.24
+# name: TestFeatureFlag.test_creating_static_cohort.23
'''
SELECT "posthog_filesystemshortcut"."id",
"posthog_filesystemshortcut"."team_id",
@@ -1457,7 +1446,7 @@
AND "posthog_filesystemshortcut"."href" IS NOT NULL))
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.25
+# name: TestFeatureFlag.test_creating_static_cohort.24
'''
SELECT "posthog_cohort"."id",
"posthog_cohort"."name",
@@ -1494,7 +1483,7 @@
LIMIT 21
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.26
+# name: TestFeatureFlag.test_creating_static_cohort.25
'''
SELECT "cohort_realtime_team_access"."team_id",
"cohort_realtime_team_access"."level",
@@ -1506,7 +1495,7 @@
FROM "cohort_realtime_team_access"
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.27
+# name: TestFeatureFlag.test_creating_static_cohort.26
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1604,7 +1593,7 @@
LIMIT 21
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.28
+# name: TestFeatureFlag.test_creating_static_cohort.27
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -1651,7 +1640,7 @@
LIMIT 21
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.29
+# name: TestFeatureFlag.test_creating_static_cohort.28
'''
SELECT "posthog_cohortcalculationhistory"."id",
"posthog_cohortcalculationhistory"."team_id",
@@ -1672,23 +1661,7 @@
LIMIT 1
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.3
- '''
- SELECT "posthog_project"."updated_at",
- "posthog_project"."id",
- "posthog_project"."organization_id",
- "posthog_project"."name",
- "posthog_project"."logo_media_id",
- "posthog_project"."created_at",
- "posthog_project"."product_description",
- "posthog_project"."is_pending_deletion",
- "posthog_project"."deletion_scheduled_at"
- FROM "posthog_project"
- WHERE "posthog_project"."id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestFeatureFlag.test_creating_static_cohort.30
+# name: TestFeatureFlag.test_creating_static_cohort.29
'''
SELECT "cohort_realtime_team_access"."team_id",
"cohort_realtime_team_access"."level",
@@ -1700,7 +1673,62 @@
FROM "cohort_realtime_team_access"
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.31
+# name: TestFeatureFlag.test_creating_static_cohort.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: TestFeatureFlag.test_creating_static_cohort.30
'''
SELECT "posthog_experiment"."id",
"posthog_experiment"."name",
@@ -1744,7 +1772,7 @@
WHERE "posthog_experiment"."exposure_cohort_id" = 99999
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.32
+# name: TestFeatureFlag.test_creating_static_cohort.31
'''
/* user_id:0 celery:posthog.tasks.calculate_cohort.insert_cohort_from_feature_flag */
SELECT person_id
@@ -1755,7 +1783,7 @@
GROUP BY person_id
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.33
+# name: TestFeatureFlag.test_creating_static_cohort.32
'''
/* user_id:0 request:_snapshot_ */
SELECT persons.id AS id
@@ -1796,61 +1824,6 @@
'''
# ---
# name: TestFeatureFlag.test_creating_static_cohort.4
- '''
- 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: TestFeatureFlag.test_creating_static_cohort.5
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -1873,7 +1846,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.6
+# name: TestFeatureFlag.test_creating_static_cohort.5
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1926,7 +1899,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.7
+# name: TestFeatureFlag.test_creating_static_cohort.6
'''
SELECT "posthog_featureflag"."id",
"posthog_featureflag"."key",
@@ -2038,7 +2011,7 @@
LIMIT 21
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.8
+# name: TestFeatureFlag.test_creating_static_cohort.7
'''
SELECT "posthog_earlyaccessfeature"."id",
"posthog_earlyaccessfeature"."team_id",
@@ -2108,7 +2081,7 @@
5 /* ... */)
'''
# ---
-# name: TestFeatureFlag.test_creating_static_cohort.9
+# name: TestFeatureFlag.test_creating_static_cohort.8
'''
SELECT "posthog_featureflagevaluationcontext"."id",
"posthog_featureflagevaluationcontext"."feature_flag_id",
@@ -2128,3 +2101,24 @@
5 /* ... */)
'''
# ---
+# name: TestFeatureFlag.test_creating_static_cohort.9
+ '''
+ SELECT "posthog_taggeditem"."id",
+ "posthog_taggeditem"."tag_id",
+ "posthog_taggeditem"."content_type_id",
+ "posthog_taggeditem"."object_id",
+ "posthog_taggeditem"."object_uuid",
+ "posthog_taggeditem"."team_id",
+ "posthog_tag"."id",
+ "posthog_tag"."name",
+ "posthog_tag"."team_id"
+ 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" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
+ '''
+# ---
diff --git a/products/feature_flags/backend/api/test/__snapshots__/test_organization_feature_flag.ambr b/products/feature_flags/backend/api/test/__snapshots__/test_organization_feature_flag.ambr
index 63530e46a99f..1fbd1757d7ad 100644
--- a/products/feature_flags/backend/api/test/__snapshots__/test_organization_feature_flag.ambr
+++ b/products/feature_flags/backend/api/test/__snapshots__/test_organization_feature_flag.ambr
@@ -39,8 +39,48 @@
"posthog_user"."onboarding_delegated_to_organization_id",
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
- "posthog_user"."email_opt_in"
+ "posthog_user"."email_opt_in",
+ "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_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
WHERE ("posthog_user"."is_active"
AND "posthog_user"."id" = 99999)
'''
@@ -92,38 +132,6 @@
'''
# ---
# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.10
- '''
- SELECT "posthog_featureflag"."id",
- "posthog_featureflag"."key",
- "posthog_featureflag"."name",
- "posthog_featureflag"."filters",
- "posthog_featureflag"."team_id",
- "posthog_featureflag"."created_by_id",
- "posthog_featureflag"."created_at",
- "posthog_featureflag"."updated_at",
- "posthog_featureflag"."deleted",
- "posthog_featureflag"."active",
- "posthog_featureflag"."archived",
- "posthog_featureflag"."version",
- "posthog_featureflag"."last_modified_by_id",
- "posthog_featureflag"."ensure_experience_continuity",
- "posthog_featureflag"."usage_dashboard_id",
- "posthog_featureflag"."has_enriched_analytics",
- "posthog_featureflag"."is_remote_configuration",
- "posthog_featureflag"."has_encrypted_payloads",
- "posthog_featureflag"."evaluation_runtime",
- "posthog_featureflag"."bucketing_identifier",
- "posthog_featureflag"."last_called_at"
- FROM "posthog_featureflag"
- WHERE (NOT ("posthog_featureflag"."deleted")
- AND NOT "posthog_featureflag"."deleted"
- AND "posthog_featureflag"."key" = 'copied-flag-key'
- AND "posthog_featureflag"."team_id" = 99999)
- ORDER BY "posthog_featureflag"."id" ASC
- LIMIT 1
- '''
-# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.11
'''
SELECT 1 AS "a"
FROM "posthog_featureflag"
@@ -134,7 +142,7 @@
LIMIT 1
'''
# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.12
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.11
'''
SELECT "posthog_team"."parent_team_id" AS "parent_team_id"
FROM "posthog_team"
@@ -143,7 +151,7 @@
LIMIT 1
'''
# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.13
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.12
'''
SELECT "feature_flags_teamfeatureflagsconfig"."max_feature_flags_override" AS "max_feature_flags_override"
FROM "feature_flags_teamfeatureflagsconfig"
@@ -152,7 +160,7 @@
LIMIT 1
'''
# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.14
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.13
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_featureflag"
@@ -167,7 +175,7 @@
AND "posthog_featureflag"."team_id" = 99999)))
'''
# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.15
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.14
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -213,7 +221,7 @@
LIMIT 21
'''
# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.16
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.15
'''
SELECT "posthog_featureflag"."id",
"posthog_featureflag"."key",
@@ -243,7 +251,7 @@
AND "posthog_team"."project_id" = 99999)
'''
# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.17
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.16
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -341,7 +349,7 @@
LIMIT 21
'''
# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.18
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.17
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -366,7 +374,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.19
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.18
'''
SELECT "posthog_integration"."id",
"posthog_integration"."team_id",
@@ -389,7 +397,7 @@
LIMIT 1
'''
# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.2
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.19
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -435,9 +443,16 @@
LIMIT 21
'''
# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.20
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.2
'''
- SELECT "posthog_organization"."id",
+ 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",
@@ -476,12 +491,14 @@
"posthog_organization"."personalization",
"posthog_organization"."domain_whitelist",
"posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ 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: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.21
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.20
'''
SELECT "posthog_organizationintegration"."id",
"posthog_organizationintegration"."organization_id",
@@ -498,7 +515,7 @@
LIMIT 21
'''
# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.22
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.21
'''
SELECT "posthog_experiment"."id",
"posthog_experiment"."name",
@@ -514,7 +531,7 @@
5 /* ... */))
'''
# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.23
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.22
'''
SELECT "posthog_survey"."id",
"posthog_survey"."team_id",
@@ -559,7 +576,7 @@
WHERE "posthog_survey"."linked_flag_id" = 99999
'''
# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.24
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.23
'''
SELECT "posthog_earlyaccessfeature"."id",
"posthog_earlyaccessfeature"."team_id",
@@ -577,7 +594,7 @@
WHERE "posthog_earlyaccessfeature"."feature_flag_id" = 99999
'''
# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.25
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.24
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -632,7 +649,7 @@
LIMIT 21
'''
# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.26
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.25
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -667,7 +684,7 @@
WHERE "U0"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid)))
'''
# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.27
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.26
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -722,7 +739,7 @@
LIMIT 21
'''
# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.28
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.27
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -751,7 +768,7 @@
AND "posthog_featureflagdashboards"."feature_flag_id" = 99999)
'''
# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.29
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.28
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -806,6 +823,18 @@
LIMIT 21
'''
# ---
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.29
+ '''
+ SELECT 1 AS "a"
+ FROM "posthog_team"
+ WHERE (("posthog_team"."session_recording_linked_flag" @> '{"id": 99999}'::jsonb
+ OR "posthog_team"."session_recording_trigger_groups" @> '{"groups": [{"conditions": {"flag": "copied-flag-key"}}]}'::jsonb
+ OR "posthog_team"."session_recording_trigger_groups" @> '{"groups": [{"conditions": {"flag": {"key": "copied-flag-key"}}}]}'::jsonb
+ OR "posthog_team"."session_recording_trigger_groups" @> '{"groups": [{"conditions": {"flag": {"id": 99999}}}]}'::jsonb)
+ AND "posthog_team"."project_id" = 99999)
+ LIMIT 1
+ '''
+# ---
# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.3
'''
SELECT "posthog_organizationmembership"."id",
@@ -856,24 +885,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: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.30
- '''
- SELECT 1 AS "a"
- FROM "posthog_team"
- WHERE (("posthog_team"."session_recording_linked_flag" @> '{"id": 99999}'::jsonb
- OR "posthog_team"."session_recording_trigger_groups" @> '{"groups": [{"conditions": {"flag": "copied-flag-key"}}]}'::jsonb
- OR "posthog_team"."session_recording_trigger_groups" @> '{"groups": [{"conditions": {"flag": {"key": "copied-flag-key"}}}]}'::jsonb
- OR "posthog_team"."session_recording_trigger_groups" @> '{"groups": [{"conditions": {"flag": {"id": 99999}}}]}'::jsonb)
- AND "posthog_team"."project_id" = 99999)
- LIMIT 1
- '''
-# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.31
'''
SELECT "posthog_featureflagevaluationcontext"."id",
"posthog_featureflagevaluationcontext"."feature_flag_id",
@@ -889,7 +904,7 @@
WHERE "posthog_featureflagevaluationcontext"."feature_flag_id" = 99999
'''
# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.32
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.31
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -899,59 +914,6 @@
'''
# ---
# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.4
- '''
- 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: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.5
'''
SELECT "posthog_team"."id",
"posthog_team"."organization_id",
@@ -960,7 +922,7 @@
WHERE "posthog_team"."organization_id" IN ('00000000-0000-0000-0000-000000000000'::uuid)
'''
# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.6
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.5
'''
SELECT "posthog_featureflag"."id",
"posthog_featureflag"."key",
@@ -997,7 +959,7 @@
LIMIT 21
'''
# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.7
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.6
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1095,7 +1057,7 @@
LIMIT 21
'''
# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.8
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.7
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1150,7 +1112,7 @@
LIMIT 21
'''
# ---
-# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.9
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.8
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1250,6 +1212,38 @@
LIMIT 1
'''
# ---
+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.9
+ '''
+ SELECT "posthog_featureflag"."id",
+ "posthog_featureflag"."key",
+ "posthog_featureflag"."name",
+ "posthog_featureflag"."filters",
+ "posthog_featureflag"."team_id",
+ "posthog_featureflag"."created_by_id",
+ "posthog_featureflag"."created_at",
+ "posthog_featureflag"."updated_at",
+ "posthog_featureflag"."deleted",
+ "posthog_featureflag"."active",
+ "posthog_featureflag"."archived",
+ "posthog_featureflag"."version",
+ "posthog_featureflag"."last_modified_by_id",
+ "posthog_featureflag"."ensure_experience_continuity",
+ "posthog_featureflag"."usage_dashboard_id",
+ "posthog_featureflag"."has_enriched_analytics",
+ "posthog_featureflag"."is_remote_configuration",
+ "posthog_featureflag"."has_encrypted_payloads",
+ "posthog_featureflag"."evaluation_runtime",
+ "posthog_featureflag"."bucketing_identifier",
+ "posthog_featureflag"."last_called_at"
+ FROM "posthog_featureflag"
+ WHERE (NOT ("posthog_featureflag"."deleted")
+ AND NOT "posthog_featureflag"."deleted"
+ AND "posthog_featureflag"."key" = 'copied-flag-key'
+ AND "posthog_featureflag"."team_id" = 99999)
+ ORDER BY "posthog_featureflag"."id" ASC
+ LIMIT 1
+ '''
+# ---
# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_with_dependencies_query_count
'''
SELECT "posthog_featureflag"."key" AS "key"
@@ -1322,15 +1316,8 @@
"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: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.1
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -1369,21 +1356,15 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.10
+# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.1
'''
- 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",
@@ -1422,14 +1403,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: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.11
+# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.10
'''
SELECT "posthog_featureflag"."id" AS "id"
FROM "posthog_featureflag"
@@ -1450,7 +1429,7 @@
AND "posthog_featureflag"."team_id" = 99999)))
'''
# ---
-# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.12
+# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.11
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1505,7 +1484,7 @@
LIMIT 21
'''
# ---
-# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.13
+# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.12
'''
SELECT "posthog_featureflag"."id" AS "id"
FROM "posthog_featureflag"
@@ -1526,7 +1505,7 @@
AND "posthog_featureflag"."team_id" = 99999)))
'''
# ---
-# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.14
+# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.13
'''
SELECT "posthog_featureflag"."id",
"posthog_featureflag"."key",
@@ -1605,7 +1584,7 @@
5 /* ... */))
'''
# ---
-# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.15
+# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.14
'''
SELECT "feature_flags_organizationfeatureflagsconfig"."flag_evaluations_mode" AS "flag_evaluations_mode"
FROM "feature_flags_organizationfeatureflagsconfig"
@@ -1615,52 +1594,6 @@
'''
# ---
# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.2
- '''
- 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: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.3
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1715,7 +1648,7 @@
LIMIT 21
'''
# ---
-# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.4
+# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.3
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1768,7 +1701,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.5
+# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.4
'''
SELECT "posthog_team"."id",
"posthog_team"."organization_id",
@@ -1777,14 +1710,14 @@
WHERE "posthog_team"."organization_id" IN ('00000000-0000-0000-0000-000000000000'::uuid)
'''
# ---
-# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.6
+# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.5
'''
SELECT "posthog_team"."id" AS "id"
FROM "posthog_team"
WHERE "posthog_team"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
'''
# ---
-# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.7
+# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.6
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1885,7 +1818,7 @@
5 /* ... */)
'''
# ---
-# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.8
+# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.7
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1940,7 +1873,7 @@
LIMIT 21
'''
# ---
-# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.9
+# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.8
'''
SELECT "posthog_featureflag"."id" AS "id"
FROM "posthog_featureflag"
@@ -1961,3 +1894,58 @@
AND "posthog_featureflag"."team_id" = 99999)))
'''
# ---
+# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success.9
+ '''
+ 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
+ '''
+# ---
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 4aa78d9042ea..ce8c1acde297 100644
--- a/products/product_analytics/backend/tests/api/__snapshots__/test_insight.ambr
+++ b/products/product_analytics/backend/tests/api/__snapshots__/test_insight.ambr
@@ -28,17 +28,10 @@
# ---
# name: TestInsight.test_listing_insights_does_not_nplus1.10
'''
- SELECT "posthog_dashboard"."id" AS "id"
+ SELECT "posthog_dashboard"."id" AS "id",
+ "posthog_dashboard"."name" AS "name"
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 "posthog_dashboard"."id" IN (1,
2,
3,
@@ -47,148 +40,6 @@
'''
# ---
# name: TestInsight.test_listing_insights_does_not_nplus1.100
- '''
- 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.101
- '''
- 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",
- "customer_analytics_teamcustomeranalyticsconfig"."properties"
- FROM "customer_analytics_teamcustomeranalyticsconfig"
- WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.102
- '''
- 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: TestInsight.test_listing_insights_does_not_nplus1.103
- '''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_dashboarditem"
- WHERE NOT ("posthog_dashboarditem"."deleted")
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.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: TestInsight.test_listing_insights_does_not_nplus1.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: TestInsight.test_listing_insights_does_not_nplus1.106
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -326,7 +177,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.107
+# name: TestInsight.test_listing_insights_does_not_nplus1.101
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -381,7 +232,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.108
+# name: TestInsight.test_listing_insights_does_not_nplus1.102
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -404,7 +255,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.109
+# name: TestInsight.test_listing_insights_does_not_nplus1.103
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -457,20 +308,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.11
- '''
- SELECT "posthog_dashboard"."id" AS "id",
- "posthog_dashboard"."name" AS "name"
- 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.110
+# name: TestInsight.test_listing_insights_does_not_nplus1.104
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboarditem"
@@ -479,7 +317,7 @@
AND NOT ("posthog_dashboarditem"."deleted"))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.111
+# name: TestInsight.test_listing_insights_does_not_nplus1.105
'''
SELECT "posthog_dashboarditem"."id",
"posthog_dashboarditem"."name",
@@ -665,7 +503,7 @@
LIMIT 100
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.112
+# name: TestInsight.test_listing_insights_does_not_nplus1.106
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -683,7 +521,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.113
+# name: TestInsight.test_listing_insights_does_not_nplus1.107
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -700,7 +538,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.114
+# name: TestInsight.test_listing_insights_does_not_nplus1.108
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -721,7 +559,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.115
+# name: TestInsight.test_listing_insights_does_not_nplus1.109
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -734,7 +572,20 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.116
+# name: TestInsight.test_listing_insights_does_not_nplus1.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"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL))
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.110
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -748,7 +599,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.117
+# name: TestInsight.test_listing_insights_does_not_nplus1.111
'''
SELECT "posthog_team"."id" AS "id"
FROM "posthog_team"
@@ -756,7 +607,7 @@
AND "posthog_team"."receive_org_level_activity_logs")
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.118
+# name: TestInsight.test_listing_insights_does_not_nplus1.112
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -781,7 +632,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.119
+# name: TestInsight.test_listing_insights_does_not_nplus1.113
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -821,28 +672,8 @@
"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: TestInsight.test_listing_insights_does_not_nplus1.12
- '''
- 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"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL))
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.120
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -881,12 +712,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.121
+# name: TestInsight.test_listing_insights_does_not_nplus1.114
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1024,7 +856,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.122
+# name: TestInsight.test_listing_insights_does_not_nplus1.115
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1079,7 +911,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.123
+# name: TestInsight.test_listing_insights_does_not_nplus1.116
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -1102,7 +934,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.124
+# name: TestInsight.test_listing_insights_does_not_nplus1.117
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1155,7 +987,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.125
+# name: TestInsight.test_listing_insights_does_not_nplus1.118
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -1175,7 +1007,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.126
+# name: TestInsight.test_listing_insights_does_not_nplus1.119
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -1188,20 +1020,52 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.127
+# name: TestInsight.test_listing_insights_does_not_nplus1.12
'''
- 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"."deleted"
+ 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"."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.120
+ '''
+ 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"."deleted"
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.128
+# name: TestInsight.test_listing_insights_does_not_nplus1.121
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -1233,7 +1097,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.129
+# name: TestInsight.test_listing_insights_does_not_nplus1.122
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1331,39 +1195,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.13
- '''
- 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"."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.130
+# name: TestInsight.test_listing_insights_does_not_nplus1.123
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -1409,7 +1241,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.131
+# name: TestInsight.test_listing_insights_does_not_nplus1.124
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1507,7 +1339,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.132
+# name: TestInsight.test_listing_insights_does_not_nplus1.125
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -1532,7 +1364,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.133
+# name: TestInsight.test_listing_insights_does_not_nplus1.126
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -1550,7 +1382,7 @@
UPDATE
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.134
+# name: TestInsight.test_listing_insights_does_not_nplus1.127
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -1579,7 +1411,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.135
+# name: TestInsight.test_listing_insights_does_not_nplus1.128
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -1608,7 +1440,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.136
+# name: TestInsight.test_listing_insights_does_not_nplus1.129
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -1628,54 +1460,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.137
- '''
- 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.138
- '''
- 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.139
- '''
- 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",
- "customer_analytics_teamcustomeranalyticsconfig"."properties"
- FROM "customer_analytics_teamcustomeranalyticsconfig"
- WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.14
+# name: TestInsight.test_listing_insights_does_not_nplus1.13
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1773,7 +1558,54 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.140
+# name: TestInsight.test_listing_insights_does_not_nplus1.130
+ '''
+ 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.131
+ '''
+ 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.132
+ '''
+ 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",
+ "customer_analytics_teamcustomeranalyticsconfig"."properties"
+ FROM "customer_analytics_teamcustomeranalyticsconfig"
+ WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.133
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -1782,14 +1614,14 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.141
+# name: TestInsight.test_listing_insights_does_not_nplus1.134
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboarditem"
WHERE NOT ("posthog_dashboarditem"."deleted")
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.142
+# name: TestInsight.test_listing_insights_does_not_nplus1.135
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -1829,15 +1661,8 @@
"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: TestInsight.test_listing_insights_does_not_nplus1.143
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -1876,12 +1701,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.144
+# name: TestInsight.test_listing_insights_does_not_nplus1.136
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -2019,7 +1845,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.145
+# name: TestInsight.test_listing_insights_does_not_nplus1.137
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -2074,7 +1900,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.146
+# name: TestInsight.test_listing_insights_does_not_nplus1.138
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -2097,7 +1923,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.147
+# name: TestInsight.test_listing_insights_does_not_nplus1.139
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -2150,46 +1976,92 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.148
- '''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_dashboarditem"
- INNER JOIN "posthog_team" ON ("posthog_dashboarditem"."team_id" = "posthog_team"."id")
- WHERE ("posthog_team"."project_id" = 99999
- AND NOT ("posthog_dashboarditem"."deleted"))
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.149
+# name: TestInsight.test_listing_insights_does_not_nplus1.14
'''
- SELECT "posthog_dashboarditem"."id",
- "posthog_dashboarditem"."name",
- "posthog_dashboarditem"."derived_name",
- "posthog_dashboarditem"."description",
- "posthog_dashboarditem"."team_id",
- "posthog_dashboarditem"."filters",
- "posthog_dashboarditem"."filters_hash",
- "posthog_dashboarditem"."query",
- "posthog_dashboarditem"."query_metadata",
- "posthog_dashboarditem"."order",
- "posthog_dashboarditem"."deleted",
- "posthog_dashboarditem"."saved",
- "posthog_dashboarditem"."created_at",
- "posthog_dashboarditem"."refreshing",
- "posthog_dashboarditem"."created_by_id",
- "posthog_dashboarditem"."is_sample",
- "posthog_dashboarditem"."short_id",
- "posthog_dashboarditem"."favorited",
- "posthog_dashboarditem"."refresh_attempt",
- "posthog_dashboarditem"."last_modified_at",
- "posthog_dashboarditem"."last_modified_by_id",
- "posthog_dashboarditem"."dashboard_id",
- "posthog_dashboarditem"."last_refresh",
- "posthog_dashboarditem"."layouts",
- "posthog_dashboarditem"."color",
- "posthog_dashboarditem"."dive_dashboard_id",
- "posthog_dashboarditem"."updated_at",
- "posthog_dashboarditem"."deprecated_tags",
- "posthog_dashboarditem"."tags",
+ 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: TestInsight.test_listing_insights_does_not_nplus1.140
+ '''
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_dashboarditem"
+ INNER JOIN "posthog_team" ON ("posthog_dashboarditem"."team_id" = "posthog_team"."id")
+ WHERE ("posthog_team"."project_id" = 99999
+ AND NOT ("posthog_dashboarditem"."deleted"))
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.141
+ '''
+ SELECT "posthog_dashboarditem"."id",
+ "posthog_dashboarditem"."name",
+ "posthog_dashboarditem"."derived_name",
+ "posthog_dashboarditem"."description",
+ "posthog_dashboarditem"."team_id",
+ "posthog_dashboarditem"."filters",
+ "posthog_dashboarditem"."filters_hash",
+ "posthog_dashboarditem"."query",
+ "posthog_dashboarditem"."query_metadata",
+ "posthog_dashboarditem"."order",
+ "posthog_dashboarditem"."deleted",
+ "posthog_dashboarditem"."saved",
+ "posthog_dashboarditem"."created_at",
+ "posthog_dashboarditem"."refreshing",
+ "posthog_dashboarditem"."created_by_id",
+ "posthog_dashboarditem"."is_sample",
+ "posthog_dashboarditem"."short_id",
+ "posthog_dashboarditem"."favorited",
+ "posthog_dashboarditem"."refresh_attempt",
+ "posthog_dashboarditem"."last_modified_at",
+ "posthog_dashboarditem"."last_modified_by_id",
+ "posthog_dashboarditem"."dashboard_id",
+ "posthog_dashboarditem"."last_refresh",
+ "posthog_dashboarditem"."layouts",
+ "posthog_dashboarditem"."color",
+ "posthog_dashboarditem"."dive_dashboard_id",
+ "posthog_dashboarditem"."updated_at",
+ "posthog_dashboarditem"."deprecated_tags",
+ "posthog_dashboarditem"."tags",
(SELECT "U0"."last_viewed_at" AS "last_viewed_at"
FROM "posthog_insightviewed" "U0"
@@ -2345,53 +2217,7 @@
LIMIT 100
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.15
- '''
- 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: TestInsight.test_listing_insights_does_not_nplus1.150
+# name: TestInsight.test_listing_insights_does_not_nplus1.142
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -2409,7 +2235,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.151
+# name: TestInsight.test_listing_insights_does_not_nplus1.143
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -2426,7 +2252,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.152
+# name: TestInsight.test_listing_insights_does_not_nplus1.144
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -2447,7 +2273,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.153
+# name: TestInsight.test_listing_insights_does_not_nplus1.145
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -2460,7 +2286,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.154
+# name: TestInsight.test_listing_insights_does_not_nplus1.146
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -2474,7 +2300,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.155
+# name: TestInsight.test_listing_insights_does_not_nplus1.147
'''
SELECT "posthog_team"."id" AS "id"
FROM "posthog_team"
@@ -2482,7 +2308,7 @@
AND "posthog_team"."receive_org_level_activity_logs")
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.156
+# name: TestInsight.test_listing_insights_does_not_nplus1.148
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -2507,7 +2333,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.157
+# name: TestInsight.test_listing_insights_does_not_nplus1.149
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -2547,15 +2373,8 @@
"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: TestInsight.test_listing_insights_does_not_nplus1.158
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -2594,12 +2413,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.159
+# name: TestInsight.test_listing_insights_does_not_nplus1.15
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -2691,53 +2511,13 @@
"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"
+ "posthog_team"."business_model"
FROM "posthog_team"
- INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
WHERE "posthog_team"."id" = 99999
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.16
+# name: TestInsight.test_listing_insights_does_not_nplus1.150
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -2829,13 +2609,53 @@
"posthog_team"."api_query_rate_limit",
"posthog_team"."drop_events_older_than",
"posthog_team"."base_currency",
- "posthog_team"."business_model"
+ "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: TestInsight.test_listing_insights_does_not_nplus1.160
+# name: TestInsight.test_listing_insights_does_not_nplus1.151
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -2890,7 +2710,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.161
+# name: TestInsight.test_listing_insights_does_not_nplus1.152
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -2913,7 +2733,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.162
+# name: TestInsight.test_listing_insights_does_not_nplus1.153
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -2966,7 +2786,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.163
+# name: TestInsight.test_listing_insights_does_not_nplus1.154
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -2986,7 +2806,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.164
+# name: TestInsight.test_listing_insights_does_not_nplus1.155
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -2999,7 +2819,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.165
+# name: TestInsight.test_listing_insights_does_not_nplus1.156
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -3012,7 +2832,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.166
+# name: TestInsight.test_listing_insights_does_not_nplus1.157
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -3044,7 +2864,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.167
+# name: TestInsight.test_listing_insights_does_not_nplus1.158
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -3142,7 +2962,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.168
+# name: TestInsight.test_listing_insights_does_not_nplus1.159
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -3188,7 +3008,32 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.169
+# name: TestInsight.test_listing_insights_does_not_nplus1.16
+ '''
+ 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: TestInsight.test_listing_insights_does_not_nplus1.160
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -3286,32 +3131,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.17
- '''
- 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: TestInsight.test_listing_insights_does_not_nplus1.170
+# name: TestInsight.test_listing_insights_does_not_nplus1.161
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -3336,7 +3156,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.171
+# name: TestInsight.test_listing_insights_does_not_nplus1.162
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -3354,7 +3174,7 @@
UPDATE
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.172
+# name: TestInsight.test_listing_insights_does_not_nplus1.163
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -3383,7 +3203,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.173
+# name: TestInsight.test_listing_insights_does_not_nplus1.164
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -3412,7 +3232,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.174
+# name: TestInsight.test_listing_insights_does_not_nplus1.165
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -3432,7 +3252,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.175
+# name: TestInsight.test_listing_insights_does_not_nplus1.166
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -3445,7 +3265,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.176
+# name: TestInsight.test_listing_insights_does_not_nplus1.167
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -3461,7 +3281,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.177
+# name: TestInsight.test_listing_insights_does_not_nplus1.168
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -3479,7 +3299,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.178
+# name: TestInsight.test_listing_insights_does_not_nplus1.169
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -3488,14 +3308,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.179
- '''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_dashboarditem"
- WHERE NOT ("posthog_dashboarditem"."deleted")
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.18
+# name: TestInsight.test_listing_insights_does_not_nplus1.17
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -3513,7 +3326,14 @@
UPDATE
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.180
+# name: TestInsight.test_listing_insights_does_not_nplus1.170
+ '''
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_dashboarditem"
+ WHERE NOT ("posthog_dashboarditem"."deleted")
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.171
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -3553,15 +3373,8 @@
"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: TestInsight.test_listing_insights_does_not_nplus1.181
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -3600,12 +3413,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.182
+# name: TestInsight.test_listing_insights_does_not_nplus1.172
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -3743,7 +3557,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.183
+# name: TestInsight.test_listing_insights_does_not_nplus1.173
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -3798,7 +3612,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.184
+# name: TestInsight.test_listing_insights_does_not_nplus1.174
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -3821,7 +3635,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.185
+# name: TestInsight.test_listing_insights_does_not_nplus1.175
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -3874,7 +3688,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.186
+# name: TestInsight.test_listing_insights_does_not_nplus1.176
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboarditem"
@@ -3883,7 +3697,7 @@
AND NOT ("posthog_dashboarditem"."deleted"))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.187
+# name: TestInsight.test_listing_insights_does_not_nplus1.177
'''
SELECT "posthog_dashboarditem"."id",
"posthog_dashboarditem"."name",
@@ -4069,7 +3883,7 @@
LIMIT 100
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.188
+# name: TestInsight.test_listing_insights_does_not_nplus1.178
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -4087,7 +3901,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.189
+# name: TestInsight.test_listing_insights_does_not_nplus1.179
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -4104,7 +3918,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.19
+# name: TestInsight.test_listing_insights_does_not_nplus1.18
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -4133,7 +3947,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.190
+# name: TestInsight.test_listing_insights_does_not_nplus1.180
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -4154,253 +3968,53 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.2
- '''
- SELECT "posthog_team"."id" AS "id"
- FROM "posthog_team"
- WHERE ("posthog_team"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_team"."receive_org_level_activity_logs")
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.20
- '''
- SELECT "posthog_dashboardtile"."id",
- "posthog_dashboardtile"."dashboard_id",
- "posthog_dashboardtile"."insight_id",
- "posthog_dashboardtile"."text_id",
- "posthog_dashboardtile"."button_tile_id",
- "posthog_dashboardtile"."widget_id",
- "posthog_dashboardtile"."team_id",
- "posthog_dashboardtile"."layouts",
- "posthog_dashboardtile"."color",
- "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: TestInsight.test_listing_insights_does_not_nplus1.21
- '''
- 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: TestInsight.test_listing_insights_does_not_nplus1.22
+# name: TestInsight.test_listing_insights_does_not_nplus1.181
'''
- 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
+ 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: TestInsight.test_listing_insights_does_not_nplus1.23
- '''
- 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.24
- '''
- 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",
- "customer_analytics_teamcustomeranalyticsconfig"."properties"
- FROM "customer_analytics_teamcustomeranalyticsconfig"
- WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.25
- '''
- SELECT "customer_analytics_teamcustomeranalyticsconfig"."account_group_type_index" AS "account_group_type_index"
- FROM "customer_analytics_teamcustomeranalyticsconfig"
- WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
- ORDER BY "customer_analytics_teamcustomeranalyticsconfig"."team_id" ASC
- LIMIT 1
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.26
- '''
- 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: TestInsight.test_listing_insights_does_not_nplus1.27
- '''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_dashboarditem"
- WHERE NOT ("posthog_dashboarditem"."deleted")
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.28
- '''
- 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: TestInsight.test_listing_insights_does_not_nplus1.29
- '''
- 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: TestInsight.test_listing_insights_does_not_nplus1.3
- '''
- 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" = 'dashboard'
- AND NOT ("posthog_filesystem"."shortcut"
- AND "posthog_filesystem"."shortcut" IS NOT NULL))
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.30
+# name: TestInsight.test_listing_insights_does_not_nplus1.182
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -4538,7 +4152,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.31
+# name: TestInsight.test_listing_insights_does_not_nplus1.183
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -4593,7 +4207,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.32
+# name: TestInsight.test_listing_insights_does_not_nplus1.184
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -4616,7 +4230,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.33
+# name: TestInsight.test_listing_insights_does_not_nplus1.185
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -4669,7 +4283,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.34
+# name: TestInsight.test_listing_insights_does_not_nplus1.186
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboarditem"
@@ -4678,7 +4292,7 @@
AND NOT ("posthog_dashboarditem"."deleted"))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.35
+# name: TestInsight.test_listing_insights_does_not_nplus1.187
'''
SELECT "posthog_dashboarditem"."id",
"posthog_dashboarditem"."name",
@@ -4864,7 +4478,7 @@
LIMIT 100
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.36
+# name: TestInsight.test_listing_insights_does_not_nplus1.188
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -4882,7 +4496,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.37
+# name: TestInsight.test_listing_insights_does_not_nplus1.189
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -4899,7 +4513,36 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.38
+# name: TestInsight.test_listing_insights_does_not_nplus1.19
+ '''
+ SELECT "posthog_dashboardtile"."id",
+ "posthog_dashboardtile"."dashboard_id",
+ "posthog_dashboardtile"."insight_id",
+ "posthog_dashboardtile"."text_id",
+ "posthog_dashboardtile"."button_tile_id",
+ "posthog_dashboardtile"."widget_id",
+ "posthog_dashboardtile"."team_id",
+ "posthog_dashboardtile"."layouts",
+ "posthog_dashboardtile"."color",
+ "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: TestInsight.test_listing_insights_does_not_nplus1.190
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -4920,49 +4563,136 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.39
+# name: TestInsight.test_listing_insights_does_not_nplus1.2
'''
- 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"
- FROM "posthog_organizationmembership"
- WHERE "posthog_organizationmembership"."user_id" = 99999
+ SELECT "posthog_team"."id" AS "id"
+ FROM "posthog_team"
+ WHERE ("posthog_team"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_team"."receive_org_level_activity_logs")
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.4
+# name: TestInsight.test_listing_insights_does_not_nplus1.20
'''
- 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",
+ 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: TestInsight.test_listing_insights_does_not_nplus1.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: TestInsight.test_listing_insights_does_not_nplus1.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: TestInsight.test_listing_insights_does_not_nplus1.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",
+ "customer_analytics_teamcustomeranalyticsconfig"."properties"
+ FROM "customer_analytics_teamcustomeranalyticsconfig"
+ WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.24
+ '''
+ SELECT "customer_analytics_teamcustomeranalyticsconfig"."account_group_type_index" AS "account_group_type_index"
+ FROM "customer_analytics_teamcustomeranalyticsconfig"
+ WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
+ ORDER BY "customer_analytics_teamcustomeranalyticsconfig"."team_id" ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.25
+ '''
+ 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: TestInsight.test_listing_insights_does_not_nplus1.26
+ '''
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_dashboarditem"
+ WHERE NOT ("posthog_dashboarditem"."deleted")
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.27
+ '''
+ 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",
@@ -4973,13 +4703,611 @@
"posthog_user"."onboarding_delegated_to_organization_id",
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
- "posthog_user"."email_opt_in"
+ "posthog_user"."email_opt_in",
+ "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_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
WHERE ("posthog_user"."is_active"
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.40
+# name: TestInsight.test_listing_insights_does_not_nplus1.28
+ '''
+ 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"."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: TestInsight.test_listing_insights_does_not_nplus1.29
+ '''
+ 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.3
+ '''
+ 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" = 'dashboard'
+ AND NOT ("posthog_filesystem"."shortcut"
+ AND "posthog_filesystem"."shortcut" IS NOT NULL))
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.30
+ '''
+ 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: TestInsight.test_listing_insights_does_not_nplus1.31
+ '''
+ 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: TestInsight.test_listing_insights_does_not_nplus1.32
+ '''
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_dashboarditem"
+ INNER JOIN "posthog_team" ON ("posthog_dashboarditem"."team_id" = "posthog_team"."id")
+ WHERE ("posthog_team"."project_id" = 99999
+ AND NOT ("posthog_dashboarditem"."deleted"))
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.33
+ '''
+ SELECT "posthog_dashboarditem"."id",
+ "posthog_dashboarditem"."name",
+ "posthog_dashboarditem"."derived_name",
+ "posthog_dashboarditem"."description",
+ "posthog_dashboarditem"."team_id",
+ "posthog_dashboarditem"."filters",
+ "posthog_dashboarditem"."filters_hash",
+ "posthog_dashboarditem"."query",
+ "posthog_dashboarditem"."query_metadata",
+ "posthog_dashboarditem"."order",
+ "posthog_dashboarditem"."deleted",
+ "posthog_dashboarditem"."saved",
+ "posthog_dashboarditem"."created_at",
+ "posthog_dashboarditem"."refreshing",
+ "posthog_dashboarditem"."created_by_id",
+ "posthog_dashboarditem"."is_sample",
+ "posthog_dashboarditem"."short_id",
+ "posthog_dashboarditem"."favorited",
+ "posthog_dashboarditem"."refresh_attempt",
+ "posthog_dashboarditem"."last_modified_at",
+ "posthog_dashboarditem"."last_modified_by_id",
+ "posthog_dashboarditem"."dashboard_id",
+ "posthog_dashboarditem"."last_refresh",
+ "posthog_dashboarditem"."layouts",
+ "posthog_dashboarditem"."color",
+ "posthog_dashboarditem"."dive_dashboard_id",
+ "posthog_dashboarditem"."updated_at",
+ "posthog_dashboarditem"."deprecated_tags",
+ "posthog_dashboarditem"."tags",
+
+ (SELECT "U0"."last_viewed_at" AS "last_viewed_at"
+ FROM "posthog_insightviewed" "U0"
+ WHERE "U0"."insight_id" = ("posthog_dashboarditem"."id")
+ ORDER BY 1 DESC
+ LIMIT 1) AS "last_viewed_at",
+ "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"."session_recording_retention_period_days",
+ "posthog_team"."plugins_opt_in",
+ "posthog_team"."opt_out_capture",
+ "posthog_team"."event_names",
+ "posthog_team"."event_names_with_usage",
+ "posthog_team"."event_properties",
+ "posthog_team"."event_properties_with_usage",
+ "posthog_team"."event_properties_numerical",
+ "posthog_team"."external_data_workspace_id",
+ "posthog_team"."external_data_workspace_last_synced_at",
+ "posthog_team"."api_query_rate_limit",
+ "posthog_team"."revenue_tracking_config",
+ "posthog_team"."drop_events_older_than",
+ "posthog_team"."base_currency",
+ "posthog_team"."business_model",
+ "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_password_reset_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_dashboarditem"
+ INNER JOIN "posthog_team" ON ("posthog_dashboarditem"."team_id" = "posthog_team"."id")
+ LEFT OUTER JOIN "posthog_user" ON ("posthog_dashboarditem"."created_by_id" = "posthog_user"."id")
+ WHERE ("posthog_team"."project_id" = 99999
+ AND NOT ("posthog_dashboarditem"."deleted"))
+ ORDER BY "posthog_dashboarditem"."last_modified_at" DESC,
+ "posthog_dashboarditem"."id" DESC
+ LIMIT 100
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.34
+ '''
+ SELECT "posthog_dashboardtile"."id",
+ "posthog_dashboardtile"."dashboard_id",
+ "posthog_dashboardtile"."insight_id",
+ "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" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.35
+ '''
+ SELECT "posthog_taggeditem"."id",
+ "posthog_taggeditem"."tag_id",
+ "posthog_taggeditem"."content_type_id",
+ "posthog_taggeditem"."object_id",
+ "posthog_taggeditem"."object_uuid",
+ "posthog_taggeditem"."team_id"
+ FROM "posthog_taggeditem"
+ WHERE ("posthog_taggeditem"."content_type_id" = 99999
+ AND "posthog_taggeditem"."object_id" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.36
+ '''
+ SELECT "posthog_taggeditem"."id",
+ "posthog_taggeditem"."tag_id",
+ "posthog_taggeditem"."content_type_id",
+ "posthog_taggeditem"."object_id",
+ "posthog_taggeditem"."object_uuid",
+ "posthog_taggeditem"."team_id",
+ "posthog_tag"."id",
+ "posthog_tag"."name",
+ "posthog_tag"."team_id"
+ 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" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.37
+ '''
+ 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"
+ FROM "posthog_organizationmembership"
+ WHERE "posthog_organizationmembership"."user_id" = 99999
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.38
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -4993,7 +5321,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.41
+# name: TestInsight.test_listing_insights_does_not_nplus1.39
'''
SELECT "posthog_team"."id" AS "id"
FROM "posthog_team"
@@ -5001,7 +5329,93 @@
AND "posthog_team"."receive_org_level_activity_logs")
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.42
+# name: TestInsight.test_listing_insights_does_not_nplus1.4
+ '''
+ 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",
+ "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_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.40
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -5026,7 +5440,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.43
+# name: TestInsight.test_listing_insights_does_not_nplus1.41
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -5066,15 +5480,8 @@
"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: TestInsight.test_listing_insights_does_not_nplus1.44
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -5113,12 +5520,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.45
+# name: TestInsight.test_listing_insights_does_not_nplus1.42
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -5256,7 +5664,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.46
+# name: TestInsight.test_listing_insights_does_not_nplus1.43
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -5311,7 +5719,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.47
+# name: TestInsight.test_listing_insights_does_not_nplus1.44
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -5334,7 +5742,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.48
+# name: TestInsight.test_listing_insights_does_not_nplus1.45
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -5387,7 +5795,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.49
+# name: TestInsight.test_listing_insights_does_not_nplus1.46
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -5407,9 +5815,158 @@
5 /* ... */))
'''
# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.47
+ '''
+ SELECT "posthog_dashboard"."id" AS "id",
+ "posthog_dashboard"."name" AS "name"
+ 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.48
+ '''
+ 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"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL))
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.49
+ '''
+ 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"."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.5
'''
- SELECT "posthog_organization"."id",
+ 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"."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",
@@ -5448,70 +6005,13 @@
"posthog_organization"."personalization",
"posthog_organization"."domain_whitelist",
"posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ FROM "posthog_team"
+ INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
+ WHERE "posthog_team"."id" = 99999
LIMIT 21
'''
# ---
# name: TestInsight.test_listing_insights_does_not_nplus1.50
- '''
- SELECT "posthog_dashboard"."id" AS "id",
- "posthog_dashboard"."name" AS "name"
- 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.51
- '''
- 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"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL))
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.52
- '''
- 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"."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.53
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -5609,7 +6109,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.54
+# name: TestInsight.test_listing_insights_does_not_nplus1.51
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -5655,7 +6155,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.55
+# name: TestInsight.test_listing_insights_does_not_nplus1.52
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -5753,7 +6253,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.56
+# name: TestInsight.test_listing_insights_does_not_nplus1.53
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -5778,7 +6278,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.57
+# name: TestInsight.test_listing_insights_does_not_nplus1.54
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -5796,7 +6296,7 @@
UPDATE
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.58
+# name: TestInsight.test_listing_insights_does_not_nplus1.55
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -5825,7 +6325,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.59
+# name: TestInsight.test_listing_insights_does_not_nplus1.56
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -5854,145 +6354,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.6
- '''
- 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"."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: TestInsight.test_listing_insights_does_not_nplus1.60
+# name: TestInsight.test_listing_insights_does_not_nplus1.57
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -6012,7 +6374,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.61
+# name: TestInsight.test_listing_insights_does_not_nplus1.58
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -6025,7 +6387,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.62
+# name: TestInsight.test_listing_insights_does_not_nplus1.59
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -6041,7 +6403,62 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.63
+# name: TestInsight.test_listing_insights_does_not_nplus1.6
+ '''
+ 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.60
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -6059,7 +6476,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.64
+# name: TestInsight.test_listing_insights_does_not_nplus1.61
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -6068,14 +6485,14 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.65
+# name: TestInsight.test_listing_insights_does_not_nplus1.62
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboarditem"
WHERE NOT ("posthog_dashboarditem"."deleted")
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.66
+# name: TestInsight.test_listing_insights_does_not_nplus1.63
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -6115,15 +6532,8 @@
"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: TestInsight.test_listing_insights_does_not_nplus1.67
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -6162,12 +6572,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.68
+# name: TestInsight.test_listing_insights_does_not_nplus1.64
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -6305,62 +6716,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.69
- '''
- 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.7
+# name: TestInsight.test_listing_insights_does_not_nplus1.65
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -6415,7 +6771,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.70
+# name: TestInsight.test_listing_insights_does_not_nplus1.66
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -6438,7 +6794,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.71
+# name: TestInsight.test_listing_insights_does_not_nplus1.67
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -6491,7 +6847,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.72
+# name: TestInsight.test_listing_insights_does_not_nplus1.68
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboarditem"
@@ -6500,7 +6856,7 @@
AND NOT ("posthog_dashboarditem"."deleted"))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.73
+# name: TestInsight.test_listing_insights_does_not_nplus1.69
'''
SELECT "posthog_dashboarditem"."id",
"posthog_dashboarditem"."name",
@@ -6686,7 +7042,30 @@
LIMIT 100
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.74
+# name: TestInsight.test_listing_insights_does_not_nplus1.7
+ '''
+ 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: TestInsight.test_listing_insights_does_not_nplus1.70
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -6704,7 +7083,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.75
+# name: TestInsight.test_listing_insights_does_not_nplus1.71
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -6721,7 +7100,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.76
+# name: TestInsight.test_listing_insights_does_not_nplus1.72
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -6742,7 +7121,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.77
+# name: TestInsight.test_listing_insights_does_not_nplus1.73
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -6755,7 +7134,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.78
+# name: TestInsight.test_listing_insights_does_not_nplus1.74
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -6769,7 +7148,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.79
+# name: TestInsight.test_listing_insights_does_not_nplus1.75
'''
SELECT "posthog_team"."id" AS "id"
FROM "posthog_team"
@@ -6777,30 +7156,7 @@
AND "posthog_team"."receive_org_level_activity_logs")
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.8
- '''
- 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: TestInsight.test_listing_insights_does_not_nplus1.80
+# name: TestInsight.test_listing_insights_does_not_nplus1.76
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -6825,7 +7181,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.81
+# name: TestInsight.test_listing_insights_does_not_nplus1.77
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -6865,15 +7221,8 @@
"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: TestInsight.test_listing_insights_does_not_nplus1.82
- '''
- SELECT "posthog_organization"."id",
+ "posthog_user"."email_opt_in",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -6912,12 +7261,13 @@
"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
+ FROM "posthog_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.83
+# name: TestInsight.test_listing_insights_does_not_nplus1.78
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -7049,13 +7399,68 @@
"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
+ FROM "posthog_team"
+ INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
+ WHERE "posthog_team"."id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.79
+ '''
+ 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.84
+# name: TestInsight.test_listing_insights_does_not_nplus1.8
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -7105,12 +7510,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: TestInsight.test_listing_insights_does_not_nplus1.85
+# name: TestInsight.test_listing_insights_does_not_nplus1.80
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -7133,7 +7536,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.86
+# name: TestInsight.test_listing_insights_does_not_nplus1.81
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -7186,7 +7589,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.87
+# name: TestInsight.test_listing_insights_does_not_nplus1.82
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -7206,7 +7609,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.88
+# name: TestInsight.test_listing_insights_does_not_nplus1.83
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -7219,7 +7622,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.89
+# name: TestInsight.test_listing_insights_does_not_nplus1.84
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -7232,60 +7635,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.9
- '''
- 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: TestInsight.test_listing_insights_does_not_nplus1.90
+# name: TestInsight.test_listing_insights_does_not_nplus1.85
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -7317,7 +7667,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.91
+# name: TestInsight.test_listing_insights_does_not_nplus1.86
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -7415,7 +7765,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.92
+# name: TestInsight.test_listing_insights_does_not_nplus1.87
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -7461,7 +7811,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.93
+# name: TestInsight.test_listing_insights_does_not_nplus1.88
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -7559,7 +7909,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.94
+# name: TestInsight.test_listing_insights_does_not_nplus1.89
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -7584,7 +7934,27 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.95
+# name: TestInsight.test_listing_insights_does_not_nplus1.9
+ '''
+ SELECT "posthog_dashboard"."id" AS "id"
+ 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 "posthog_dashboard"."id" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.90
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -7602,7 +7972,7 @@
UPDATE
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.96
+# name: TestInsight.test_listing_insights_does_not_nplus1.91
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -7631,7 +8001,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.97
+# name: TestInsight.test_listing_insights_does_not_nplus1.92
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -7660,7 +8030,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.98
+# name: TestInsight.test_listing_insights_does_not_nplus1.93
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -7680,7 +8050,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.99
+# name: TestInsight.test_listing_insights_does_not_nplus1.94
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -7693,3 +8063,139 @@
LIMIT 21
'''
# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.95
+ '''
+ 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.96
+ '''
+ 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",
+ "customer_analytics_teamcustomeranalyticsconfig"."properties"
+ FROM "customer_analytics_teamcustomeranalyticsconfig"
+ WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.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: TestInsight.test_listing_insights_does_not_nplus1.98
+ '''
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_dashboarditem"
+ WHERE NOT ("posthog_dashboarditem"."deleted")
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.99
+ '''
+ 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",
+ "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_user"
+ LEFT OUTER JOIN "posthog_organization" ON ("posthog_user"."current_organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
+ '''
+# ---
diff --git a/products/product_analytics/backend/tests/api/test_insight.py b/products/product_analytics/backend/tests/api/test_insight.py
index 0215dc943665..9488200f4eec 100644
--- a/products/product_analytics/backend/tests/api/test_insight.py
+++ b/products/product_analytics/backend/tests/api/test_insight.py
@@ -1168,7 +1168,7 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):
# adding more insights doesn't change the query count
self.assertEqual(
- [12, 12, 12, 12, 12],
+ [11, 11, 11, 11, 11],
query_counts,
f"received query counts\n\n{query_counts}",
)
diff --git a/products/surveys/backend/api/test/test_survey.py b/products/surveys/backend/api/test/test_survey.py
index 0d3243370007..37d6a8cce814 100644
--- a/products/surveys/backend/api/test/test_survey.py
+++ b/products/surveys/backend/api/test/test_survey.py
@@ -1603,7 +1603,7 @@ class TestSurvey(APIBaseTest):
).json()
# Includes one query for the project's replay gates
- with self.assertNumQueries(19):
+ with self.assertNumQueries(18):
response = self.client.get(f"/api/projects/{self.team.id}/feature_flags")
self.assertEqual(response.status_code, status.HTTP_200_OK)
result = response.json()