From b174f2221ea4ae50e715eb6a7e70e9a2b0760800 Mon Sep 17 00:00:00 2001 From: timgl Date: Wed, 15 Jan 2025 03:59:21 +0000 Subject: [PATCH] Revert "perf: Speed up create_hogql_database" (#27529) --- posthog/hogql/database/schema/channel_type.py | 3 - posthog/hogql/printer.py | 5 +- posthog/hogql/query.py | 3 - .../test_session_recordings.ambr | 5004 +++++++++-------- 4 files changed, 2507 insertions(+), 2508 deletions(-) diff --git a/posthog/hogql/database/schema/channel_type.py b/posthog/hogql/database/schema/channel_type.py index 5150c81200533..32204ed3757c6 100644 --- a/posthog/hogql/database/schema/channel_type.py +++ b/posthog/hogql/database/schema/channel_type.py @@ -1,7 +1,5 @@ from dataclasses import dataclass from typing import Optional, Union -from datetime import timedelta -from posthog.cache_utils import cache_for from posthog.hogql import ast from posthog.hogql.database.models import ExpressionField @@ -62,7 +60,6 @@ def create_initial_domain_type(name: str): ) -@cache_for(timedelta(minutes=30)) def create_initial_channel_type(name: str, custom_rules: Optional[list[CustomChannelRule]] = None): return ExpressionField( name=name, diff --git a/posthog/hogql/printer.py b/posthog/hogql/printer.py index ead58d83bf082..b9c944c19e916 100644 --- a/posthog/hogql/printer.py +++ b/posthog/hogql/printer.py @@ -113,9 +113,8 @@ def prepare_ast_for_printing( stack: Optional[list[ast.SelectQuery]] = None, settings: Optional[HogQLGlobalSettings] = None, ) -> _T_AST | None: - if context.database is None: - with context.timings.measure("create_hogql_database"): - context.database = create_hogql_database(context.team_id, context.modifiers, context.team) + with context.timings.measure("create_hogql_database"): + context.database = context.database or create_hogql_database(context.team_id, context.modifiers, context.team) context.modifiers = set_default_in_cohort_via(context.modifiers) diff --git a/posthog/hogql/query.py b/posthog/hogql/query.py index 3b239281a4145..1a556e1298b28 100644 --- a/posthog/hogql/query.py +++ b/posthog/hogql/query.py @@ -22,7 +22,6 @@ from posthog.hogql.resolver_utils import extract_select_queries from posthog.models.team import Team from posthog.clickhouse.query_tagging import tag_queries -from posthog.hogql.database.database import create_hogql_database from posthog.client import sync_execute from posthog.schema import ( HogQLQueryResponse, @@ -57,8 +56,6 @@ def execute_hogql_query( if context is None: context = HogQLContext(team_id=team.pk) - with context.timings.measure("create_hogql_database"): - context.database = create_hogql_database(team.pk, modifiers, team_arg=team) query_modifiers = create_default_modifiers_for_team(team, modifiers) debug = modifiers is not None and modifiers.debug diff --git a/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr b/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr index 2281491293169..e62c4b66a763c 100644 --- a/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr +++ b/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr @@ -880,62 +880,110 @@ # --- # name: TestSessionRecordings.test_get_session_recordings.27 ''' - SELECT "posthog_sessionrecording"."id", - "posthog_sessionrecording"."session_id", - "posthog_sessionrecording"."team_id", - "posthog_sessionrecording"."created_at", - "posthog_sessionrecording"."deleted", - "posthog_sessionrecording"."object_storage_path", - "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"."storage_version" - FROM "posthog_sessionrecording" - WHERE ("posthog_sessionrecording"."session_id" IN ('test_get_session_recordings-1', - 'test_get_session_recordings-2') - AND "posthog_sessionrecording"."team_id" = 99999) + SELECT "posthog_grouptypemapping"."id", + "posthog_grouptypemapping"."team_id", + "posthog_grouptypemapping"."project_id", + "posthog_grouptypemapping"."group_type", + "posthog_grouptypemapping"."group_type_index", + "posthog_grouptypemapping"."name_singular", + "posthog_grouptypemapping"."name_plural" + FROM "posthog_grouptypemapping" + WHERE "posthog_grouptypemapping"."project_id" = 99999 ''' # --- # name: TestSessionRecordings.test_get_session_recordings.28 ''' - SELECT "posthog_sessionrecordingviewed"."session_id" - FROM "posthog_sessionrecordingviewed" - WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999 - AND "posthog_sessionrecordingviewed"."user_id" = 99999) + SELECT "posthog_datawarehousesavedquery"."created_by_id", + "posthog_datawarehousesavedquery"."created_at", + "posthog_datawarehousesavedquery"."deleted", + "posthog_datawarehousesavedquery"."deleted_at", + "posthog_datawarehousesavedquery"."id", + "posthog_datawarehousesavedquery"."name", + "posthog_datawarehousesavedquery"."team_id", + "posthog_datawarehousesavedquery"."columns", + "posthog_datawarehousesavedquery"."external_tables", + "posthog_datawarehousesavedquery"."query", + "posthog_datawarehousesavedquery"."status", + "posthog_datawarehousesavedquery"."last_run_at", + "posthog_datawarehousesavedquery"."table_id" + FROM "posthog_datawarehousesavedquery" + WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999 + AND NOT ("posthog_datawarehousesavedquery"."deleted" + AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) ''' # --- # name: TestSessionRecordings.test_get_session_recordings.29 ''' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version", - "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_persondistinctid" - INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") - WHERE ("posthog_persondistinctid"."distinct_id" IN ('user2', - 'user_one_0') - AND "posthog_persondistinctid"."team_id" = 99999) + 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"."credential_id", + "posthog_datawarehousetable"."external_data_source_id", + "posthog_datawarehousetable"."columns", + "posthog_datawarehousetable"."row_count", + "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"."temporary_token", + "posthog_user"."distinct_id", + "posthog_user"."is_email_verified", + "posthog_user"."requested_password_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"."toolbar_mode", + "posthog_user"."hedgehog_config", + "posthog_user"."events_column_config", + "posthog_user"."email_opt_in", + "posthog_datawarehousecredential"."created_by_id", + "posthog_datawarehousecredential"."created_at", + "posthog_datawarehousecredential"."id", + "posthog_datawarehousecredential"."access_key", + "posthog_datawarehousecredential"."access_secret", + "posthog_datawarehousecredential"."team_id", + "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"."job_inputs", + "posthog_externaldatasource"."are_tables_created", + "posthog_externaldatasource"."prefix" + FROM "posthog_datawarehousetable" + LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousetable"."created_by_id" = "posthog_user"."id") + LEFT OUTER JOIN "posthog_datawarehousecredential" ON ("posthog_datawarehousetable"."credential_id" = "posthog_datawarehousecredential"."id") + 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)) ''' # --- # name: TestSessionRecordings.test_get_session_recordings.3 @@ -1629,14 +1677,6 @@ ''' # --- # name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.10 - ''' - SELECT "posthog_sessionrecordingviewed"."session_id" - FROM "posthog_sessionrecordingviewed" - WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999 - AND "posthog_sessionrecordingviewed"."user_id" = 99999) - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.100 ''' SELECT "posthog_grouptypemapping"."id", "posthog_grouptypemapping"."team_id", @@ -1649,40 +1689,191 @@ WHERE "posthog_grouptypemapping"."project_id" = 99999 ''' # --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.100 + ''' + SELECT "posthog_organizationmembership"."id", + "posthog_organizationmembership"."organization_id", + "posthog_organizationmembership"."user_id", + "posthog_organizationmembership"."level", + "posthog_organizationmembership"."joined_at", + "posthog_organizationmembership"."updated_at", + "posthog_organization"."id", + "posthog_organization"."name", + "posthog_organization"."slug", + "posthog_organization"."logo_media_id", + "posthog_organization"."created_at", + "posthog_organization"."updated_at", + "posthog_organization"."plugins_access_level", + "posthog_organization"."for_internal_metrics", + "posthog_organization"."is_member_join_email_enabled", + "posthog_organization"."enforce_2fa", + "posthog_organization"."is_hipaa", + "posthog_organization"."customer_id", + "posthog_organization"."available_product_features", + "posthog_organization"."usage", + "posthog_organization"."never_drop_data", + "posthog_organization"."customer_trust_scores", + "posthog_organization"."setup_section_2_completed", + "posthog_organization"."personalization", + "posthog_organization"."domain_whitelist" + 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.101 ''' - SELECT "posthog_datawarehousesavedquery"."created_by_id", - "posthog_datawarehousesavedquery"."created_at", - "posthog_datawarehousesavedquery"."deleted", - "posthog_datawarehousesavedquery"."deleted_at", - "posthog_datawarehousesavedquery"."id", - "posthog_datawarehousesavedquery"."name", - "posthog_datawarehousesavedquery"."team_id", - "posthog_datawarehousesavedquery"."columns", - "posthog_datawarehousesavedquery"."external_tables", - "posthog_datawarehousesavedquery"."query", - "posthog_datawarehousesavedquery"."status", - "posthog_datawarehousesavedquery"."last_run_at", - "posthog_datawarehousesavedquery"."table_id" - FROM "posthog_datawarehousesavedquery" - WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999 - AND NOT ("posthog_datawarehousesavedquery"."deleted" - AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) + 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"."resource" = 'project' + AND "ee_accesscontrol"."resource_id" = '99999' + AND "ee_accesscontrol"."role_id" IS NULL + AND "ee_accesscontrol"."team_id" = 99999) + OR ("posthog_organizationmembership"."user_id" = 99999 + AND "ee_accesscontrol"."resource" = 'project' + AND "ee_accesscontrol"."resource_id" = '99999' + AND "ee_accesscontrol"."role_id" IS NULL + AND "ee_accesscontrol"."team_id" = 99999) + OR ("ee_accesscontrol"."organization_member_id" IS NULL + AND "ee_accesscontrol"."resource" = 'session_recording' + AND "ee_accesscontrol"."resource_id" IS NULL + AND "ee_accesscontrol"."role_id" IS NULL + AND "ee_accesscontrol"."team_id" = 99999) + OR ("posthog_organizationmembership"."user_id" = 99999 + AND "ee_accesscontrol"."resource" = 'session_recording' + AND "ee_accesscontrol"."resource_id" IS NULL + AND "ee_accesscontrol"."role_id" IS NULL + AND "ee_accesscontrol"."team_id" = 99999) + OR ("ee_accesscontrol"."organization_member_id" IS NULL + AND "ee_accesscontrol"."resource" = 'session_recording' + AND "ee_accesscontrol"."resource_id" IS NOT NULL + AND "ee_accesscontrol"."role_id" IS NULL + AND "ee_accesscontrol"."team_id" = 99999) + OR ("posthog_organizationmembership"."user_id" = 99999 + AND "ee_accesscontrol"."resource" = 'session_recording' + AND "ee_accesscontrol"."resource_id" IS NOT NULL + AND "ee_accesscontrol"."role_id" IS NULL + AND "ee_accesscontrol"."team_id" = 99999)) ''' # --- # name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.102 ''' - 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"."credential_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_organization"."id", + "posthog_organization"."name", + "posthog_organization"."slug", + "posthog_organization"."logo_media_id", + "posthog_organization"."created_at", + "posthog_organization"."updated_at", + "posthog_organization"."plugins_access_level", + "posthog_organization"."for_internal_metrics", + "posthog_organization"."is_member_join_email_enabled", + "posthog_organization"."enforce_2fa", + "posthog_organization"."is_hipaa", + "posthog_organization"."customer_id", + "posthog_organization"."available_product_features", + "posthog_organization"."usage", + "posthog_organization"."never_drop_data", + "posthog_organization"."customer_trust_scores", + "posthog_organization"."setup_section_2_completed", + "posthog_organization"."personalization", + "posthog_organization"."domain_whitelist" + 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.103 + ''' + 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"."plugins_access_level", + "posthog_organization"."for_internal_metrics", + "posthog_organization"."is_member_join_email_enabled", + "posthog_organization"."enforce_2fa", + "posthog_organization"."is_hipaa", + "posthog_organization"."customer_id", + "posthog_organization"."available_product_features", + "posthog_organization"."usage", + "posthog_organization"."never_drop_data", + "posthog_organization"."customer_trust_scores", + "posthog_organization"."setup_section_2_completed", + "posthog_organization"."personalization", + "posthog_organization"."domain_whitelist" + 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.104 + ''' + SELECT "posthog_grouptypemapping"."id", + "posthog_grouptypemapping"."team_id", + "posthog_grouptypemapping"."project_id", + "posthog_grouptypemapping"."group_type", + "posthog_grouptypemapping"."group_type_index", + "posthog_grouptypemapping"."name_singular", + "posthog_grouptypemapping"."name_plural" + FROM "posthog_grouptypemapping" + WHERE "posthog_grouptypemapping"."project_id" = 99999 + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.105 + ''' + SELECT "posthog_datawarehousesavedquery"."created_by_id", + "posthog_datawarehousesavedquery"."created_at", + "posthog_datawarehousesavedquery"."deleted", + "posthog_datawarehousesavedquery"."deleted_at", + "posthog_datawarehousesavedquery"."id", + "posthog_datawarehousesavedquery"."name", + "posthog_datawarehousesavedquery"."team_id", + "posthog_datawarehousesavedquery"."columns", + "posthog_datawarehousesavedquery"."external_tables", + "posthog_datawarehousesavedquery"."query", + "posthog_datawarehousesavedquery"."status", + "posthog_datawarehousesavedquery"."last_run_at", + "posthog_datawarehousesavedquery"."table_id" + FROM "posthog_datawarehousesavedquery" + WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999 + AND NOT ("posthog_datawarehousesavedquery"."deleted" + AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.106 + ''' + 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"."credential_id", "posthog_datawarehousetable"."external_data_source_id", "posthog_datawarehousetable"."columns", "posthog_datawarehousetable"."row_count", @@ -1744,7 +1935,7 @@ AND "posthog_datawarehousetable"."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.107 ''' SELECT "posthog_datawarehousejoin"."created_by_id", "posthog_datawarehousejoin"."created_at", @@ -1764,7 +1955,156 @@ AND "posthog_datawarehousejoin"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.104 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.108 + ''' + SELECT "posthog_grouptypemapping"."id", + "posthog_grouptypemapping"."team_id", + "posthog_grouptypemapping"."project_id", + "posthog_grouptypemapping"."group_type", + "posthog_grouptypemapping"."group_type_index", + "posthog_grouptypemapping"."name_singular", + "posthog_grouptypemapping"."name_plural" + FROM "posthog_grouptypemapping" + WHERE "posthog_grouptypemapping"."project_id" = 99999 + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.109 + ''' + SELECT "posthog_datawarehousesavedquery"."created_by_id", + "posthog_datawarehousesavedquery"."created_at", + "posthog_datawarehousesavedquery"."deleted", + "posthog_datawarehousesavedquery"."deleted_at", + "posthog_datawarehousesavedquery"."id", + "posthog_datawarehousesavedquery"."name", + "posthog_datawarehousesavedquery"."team_id", + "posthog_datawarehousesavedquery"."columns", + "posthog_datawarehousesavedquery"."external_tables", + "posthog_datawarehousesavedquery"."query", + "posthog_datawarehousesavedquery"."status", + "posthog_datawarehousesavedquery"."last_run_at", + "posthog_datawarehousesavedquery"."table_id" + FROM "posthog_datawarehousesavedquery" + WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999 + AND NOT ("posthog_datawarehousesavedquery"."deleted" + AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.11 + ''' + SELECT "posthog_datawarehousesavedquery"."created_by_id", + "posthog_datawarehousesavedquery"."created_at", + "posthog_datawarehousesavedquery"."deleted", + "posthog_datawarehousesavedquery"."deleted_at", + "posthog_datawarehousesavedquery"."id", + "posthog_datawarehousesavedquery"."name", + "posthog_datawarehousesavedquery"."team_id", + "posthog_datawarehousesavedquery"."columns", + "posthog_datawarehousesavedquery"."external_tables", + "posthog_datawarehousesavedquery"."query", + "posthog_datawarehousesavedquery"."status", + "posthog_datawarehousesavedquery"."last_run_at", + "posthog_datawarehousesavedquery"."table_id" + FROM "posthog_datawarehousesavedquery" + WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999 + AND NOT ("posthog_datawarehousesavedquery"."deleted" + AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.110 + ''' + 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"."credential_id", + "posthog_datawarehousetable"."external_data_source_id", + "posthog_datawarehousetable"."columns", + "posthog_datawarehousetable"."row_count", + "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"."temporary_token", + "posthog_user"."distinct_id", + "posthog_user"."is_email_verified", + "posthog_user"."requested_password_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"."toolbar_mode", + "posthog_user"."hedgehog_config", + "posthog_user"."events_column_config", + "posthog_user"."email_opt_in", + "posthog_datawarehousecredential"."created_by_id", + "posthog_datawarehousecredential"."created_at", + "posthog_datawarehousecredential"."id", + "posthog_datawarehousecredential"."access_key", + "posthog_datawarehousecredential"."access_secret", + "posthog_datawarehousecredential"."team_id", + "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"."job_inputs", + "posthog_externaldatasource"."are_tables_created", + "posthog_externaldatasource"."prefix" + FROM "posthog_datawarehousetable" + LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousetable"."created_by_id" = "posthog_user"."id") + LEFT OUTER JOIN "posthog_datawarehousecredential" ON ("posthog_datawarehousetable"."credential_id" = "posthog_datawarehousecredential"."id") + 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)) + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.111 + ''' + 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.112 ''' SELECT "posthog_sessionrecording"."id", "posthog_sessionrecording"."session_id", @@ -1791,12 +2131,11 @@ '2', '3', '4', - '5', - '6') + '5') AND "posthog_sessionrecording"."team_id" = 99999) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.105 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.113 ''' SELECT "posthog_sessionrecordingviewed"."session_id" FROM "posthog_sessionrecordingviewed" @@ -1804,7 +2143,7 @@ AND "posthog_sessionrecordingviewed"."user_id" = 99999) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.106 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.114 ''' SELECT "posthog_persondistinctid"."id", "posthog_persondistinctid"."team_id", @@ -1827,12 +2166,11 @@ 'user2', 'user3', 'user4', - 'user5', - 'user6') + 'user5') AND "posthog_persondistinctid"."team_id" = 99999) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.107 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.115 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1905,7 +2243,7 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.108 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.116 ''' SELECT "posthog_person"."id", "posthog_person"."created_at", @@ -1919,12 +2257,12 @@ "posthog_person"."version" FROM "posthog_person" INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user7' + WHERE ("posthog_persondistinctid"."distinct_id" = 'user6' AND "posthog_persondistinctid"."team_id" = 99999) LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.109 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.117 ''' SELECT "posthog_person"."id", "posthog_person"."created_at", @@ -1938,85 +2276,12 @@ "posthog_person"."version" FROM "posthog_person" INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user7' + WHERE ("posthog_persondistinctid"."distinct_id" = 'user6' AND "posthog_persondistinctid"."team_id" = 99999) LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.11 - ''' - SELECT "posthog_team"."id", - "posthog_team"."uuid", - "posthog_team"."organization_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"."ingested_event", - "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"."person_processing_opt_out", - "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_url_trigger_config", - "posthog_team"."session_recording_url_blocklist_config", - "posthog_team"."session_recording_event_trigger_config", - "posthog_team"."session_replay_config", - "posthog_team"."survey_config", - "posthog_team"."capture_console_log_opt_in", - "posthog_team"."capture_performance_opt_in", - "posthog_team"."capture_dead_clicks", - "posthog_team"."surveys_opt_in", - "posthog_team"."heatmaps_opt_in", - "posthog_team"."session_recording_version", - "posthog_team"."signup_token", - "posthog_team"."is_demo", - "posthog_team"."access_control", - "posthog_team"."week_start_day", - "posthog_team"."inject_web_apps", - "posthog_team"."test_account_filters", - "posthog_team"."test_account_filters_default_checked", - "posthog_team"."path_cleaning_filters", - "posthog_team"."timezone", - "posthog_team"."data_attributes", - "posthog_team"."person_display_name_properties", - "posthog_team"."live_events_columns", - "posthog_team"."recording_domains", - "posthog_team"."human_friendly_comparison_periods", - "posthog_team"."cookieless_server_hash_mode", - "posthog_team"."primary_dashboard_id", - "posthog_team"."default_data_theme", - "posthog_team"."extra_settings", - "posthog_team"."modifiers", - "posthog_team"."correlation_config", - "posthog_team"."session_recording_retention_period_days", - "posthog_team"."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" - FROM "posthog_team" - WHERE "posthog_team"."id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.110 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.118 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -2049,7 +2314,7 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.111 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.119 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -2115,7 +2380,81 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.112 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.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"."credential_id", + "posthog_datawarehousetable"."external_data_source_id", + "posthog_datawarehousetable"."columns", + "posthog_datawarehousetable"."row_count", + "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"."temporary_token", + "posthog_user"."distinct_id", + "posthog_user"."is_email_verified", + "posthog_user"."requested_password_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"."toolbar_mode", + "posthog_user"."hedgehog_config", + "posthog_user"."events_column_config", + "posthog_user"."email_opt_in", + "posthog_datawarehousecredential"."created_by_id", + "posthog_datawarehousecredential"."created_at", + "posthog_datawarehousecredential"."id", + "posthog_datawarehousecredential"."access_key", + "posthog_datawarehousecredential"."access_secret", + "posthog_datawarehousecredential"."team_id", + "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"."job_inputs", + "posthog_externaldatasource"."are_tables_created", + "posthog_externaldatasource"."prefix" + FROM "posthog_datawarehousetable" + LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousetable"."created_by_id" = "posthog_user"."id") + LEFT OUTER JOIN "posthog_datawarehousecredential" ON ("posthog_datawarehousetable"."credential_id" = "posthog_datawarehousecredential"."id") + 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)) + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.120 ''' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -2149,7 +2488,7 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.113 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.121 ''' SELECT "ee_accesscontrol"."id", "ee_accesscontrol"."team_id", @@ -2195,7 +2534,7 @@ AND "ee_accesscontrol"."team_id" = 99999)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.114 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.122 ''' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -2227,7 +2566,7 @@ WHERE "posthog_organizationmembership"."user_id" = 99999 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.115 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.123 ''' SELECT "posthog_organization"."id", "posthog_organization"."name", @@ -2253,7 +2592,7 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.116 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.124 ''' SELECT "posthog_grouptypemapping"."id", "posthog_grouptypemapping"."team_id", @@ -2266,7 +2605,7 @@ WHERE "posthog_grouptypemapping"."project_id" = 99999 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.117 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.125 ''' SELECT "posthog_datawarehousesavedquery"."created_by_id", "posthog_datawarehousesavedquery"."created_at", @@ -2287,7 +2626,7 @@ AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.118 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.126 ''' SELECT "posthog_datawarehousetable"."created_by_id", "posthog_datawarehousetable"."created_at", @@ -2361,7 +2700,7 @@ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.119 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.127 ''' SELECT "posthog_datawarehousejoin"."created_by_id", "posthog_datawarehousejoin"."created_at", @@ -2381,67 +2720,195 @@ AND "posthog_datawarehousejoin"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.12 - ''' - SELECT "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_person" - INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user1' - AND "posthog_persondistinctid"."team_id" = 99999) - LIMIT 21 - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.120 - ''' - SELECT "posthog_sessionrecording"."id", - "posthog_sessionrecording"."session_id", - "posthog_sessionrecording"."team_id", - "posthog_sessionrecording"."created_at", - "posthog_sessionrecording"."deleted", - "posthog_sessionrecording"."object_storage_path", - "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"."storage_version" - FROM "posthog_sessionrecording" - WHERE ("posthog_sessionrecording"."session_id" IN ('1', - '2', - '3', - '4', - '5', - '6', - '7') - AND "posthog_sessionrecording"."team_id" = 99999) - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.121 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.128 ''' - SELECT "posthog_sessionrecordingviewed"."session_id" - FROM "posthog_sessionrecordingviewed" - WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999 - AND "posthog_sessionrecordingviewed"."user_id" = 99999) + SELECT "posthog_grouptypemapping"."id", + "posthog_grouptypemapping"."team_id", + "posthog_grouptypemapping"."project_id", + "posthog_grouptypemapping"."group_type", + "posthog_grouptypemapping"."group_type_index", + "posthog_grouptypemapping"."name_singular", + "posthog_grouptypemapping"."name_plural" + FROM "posthog_grouptypemapping" + WHERE "posthog_grouptypemapping"."project_id" = 99999 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.122 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.129 + ''' + SELECT "posthog_datawarehousesavedquery"."created_by_id", + "posthog_datawarehousesavedquery"."created_at", + "posthog_datawarehousesavedquery"."deleted", + "posthog_datawarehousesavedquery"."deleted_at", + "posthog_datawarehousesavedquery"."id", + "posthog_datawarehousesavedquery"."name", + "posthog_datawarehousesavedquery"."team_id", + "posthog_datawarehousesavedquery"."columns", + "posthog_datawarehousesavedquery"."external_tables", + "posthog_datawarehousesavedquery"."query", + "posthog_datawarehousesavedquery"."status", + "posthog_datawarehousesavedquery"."last_run_at", + "posthog_datawarehousesavedquery"."table_id" + FROM "posthog_datawarehousesavedquery" + WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999 + AND NOT ("posthog_datawarehousesavedquery"."deleted" + AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.13 + ''' + 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.130 + ''' + 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"."credential_id", + "posthog_datawarehousetable"."external_data_source_id", + "posthog_datawarehousetable"."columns", + "posthog_datawarehousetable"."row_count", + "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"."temporary_token", + "posthog_user"."distinct_id", + "posthog_user"."is_email_verified", + "posthog_user"."requested_password_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"."toolbar_mode", + "posthog_user"."hedgehog_config", + "posthog_user"."events_column_config", + "posthog_user"."email_opt_in", + "posthog_datawarehousecredential"."created_by_id", + "posthog_datawarehousecredential"."created_at", + "posthog_datawarehousecredential"."id", + "posthog_datawarehousecredential"."access_key", + "posthog_datawarehousecredential"."access_secret", + "posthog_datawarehousecredential"."team_id", + "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"."job_inputs", + "posthog_externaldatasource"."are_tables_created", + "posthog_externaldatasource"."prefix" + FROM "posthog_datawarehousetable" + LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousetable"."created_by_id" = "posthog_user"."id") + LEFT OUTER JOIN "posthog_datawarehousecredential" ON ("posthog_datawarehousetable"."credential_id" = "posthog_datawarehousecredential"."id") + 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)) + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.131 + ''' + 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.132 + ''' + SELECT "posthog_sessionrecording"."id", + "posthog_sessionrecording"."session_id", + "posthog_sessionrecording"."team_id", + "posthog_sessionrecording"."created_at", + "posthog_sessionrecording"."deleted", + "posthog_sessionrecording"."object_storage_path", + "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"."storage_version" + FROM "posthog_sessionrecording" + WHERE ("posthog_sessionrecording"."session_id" IN ('1', + '2', + '3', + '4', + '5', + '6') + AND "posthog_sessionrecording"."team_id" = 99999) + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.133 + ''' + SELECT "posthog_sessionrecordingviewed"."session_id" + FROM "posthog_sessionrecordingviewed" + WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999 + AND "posthog_sessionrecordingviewed"."user_id" = 99999) + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.134 ''' SELECT "posthog_persondistinctid"."id", "posthog_persondistinctid"."team_id", @@ -2465,12 +2932,11 @@ 'user3', 'user4', 'user5', - 'user6', - 'user7') + 'user6') AND "posthog_persondistinctid"."team_id" = 99999) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.123 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.135 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -2543,7 +3009,7 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.124 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.136 ''' SELECT "posthog_person"."id", "posthog_person"."created_at", @@ -2557,12 +3023,12 @@ "posthog_person"."version" FROM "posthog_person" INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user8' + WHERE ("posthog_persondistinctid"."distinct_id" = 'user7' AND "posthog_persondistinctid"."team_id" = 99999) LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.125 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.137 ''' SELECT "posthog_person"."id", "posthog_person"."created_at", @@ -2576,12 +3042,12 @@ "posthog_person"."version" FROM "posthog_person" INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user8' + WHERE ("posthog_persondistinctid"."distinct_id" = 'user7' AND "posthog_persondistinctid"."team_id" = 99999) LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.126 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.138 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -2614,7 +3080,7 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.127 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.139 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -2680,7 +3146,15 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.128 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.14 + ''' + SELECT "posthog_sessionrecordingviewed"."session_id" + FROM "posthog_sessionrecordingviewed" + WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999 + AND "posthog_sessionrecordingviewed"."user_id" = 99999) + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.140 ''' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -2714,7 +3188,7 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.129 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.141 ''' SELECT "ee_accesscontrol"."id", "ee_accesscontrol"."team_id", @@ -2760,26 +3234,7 @@ AND "ee_accesscontrol"."team_id" = 99999)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.13 - ''' - SELECT "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_person" - INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user1' - AND "posthog_persondistinctid"."team_id" = 99999) - LIMIT 21 - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.130 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.142 ''' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -2811,7 +3266,7 @@ WHERE "posthog_organizationmembership"."user_id" = 99999 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.131 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.143 ''' SELECT "posthog_organization"."id", "posthog_organization"."name", @@ -2837,7 +3292,7 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.132 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.144 ''' SELECT "posthog_grouptypemapping"."id", "posthog_grouptypemapping"."team_id", @@ -2850,7 +3305,7 @@ WHERE "posthog_grouptypemapping"."project_id" = 99999 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.133 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.145 ''' SELECT "posthog_datawarehousesavedquery"."created_by_id", "posthog_datawarehousesavedquery"."created_at", @@ -2871,7 +3326,7 @@ AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.134 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.146 ''' SELECT "posthog_datawarehousetable"."created_by_id", "posthog_datawarehousetable"."created_at", @@ -2945,7 +3400,7 @@ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.135 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.147 ''' SELECT "posthog_datawarehousejoin"."created_by_id", "posthog_datawarehousejoin"."created_at", @@ -2965,79 +3420,41 @@ AND "posthog_datawarehousejoin"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.136 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.148 ''' - SELECT "posthog_sessionrecording"."id", - "posthog_sessionrecording"."session_id", - "posthog_sessionrecording"."team_id", - "posthog_sessionrecording"."created_at", - "posthog_sessionrecording"."deleted", - "posthog_sessionrecording"."object_storage_path", - "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"."storage_version" - FROM "posthog_sessionrecording" - WHERE ("posthog_sessionrecording"."session_id" IN ('1', - '2', - '3', - '4', - '5', - '6', - '7', - '8') - AND "posthog_sessionrecording"."team_id" = 99999) - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.137 - ''' - SELECT "posthog_sessionrecordingviewed"."session_id" - FROM "posthog_sessionrecordingviewed" - WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999 - AND "posthog_sessionrecordingviewed"."user_id" = 99999) + SELECT "posthog_grouptypemapping"."id", + "posthog_grouptypemapping"."team_id", + "posthog_grouptypemapping"."project_id", + "posthog_grouptypemapping"."group_type", + "posthog_grouptypemapping"."group_type_index", + "posthog_grouptypemapping"."name_singular", + "posthog_grouptypemapping"."name_plural" + FROM "posthog_grouptypemapping" + WHERE "posthog_grouptypemapping"."project_id" = 99999 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.138 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.149 ''' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version", - "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_persondistinctid" - INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") - WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1', - 'user2', - 'user3', - 'user4', - 'user5', - 'user6', - 'user7', - 'user8') - AND "posthog_persondistinctid"."team_id" = 99999) + SELECT "posthog_datawarehousesavedquery"."created_by_id", + "posthog_datawarehousesavedquery"."created_at", + "posthog_datawarehousesavedquery"."deleted", + "posthog_datawarehousesavedquery"."deleted_at", + "posthog_datawarehousesavedquery"."id", + "posthog_datawarehousesavedquery"."name", + "posthog_datawarehousesavedquery"."team_id", + "posthog_datawarehousesavedquery"."columns", + "posthog_datawarehousesavedquery"."external_tables", + "posthog_datawarehousesavedquery"."query", + "posthog_datawarehousesavedquery"."status", + "posthog_datawarehousesavedquery"."last_run_at", + "posthog_datawarehousesavedquery"."table_id" + FROM "posthog_datawarehousesavedquery" + WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999 + AND NOT ("posthog_datawarehousesavedquery"."deleted" + AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.139 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.15 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -3110,9 +3527,23 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.14 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.150 ''' - SELECT "posthog_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"."credential_id", + "posthog_datawarehousetable"."external_data_source_id", + "posthog_datawarehousetable"."columns", + "posthog_datawarehousetable"."row_count", + "posthog_user"."id", "posthog_user"."password", "posthog_user"."last_login", "posthog_user"."first_name", @@ -3127,6 +3558,7 @@ "posthog_user"."temporary_token", "posthog_user"."distinct_id", "posthog_user"."is_email_verified", + "posthog_user"."requested_password_reset_at", "posthog_user"."has_seen_product_intro_for", "posthog_user"."strapi_id", "posthog_user"."is_active", @@ -3137,34 +3569,107 @@ "posthog_user"."toolbar_mode", "posthog_user"."hedgehog_config", "posthog_user"."events_column_config", - "posthog_user"."email_opt_in" - FROM "posthog_user" - WHERE "posthog_user"."id" = 99999 - LIMIT 21 + "posthog_user"."email_opt_in", + "posthog_datawarehousecredential"."created_by_id", + "posthog_datawarehousecredential"."created_at", + "posthog_datawarehousecredential"."id", + "posthog_datawarehousecredential"."access_key", + "posthog_datawarehousecredential"."access_secret", + "posthog_datawarehousecredential"."team_id", + "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"."job_inputs", + "posthog_externaldatasource"."are_tables_created", + "posthog_externaldatasource"."prefix" + FROM "posthog_datawarehousetable" + LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousetable"."created_by_id" = "posthog_user"."id") + LEFT OUTER JOIN "posthog_datawarehousecredential" ON ("posthog_datawarehousetable"."credential_id" = "posthog_datawarehousecredential"."id") + 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)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.140 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.151 ''' - SELECT "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_person" - INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user9' - AND "posthog_persondistinctid"."team_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.141 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.152 ''' - SELECT "posthog_person"."id", + SELECT "posthog_sessionrecording"."id", + "posthog_sessionrecording"."session_id", + "posthog_sessionrecording"."team_id", + "posthog_sessionrecording"."created_at", + "posthog_sessionrecording"."deleted", + "posthog_sessionrecording"."object_storage_path", + "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"."storage_version" + FROM "posthog_sessionrecording" + WHERE ("posthog_sessionrecording"."session_id" IN ('1', + '2', + '3', + '4', + '5', + '6', + '7') + AND "posthog_sessionrecording"."team_id" = 99999) + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.153 + ''' + SELECT "posthog_sessionrecordingviewed"."session_id" + FROM "posthog_sessionrecordingviewed" + WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999 + AND "posthog_sessionrecordingviewed"."user_id" = 99999) + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.154 + ''' + SELECT "posthog_persondistinctid"."id", + "posthog_persondistinctid"."team_id", + "posthog_persondistinctid"."person_id", + "posthog_persondistinctid"."distinct_id", + "posthog_persondistinctid"."version", + "posthog_person"."id", "posthog_person"."created_at", "posthog_person"."properties_last_updated_at", "posthog_person"."properties_last_operation", @@ -3174,47 +3679,163 @@ "posthog_person"."is_identified", "posthog_person"."uuid", "posthog_person"."version" - FROM "posthog_person" - INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user9' + FROM "posthog_persondistinctid" + INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") + WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1', + 'user2', + 'user3', + 'user4', + 'user5', + 'user6', + 'user7') AND "posthog_persondistinctid"."team_id" = 99999) - LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.142 - ''' - 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"."temporary_token", - "posthog_user"."distinct_id", - "posthog_user"."is_email_verified", - "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"."toolbar_mode", - "posthog_user"."hedgehog_config", - "posthog_user"."events_column_config", - "posthog_user"."email_opt_in" - FROM "posthog_user" - WHERE "posthog_user"."id" = 99999 - LIMIT 21 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.155 + ''' + SELECT "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_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"."ingested_event", + "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"."person_processing_opt_out", + "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_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."human_friendly_comparison_periods", + "posthog_team"."cookieless_server_hash_mode", + "posthog_team"."primary_dashboard_id", + "posthog_team"."default_data_theme", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."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" + FROM "posthog_team" + WHERE "posthog_team"."id" = 99999 + LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.143 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.156 + ''' + SELECT "posthog_person"."id", + "posthog_person"."created_at", + "posthog_person"."properties_last_updated_at", + "posthog_person"."properties_last_operation", + "posthog_person"."team_id", + "posthog_person"."properties", + "posthog_person"."is_user_id", + "posthog_person"."is_identified", + "posthog_person"."uuid", + "posthog_person"."version" + FROM "posthog_person" + INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") + WHERE ("posthog_persondistinctid"."distinct_id" = 'user8' + AND "posthog_persondistinctid"."team_id" = 99999) + LIMIT 21 + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.157 + ''' + SELECT "posthog_person"."id", + "posthog_person"."created_at", + "posthog_person"."properties_last_updated_at", + "posthog_person"."properties_last_operation", + "posthog_person"."team_id", + "posthog_person"."properties", + "posthog_person"."is_user_id", + "posthog_person"."is_identified", + "posthog_person"."uuid", + "posthog_person"."version" + FROM "posthog_person" + INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") + WHERE ("posthog_persondistinctid"."distinct_id" = 'user8' + AND "posthog_persondistinctid"."team_id" = 99999) + LIMIT 21 + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.158 + ''' + 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"."temporary_token", + "posthog_user"."distinct_id", + "posthog_user"."is_email_verified", + "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"."toolbar_mode", + "posthog_user"."hedgehog_config", + "posthog_user"."events_column_config", + "posthog_user"."email_opt_in" + FROM "posthog_user" + WHERE "posthog_user"."id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.159 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -3280,7 +3901,26 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.144 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.16 + ''' + SELECT "posthog_person"."id", + "posthog_person"."created_at", + "posthog_person"."properties_last_updated_at", + "posthog_person"."properties_last_operation", + "posthog_person"."team_id", + "posthog_person"."properties", + "posthog_person"."is_user_id", + "posthog_person"."is_identified", + "posthog_person"."uuid", + "posthog_person"."version" + FROM "posthog_person" + INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") + WHERE ("posthog_persondistinctid"."distinct_id" = 'user1' + AND "posthog_persondistinctid"."team_id" = 99999) + LIMIT 21 + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.160 ''' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -3314,7 +3954,7 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.145 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.161 ''' SELECT "ee_accesscontrol"."id", "ee_accesscontrol"."team_id", @@ -3360,7 +4000,7 @@ AND "ee_accesscontrol"."team_id" = 99999)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.146 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.162 ''' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -3392,7 +4032,7 @@ WHERE "posthog_organizationmembership"."user_id" = 99999 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.147 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.163 ''' SELECT "posthog_organization"."id", "posthog_organization"."name", @@ -3418,7 +4058,7 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.148 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.164 ''' SELECT "posthog_grouptypemapping"."id", "posthog_grouptypemapping"."team_id", @@ -3431,7 +4071,7 @@ WHERE "posthog_grouptypemapping"."project_id" = 99999 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.149 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.165 ''' SELECT "posthog_datawarehousesavedquery"."created_by_id", "posthog_datawarehousesavedquery"."created_at", @@ -3452,73 +4092,7 @@ AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.15 - ''' - SELECT "posthog_team"."id", - "posthog_team"."uuid", - "posthog_team"."organization_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"."ingested_event", - "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"."person_processing_opt_out", - "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_url_trigger_config", - "posthog_team"."session_recording_url_blocklist_config", - "posthog_team"."session_recording_event_trigger_config", - "posthog_team"."session_replay_config", - "posthog_team"."survey_config", - "posthog_team"."capture_console_log_opt_in", - "posthog_team"."capture_performance_opt_in", - "posthog_team"."capture_dead_clicks", - "posthog_team"."surveys_opt_in", - "posthog_team"."heatmaps_opt_in", - "posthog_team"."session_recording_version", - "posthog_team"."signup_token", - "posthog_team"."is_demo", - "posthog_team"."access_control", - "posthog_team"."week_start_day", - "posthog_team"."inject_web_apps", - "posthog_team"."test_account_filters", - "posthog_team"."test_account_filters_default_checked", - "posthog_team"."path_cleaning_filters", - "posthog_team"."timezone", - "posthog_team"."data_attributes", - "posthog_team"."person_display_name_properties", - "posthog_team"."live_events_columns", - "posthog_team"."recording_domains", - "posthog_team"."human_friendly_comparison_periods", - "posthog_team"."cookieless_server_hash_mode", - "posthog_team"."primary_dashboard_id", - "posthog_team"."default_data_theme", - "posthog_team"."extra_settings", - "posthog_team"."modifiers", - "posthog_team"."correlation_config", - "posthog_team"."session_recording_retention_period_days", - "posthog_team"."external_data_workspace_id", - "posthog_team"."external_data_workspace_last_synced_at" - FROM "posthog_team" - 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.166 ''' SELECT "posthog_datawarehousetable"."created_by_id", "posthog_datawarehousetable"."created_at", @@ -3592,7 +4166,7 @@ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.151 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.167 ''' SELECT "posthog_datawarehousejoin"."created_by_id", "posthog_datawarehousejoin"."created_at", @@ -3612,18 +4186,165 @@ AND "posthog_datawarehousejoin"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.152 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.168 ''' - SELECT "posthog_sessionrecording"."id", - "posthog_sessionrecording"."session_id", - "posthog_sessionrecording"."team_id", - "posthog_sessionrecording"."created_at", - "posthog_sessionrecording"."deleted", - "posthog_sessionrecording"."object_storage_path", - "posthog_sessionrecording"."distinct_id", - "posthog_sessionrecording"."duration", - "posthog_sessionrecording"."active_seconds", - "posthog_sessionrecording"."inactive_seconds", + SELECT "posthog_grouptypemapping"."id", + "posthog_grouptypemapping"."team_id", + "posthog_grouptypemapping"."project_id", + "posthog_grouptypemapping"."group_type", + "posthog_grouptypemapping"."group_type_index", + "posthog_grouptypemapping"."name_singular", + "posthog_grouptypemapping"."name_plural" + FROM "posthog_grouptypemapping" + WHERE "posthog_grouptypemapping"."project_id" = 99999 + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.169 + ''' + SELECT "posthog_datawarehousesavedquery"."created_by_id", + "posthog_datawarehousesavedquery"."created_at", + "posthog_datawarehousesavedquery"."deleted", + "posthog_datawarehousesavedquery"."deleted_at", + "posthog_datawarehousesavedquery"."id", + "posthog_datawarehousesavedquery"."name", + "posthog_datawarehousesavedquery"."team_id", + "posthog_datawarehousesavedquery"."columns", + "posthog_datawarehousesavedquery"."external_tables", + "posthog_datawarehousesavedquery"."query", + "posthog_datawarehousesavedquery"."status", + "posthog_datawarehousesavedquery"."last_run_at", + "posthog_datawarehousesavedquery"."table_id" + FROM "posthog_datawarehousesavedquery" + WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999 + AND NOT ("posthog_datawarehousesavedquery"."deleted" + AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.17 + ''' + SELECT "posthog_person"."id", + "posthog_person"."created_at", + "posthog_person"."properties_last_updated_at", + "posthog_person"."properties_last_operation", + "posthog_person"."team_id", + "posthog_person"."properties", + "posthog_person"."is_user_id", + "posthog_person"."is_identified", + "posthog_person"."uuid", + "posthog_person"."version" + FROM "posthog_person" + INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") + WHERE ("posthog_persondistinctid"."distinct_id" = 'user1' + AND "posthog_persondistinctid"."team_id" = 99999) + LIMIT 21 + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.170 + ''' + 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"."credential_id", + "posthog_datawarehousetable"."external_data_source_id", + "posthog_datawarehousetable"."columns", + "posthog_datawarehousetable"."row_count", + "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"."temporary_token", + "posthog_user"."distinct_id", + "posthog_user"."is_email_verified", + "posthog_user"."requested_password_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"."toolbar_mode", + "posthog_user"."hedgehog_config", + "posthog_user"."events_column_config", + "posthog_user"."email_opt_in", + "posthog_datawarehousecredential"."created_by_id", + "posthog_datawarehousecredential"."created_at", + "posthog_datawarehousecredential"."id", + "posthog_datawarehousecredential"."access_key", + "posthog_datawarehousecredential"."access_secret", + "posthog_datawarehousecredential"."team_id", + "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"."job_inputs", + "posthog_externaldatasource"."are_tables_created", + "posthog_externaldatasource"."prefix" + FROM "posthog_datawarehousetable" + LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousetable"."created_by_id" = "posthog_user"."id") + LEFT OUTER JOIN "posthog_datawarehousecredential" ON ("posthog_datawarehousetable"."credential_id" = "posthog_datawarehousecredential"."id") + 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)) + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.171 + ''' + 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.172 + ''' + SELECT "posthog_sessionrecording"."id", + "posthog_sessionrecording"."session_id", + "posthog_sessionrecording"."team_id", + "posthog_sessionrecording"."created_at", + "posthog_sessionrecording"."deleted", + "posthog_sessionrecording"."object_storage_path", + "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", @@ -3642,12 +4363,11 @@ '5', '6', '7', - '8', - '9') + '8') AND "posthog_sessionrecording"."team_id" = 99999) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.153 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.173 ''' SELECT "posthog_sessionrecordingviewed"."session_id" FROM "posthog_sessionrecordingviewed" @@ -3655,7 +4375,7 @@ AND "posthog_sessionrecordingviewed"."user_id" = 99999) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.154 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.174 ''' SELECT "posthog_persondistinctid"."id", "posthog_persondistinctid"."team_id", @@ -3681,12 +4401,11 @@ 'user5', 'user6', 'user7', - 'user8', - 'user9') + 'user8') AND "posthog_persondistinctid"."team_id" = 99999) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.155 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.175 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -3759,7 +4478,7 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.156 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.176 ''' SELECT "posthog_person"."id", "posthog_person"."created_at", @@ -3773,12 +4492,12 @@ "posthog_person"."version" FROM "posthog_person" INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user10' + WHERE ("posthog_persondistinctid"."distinct_id" = 'user9' AND "posthog_persondistinctid"."team_id" = 99999) LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.157 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.177 ''' SELECT "posthog_person"."id", "posthog_person"."created_at", @@ -3792,12 +4511,12 @@ "posthog_person"."version" FROM "posthog_person" INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user10' + WHERE ("posthog_persondistinctid"."distinct_id" = 'user9' AND "posthog_persondistinctid"."team_id" = 99999) LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.158 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.178 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -3830,7 +4549,7 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.159 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.179 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -3896,41 +4615,40 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.16 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.18 ''' - SELECT "posthog_organizationmembership"."id", - "posthog_organizationmembership"."organization_id", - "posthog_organizationmembership"."user_id", - "posthog_organizationmembership"."level", - "posthog_organizationmembership"."joined_at", - "posthog_organizationmembership"."updated_at", - "posthog_organization"."id", - "posthog_organization"."name", - "posthog_organization"."slug", - "posthog_organization"."logo_media_id", - "posthog_organization"."created_at", - "posthog_organization"."updated_at", - "posthog_organization"."plugins_access_level", - "posthog_organization"."for_internal_metrics", - "posthog_organization"."is_member_join_email_enabled", - "posthog_organization"."enforce_2fa", - "posthog_organization"."is_hipaa", - "posthog_organization"."customer_id", - "posthog_organization"."available_product_features", - "posthog_organization"."usage", - "posthog_organization"."never_drop_data", - "posthog_organization"."customer_trust_scores", - "posthog_organization"."setup_section_2_completed", - "posthog_organization"."personalization", - "posthog_organization"."domain_whitelist" - FROM "posthog_organizationmembership" - INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id") - WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid - AND "posthog_organizationmembership"."user_id" = 99999) + SELECT "posthog_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"."temporary_token", + "posthog_user"."distinct_id", + "posthog_user"."is_email_verified", + "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"."toolbar_mode", + "posthog_user"."hedgehog_config", + "posthog_user"."events_column_config", + "posthog_user"."email_opt_in" + FROM "posthog_user" + WHERE "posthog_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.180 ''' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -3964,7 +4682,7 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.161 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.181 ''' SELECT "ee_accesscontrol"."id", "ee_accesscontrol"."team_id", @@ -4010,7 +4728,7 @@ AND "ee_accesscontrol"."team_id" = 99999)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.162 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.182 ''' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -4042,7 +4760,7 @@ WHERE "posthog_organizationmembership"."user_id" = 99999 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.163 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.183 ''' SELECT "posthog_organization"."id", "posthog_organization"."name", @@ -4068,7 +4786,7 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.164 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.184 ''' SELECT "posthog_grouptypemapping"."id", "posthog_grouptypemapping"."team_id", @@ -4081,7 +4799,7 @@ WHERE "posthog_grouptypemapping"."project_id" = 99999 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.165 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.185 ''' SELECT "posthog_datawarehousesavedquery"."created_by_id", "posthog_datawarehousesavedquery"."created_at", @@ -4102,7 +4820,7 @@ AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.166 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.186 ''' SELECT "posthog_datawarehousetable"."created_by_id", "posthog_datawarehousetable"."created_at", @@ -4176,7 +4894,7 @@ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.167 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.187 ''' SELECT "posthog_datawarehousejoin"."created_by_id", "posthog_datawarehousejoin"."created_at", @@ -4196,221 +4914,41 @@ AND "posthog_datawarehousejoin"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.168 - ''' - SELECT "posthog_sessionrecording"."id", - "posthog_sessionrecording"."session_id", - "posthog_sessionrecording"."team_id", - "posthog_sessionrecording"."created_at", - "posthog_sessionrecording"."deleted", - "posthog_sessionrecording"."object_storage_path", - "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"."storage_version" - FROM "posthog_sessionrecording" - 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.169 - ''' - SELECT "posthog_sessionrecordingviewed"."session_id" - FROM "posthog_sessionrecordingviewed" - WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999 - AND "posthog_sessionrecordingviewed"."user_id" = 99999) - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.17 - ''' - SELECT "ee_accesscontrol"."id", - "ee_accesscontrol"."team_id", - "ee_accesscontrol"."access_level", - "ee_accesscontrol"."resource", - "ee_accesscontrol"."resource_id", - "ee_accesscontrol"."organization_member_id", - "ee_accesscontrol"."role_id", - "ee_accesscontrol"."created_by_id", - "ee_accesscontrol"."created_at", - "ee_accesscontrol"."updated_at" - FROM "ee_accesscontrol" - LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id") - WHERE (("ee_accesscontrol"."organization_member_id" IS NULL - AND "ee_accesscontrol"."resource" = 'project' - AND "ee_accesscontrol"."resource_id" = '99999' - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("posthog_organizationmembership"."user_id" = 99999 - AND "ee_accesscontrol"."resource" = 'project' - AND "ee_accesscontrol"."resource_id" = '99999' - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("ee_accesscontrol"."organization_member_id" IS NULL - AND "ee_accesscontrol"."resource" = 'session_recording' - AND "ee_accesscontrol"."resource_id" IS NULL - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("posthog_organizationmembership"."user_id" = 99999 - AND "ee_accesscontrol"."resource" = 'session_recording' - AND "ee_accesscontrol"."resource_id" IS NULL - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("ee_accesscontrol"."organization_member_id" IS NULL - AND "ee_accesscontrol"."resource" = 'session_recording' - AND "ee_accesscontrol"."resource_id" IS NOT NULL - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("posthog_organizationmembership"."user_id" = 99999 - AND "ee_accesscontrol"."resource" = 'session_recording' - AND "ee_accesscontrol"."resource_id" IS NOT NULL - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999)) - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.170 - ''' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version", - "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_persondistinctid" - INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") - WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1', - 'user10', - 'user2', - 'user3', - 'user4', - 'user5', - 'user6', - 'user7', - 'user8', - 'user9') - AND "posthog_persondistinctid"."team_id" = 99999) - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.171 - ''' - 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.172 - ''' - SELECT "posthog_sessionrecording"."id", - "posthog_sessionrecording"."session_id", - "posthog_sessionrecording"."team_id", - "posthog_sessionrecording"."created_at", - "posthog_sessionrecording"."deleted", - "posthog_sessionrecording"."object_storage_path", - "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"."storage_version" - FROM "posthog_sessionrecording" - WHERE ("posthog_sessionrecording"."session_id" IN ('1', - '2', - '3', - '4', - '5', - '6', - '7', - '8') - AND "posthog_sessionrecording"."team_id" = 99999) - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.173 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.188 ''' - SELECT "posthog_sessionrecordingviewed"."session_id" - FROM "posthog_sessionrecordingviewed" - WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999 - AND "posthog_sessionrecordingviewed"."user_id" = 99999) + SELECT "posthog_grouptypemapping"."id", + "posthog_grouptypemapping"."team_id", + "posthog_grouptypemapping"."project_id", + "posthog_grouptypemapping"."group_type", + "posthog_grouptypemapping"."group_type_index", + "posthog_grouptypemapping"."name_singular", + "posthog_grouptypemapping"."name_plural" + FROM "posthog_grouptypemapping" + WHERE "posthog_grouptypemapping"."project_id" = 99999 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.174 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.189 ''' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version", - "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_persondistinctid" - INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") - WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1', - 'user2', - 'user3', - 'user4', - 'user5', - 'user6', - 'user7', - 'user8') - AND "posthog_persondistinctid"."team_id" = 99999) + SELECT "posthog_datawarehousesavedquery"."created_by_id", + "posthog_datawarehousesavedquery"."created_at", + "posthog_datawarehousesavedquery"."deleted", + "posthog_datawarehousesavedquery"."deleted_at", + "posthog_datawarehousesavedquery"."id", + "posthog_datawarehousesavedquery"."name", + "posthog_datawarehousesavedquery"."team_id", + "posthog_datawarehousesavedquery"."columns", + "posthog_datawarehousesavedquery"."external_tables", + "posthog_datawarehousesavedquery"."query", + "posthog_datawarehousesavedquery"."status", + "posthog_datawarehousesavedquery"."last_run_at", + "posthog_datawarehousesavedquery"."table_id" + FROM "posthog_datawarehousesavedquery" + WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999 + AND NOT ("posthog_datawarehousesavedquery"."deleted" + AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.175 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.19 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -4469,13 +5007,6 @@ "posthog_team"."modifiers", "posthog_team"."correlation_config", "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" FROM "posthog_team" @@ -4483,47 +5014,23 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.176 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.190 ''' - SELECT "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_person" - INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user9' - AND "posthog_persondistinctid"."team_id" = 99999) - LIMIT 21 - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.177 - ''' - SELECT "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_person" - INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user9' - AND "posthog_persondistinctid"."team_id" = 99999) - LIMIT 21 - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.178 - ''' - SELECT "posthog_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"."credential_id", + "posthog_datawarehousetable"."external_data_source_id", + "posthog_datawarehousetable"."columns", + "posthog_datawarehousetable"."row_count", + "posthog_user"."id", "posthog_user"."password", "posthog_user"."last_login", "posthog_user"."first_name", @@ -4538,6 +5045,7 @@ "posthog_user"."temporary_token", "posthog_user"."distinct_id", "posthog_user"."is_email_verified", + "posthog_user"."requested_password_reset_at", "posthog_user"."has_seen_product_intro_for", "posthog_user"."strapi_id", "posthog_user"."is_active", @@ -4548,13 +5056,133 @@ "posthog_user"."toolbar_mode", "posthog_user"."hedgehog_config", "posthog_user"."events_column_config", - "posthog_user"."email_opt_in" - FROM "posthog_user" - WHERE "posthog_user"."id" = 99999 - LIMIT 21 + "posthog_user"."email_opt_in", + "posthog_datawarehousecredential"."created_by_id", + "posthog_datawarehousecredential"."created_at", + "posthog_datawarehousecredential"."id", + "posthog_datawarehousecredential"."access_key", + "posthog_datawarehousecredential"."access_secret", + "posthog_datawarehousecredential"."team_id", + "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"."job_inputs", + "posthog_externaldatasource"."are_tables_created", + "posthog_externaldatasource"."prefix" + FROM "posthog_datawarehousetable" + LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousetable"."created_by_id" = "posthog_user"."id") + LEFT OUTER JOIN "posthog_datawarehousecredential" ON ("posthog_datawarehousetable"."credential_id" = "posthog_datawarehousecredential"."id") + 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)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.179 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.191 + ''' + 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.192 + ''' + SELECT "posthog_sessionrecording"."id", + "posthog_sessionrecording"."session_id", + "posthog_sessionrecording"."team_id", + "posthog_sessionrecording"."created_at", + "posthog_sessionrecording"."deleted", + "posthog_sessionrecording"."object_storage_path", + "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"."storage_version" + FROM "posthog_sessionrecording" + WHERE ("posthog_sessionrecording"."session_id" IN ('1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9') + AND "posthog_sessionrecording"."team_id" = 99999) + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.193 + ''' + SELECT "posthog_sessionrecordingviewed"."session_id" + FROM "posthog_sessionrecordingviewed" + WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999 + AND "posthog_sessionrecordingviewed"."user_id" = 99999) + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.194 + ''' + SELECT "posthog_persondistinctid"."id", + "posthog_persondistinctid"."team_id", + "posthog_persondistinctid"."person_id", + "posthog_persondistinctid"."distinct_id", + "posthog_persondistinctid"."version", + "posthog_person"."id", + "posthog_person"."created_at", + "posthog_person"."properties_last_updated_at", + "posthog_person"."properties_last_operation", + "posthog_person"."team_id", + "posthog_person"."properties", + "posthog_person"."is_user_id", + "posthog_person"."is_identified", + "posthog_person"."uuid", + "posthog_person"."version" + FROM "posthog_persondistinctid" + INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") + WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1', + 'user2', + 'user3', + 'user4', + 'user5', + 'user6', + 'user7', + 'user8', + 'user9') + AND "posthog_persondistinctid"."team_id" = 99999) + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.195 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -4613,6 +5241,13 @@ "posthog_team"."modifiers", "posthog_team"."correlation_config", "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" FROM "posthog_team" @@ -4620,73 +5255,246 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.18 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.196 ''' - SELECT "posthog_organizationmembership"."id", - "posthog_organizationmembership"."organization_id", - "posthog_organizationmembership"."user_id", - "posthog_organizationmembership"."level", - "posthog_organizationmembership"."joined_at", - "posthog_organizationmembership"."updated_at", - "posthog_organization"."id", - "posthog_organization"."name", - "posthog_organization"."slug", - "posthog_organization"."logo_media_id", - "posthog_organization"."created_at", - "posthog_organization"."updated_at", - "posthog_organization"."plugins_access_level", - "posthog_organization"."for_internal_metrics", - "posthog_organization"."is_member_join_email_enabled", - "posthog_organization"."enforce_2fa", - "posthog_organization"."is_hipaa", - "posthog_organization"."customer_id", - "posthog_organization"."available_product_features", - "posthog_organization"."usage", - "posthog_organization"."never_drop_data", - "posthog_organization"."customer_trust_scores", - "posthog_organization"."setup_section_2_completed", - "posthog_organization"."personalization", - "posthog_organization"."domain_whitelist" - FROM "posthog_organizationmembership" - INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id") - WHERE "posthog_organizationmembership"."user_id" = 99999 + SELECT "posthog_person"."id", + "posthog_person"."created_at", + "posthog_person"."properties_last_updated_at", + "posthog_person"."properties_last_operation", + "posthog_person"."team_id", + "posthog_person"."properties", + "posthog_person"."is_user_id", + "posthog_person"."is_identified", + "posthog_person"."uuid", + "posthog_person"."version" + FROM "posthog_person" + INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") + WHERE ("posthog_persondistinctid"."distinct_id" = 'user10' + AND "posthog_persondistinctid"."team_id" = 99999) + LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.180 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.197 ''' - SELECT "posthog_organizationmembership"."id", - "posthog_organizationmembership"."organization_id", - "posthog_organizationmembership"."user_id", - "posthog_organizationmembership"."level", - "posthog_organizationmembership"."joined_at", - "posthog_organizationmembership"."updated_at", - "posthog_organization"."id", - "posthog_organization"."name", - "posthog_organization"."slug", - "posthog_organization"."logo_media_id", - "posthog_organization"."created_at", - "posthog_organization"."updated_at", - "posthog_organization"."plugins_access_level", - "posthog_organization"."for_internal_metrics", - "posthog_organization"."is_member_join_email_enabled", - "posthog_organization"."enforce_2fa", - "posthog_organization"."is_hipaa", - "posthog_organization"."customer_id", - "posthog_organization"."available_product_features", - "posthog_organization"."usage", - "posthog_organization"."never_drop_data", - "posthog_organization"."customer_trust_scores", - "posthog_organization"."setup_section_2_completed", - "posthog_organization"."personalization", - "posthog_organization"."domain_whitelist" - FROM "posthog_organizationmembership" + SELECT "posthog_person"."id", + "posthog_person"."created_at", + "posthog_person"."properties_last_updated_at", + "posthog_person"."properties_last_operation", + "posthog_person"."team_id", + "posthog_person"."properties", + "posthog_person"."is_user_id", + "posthog_person"."is_identified", + "posthog_person"."uuid", + "posthog_person"."version" + FROM "posthog_person" + INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") + WHERE ("posthog_persondistinctid"."distinct_id" = 'user10' + AND "posthog_persondistinctid"."team_id" = 99999) + LIMIT 21 + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.198 + ''' + 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"."temporary_token", + "posthog_user"."distinct_id", + "posthog_user"."is_email_verified", + "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"."toolbar_mode", + "posthog_user"."hedgehog_config", + "posthog_user"."events_column_config", + "posthog_user"."email_opt_in" + FROM "posthog_user" + WHERE "posthog_user"."id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.199 + ''' + SELECT "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_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"."ingested_event", + "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"."person_processing_opt_out", + "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_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."human_friendly_comparison_periods", + "posthog_team"."cookieless_server_hash_mode", + "posthog_team"."primary_dashboard_id", + "posthog_team"."default_data_theme", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" + FROM "posthog_team" + WHERE "posthog_team"."id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.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_organization"."id", + "posthog_organization"."name", + "posthog_organization"."slug", + "posthog_organization"."logo_media_id", + "posthog_organization"."created_at", + "posthog_organization"."updated_at", + "posthog_organization"."plugins_access_level", + "posthog_organization"."for_internal_metrics", + "posthog_organization"."is_member_join_email_enabled", + "posthog_organization"."enforce_2fa", + "posthog_organization"."is_hipaa", + "posthog_organization"."customer_id", + "posthog_organization"."available_product_features", + "posthog_organization"."usage", + "posthog_organization"."never_drop_data", + "posthog_organization"."customer_trust_scores", + "posthog_organization"."setup_section_2_completed", + "posthog_organization"."personalization", + "posthog_organization"."domain_whitelist" + 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.181 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.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_organization"."id", + "posthog_organization"."name", + "posthog_organization"."slug", + "posthog_organization"."logo_media_id", + "posthog_organization"."created_at", + "posthog_organization"."updated_at", + "posthog_organization"."plugins_access_level", + "posthog_organization"."for_internal_metrics", + "posthog_organization"."is_member_join_email_enabled", + "posthog_organization"."enforce_2fa", + "posthog_organization"."is_hipaa", + "posthog_organization"."customer_id", + "posthog_organization"."available_product_features", + "posthog_organization"."usage", + "posthog_organization"."never_drop_data", + "posthog_organization"."customer_trust_scores", + "posthog_organization"."setup_section_2_completed", + "posthog_organization"."personalization", + "posthog_organization"."domain_whitelist" + 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.200 + ''' + SELECT "posthog_organizationmembership"."id", + "posthog_organizationmembership"."organization_id", + "posthog_organizationmembership"."user_id", + "posthog_organizationmembership"."level", + "posthog_organizationmembership"."joined_at", + "posthog_organizationmembership"."updated_at", + "posthog_organization"."id", + "posthog_organization"."name", + "posthog_organization"."slug", + "posthog_organization"."logo_media_id", + "posthog_organization"."created_at", + "posthog_organization"."updated_at", + "posthog_organization"."plugins_access_level", + "posthog_organization"."for_internal_metrics", + "posthog_organization"."is_member_join_email_enabled", + "posthog_organization"."enforce_2fa", + "posthog_organization"."is_hipaa", + "posthog_organization"."customer_id", + "posthog_organization"."available_product_features", + "posthog_organization"."usage", + "posthog_organization"."never_drop_data", + "posthog_organization"."customer_trust_scores", + "posthog_organization"."setup_section_2_completed", + "posthog_organization"."personalization", + "posthog_organization"."domain_whitelist" + 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.201 ''' SELECT "ee_accesscontrol"."id", "ee_accesscontrol"."team_id", @@ -4732,7 +5540,7 @@ AND "ee_accesscontrol"."team_id" = 99999)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.182 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.202 ''' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -4764,7 +5572,7 @@ WHERE "posthog_organizationmembership"."user_id" = 99999 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.183 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.203 ''' SELECT "posthog_organization"."id", "posthog_organization"."name", @@ -4790,7 +5598,7 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.184 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.204 ''' SELECT "posthog_grouptypemapping"."id", "posthog_grouptypemapping"."team_id", @@ -4803,7 +5611,7 @@ WHERE "posthog_grouptypemapping"."project_id" = 99999 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.185 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.205 ''' SELECT "posthog_datawarehousesavedquery"."created_by_id", "posthog_datawarehousesavedquery"."created_at", @@ -4824,7 +5632,7 @@ AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.186 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.206 ''' SELECT "posthog_datawarehousetable"."created_by_id", "posthog_datawarehousetable"."created_at", @@ -4898,7 +5706,7 @@ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.187 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.207 ''' SELECT "posthog_datawarehousejoin"."created_by_id", "posthog_datawarehousejoin"."created_at", @@ -4918,7 +5726,7 @@ AND "posthog_datawarehousejoin"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.188 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.208 ''' SELECT "posthog_grouptypemapping"."id", "posthog_grouptypemapping"."team_id", @@ -4931,7 +5739,7 @@ WHERE "posthog_grouptypemapping"."project_id" = 99999 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.189 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.209 ''' SELECT "posthog_datawarehousesavedquery"."created_by_id", "posthog_datawarehousesavedquery"."created_at", @@ -4952,33 +5760,53 @@ AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.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"."plugins_access_level", - "posthog_organization"."for_internal_metrics", - "posthog_organization"."is_member_join_email_enabled", - "posthog_organization"."enforce_2fa", - "posthog_organization"."is_hipaa", - "posthog_organization"."customer_id", - "posthog_organization"."available_product_features", - "posthog_organization"."usage", - "posthog_organization"."never_drop_data", - "posthog_organization"."customer_trust_scores", - "posthog_organization"."setup_section_2_completed", - "posthog_organization"."personalization", - "posthog_organization"."domain_whitelist" - 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.21 ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.190 + 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"."resource" = 'project' + AND "ee_accesscontrol"."resource_id" = '99999' + AND "ee_accesscontrol"."role_id" IS NULL + AND "ee_accesscontrol"."team_id" = 99999) + OR ("posthog_organizationmembership"."user_id" = 99999 + AND "ee_accesscontrol"."resource" = 'project' + AND "ee_accesscontrol"."resource_id" = '99999' + AND "ee_accesscontrol"."role_id" IS NULL + AND "ee_accesscontrol"."team_id" = 99999) + OR ("ee_accesscontrol"."organization_member_id" IS NULL + AND "ee_accesscontrol"."resource" = 'session_recording' + AND "ee_accesscontrol"."resource_id" IS NULL + AND "ee_accesscontrol"."role_id" IS NULL + AND "ee_accesscontrol"."team_id" = 99999) + OR ("posthog_organizationmembership"."user_id" = 99999 + AND "ee_accesscontrol"."resource" = 'session_recording' + AND "ee_accesscontrol"."resource_id" IS NULL + AND "ee_accesscontrol"."role_id" IS NULL + AND "ee_accesscontrol"."team_id" = 99999) + OR ("ee_accesscontrol"."organization_member_id" IS NULL + AND "ee_accesscontrol"."resource" = 'session_recording' + AND "ee_accesscontrol"."resource_id" IS NOT NULL + AND "ee_accesscontrol"."role_id" IS NULL + AND "ee_accesscontrol"."team_id" = 99999) + OR ("posthog_organizationmembership"."user_id" = 99999 + AND "ee_accesscontrol"."resource" = 'session_recording' + AND "ee_accesscontrol"."resource_id" IS NOT NULL + AND "ee_accesscontrol"."role_id" IS NULL + AND "ee_accesscontrol"."team_id" = 99999)) + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.210 ''' SELECT "posthog_datawarehousetable"."created_by_id", "posthog_datawarehousetable"."created_at", @@ -5052,7 +5880,7 @@ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.191 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.211 ''' SELECT "posthog_datawarehousejoin"."created_by_id", "posthog_datawarehousejoin"."created_at", @@ -5072,7 +5900,7 @@ AND "posthog_datawarehousejoin"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.192 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.212 ''' SELECT "posthog_sessionrecording"."id", "posthog_sessionrecording"."session_id", @@ -5096,6 +5924,7 @@ "posthog_sessionrecording"."storage_version" FROM "posthog_sessionrecording" WHERE ("posthog_sessionrecording"."session_id" IN ('1', + '10', '2', '3', '4', @@ -5107,7 +5936,7 @@ AND "posthog_sessionrecording"."team_id" = 99999) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.193 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.213 ''' SELECT "posthog_sessionrecordingviewed"."session_id" FROM "posthog_sessionrecordingviewed" @@ -5115,7 +5944,7 @@ AND "posthog_sessionrecordingviewed"."user_id" = 99999) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.194 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.214 ''' SELECT "posthog_persondistinctid"."id", "posthog_persondistinctid"."team_id", @@ -5135,6 +5964,7 @@ FROM "posthog_persondistinctid" INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1', + 'user10', 'user2', 'user3', 'user4', @@ -5146,1066 +5976,115 @@ AND "posthog_persondistinctid"."team_id" = 99999) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.195 - ''' - SELECT "posthog_team"."id", - "posthog_team"."uuid", - "posthog_team"."organization_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"."ingested_event", - "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"."person_processing_opt_out", - "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_url_trigger_config", - "posthog_team"."session_recording_url_blocklist_config", - "posthog_team"."session_recording_event_trigger_config", - "posthog_team"."session_replay_config", - "posthog_team"."survey_config", - "posthog_team"."capture_console_log_opt_in", - "posthog_team"."capture_performance_opt_in", - "posthog_team"."capture_dead_clicks", - "posthog_team"."surveys_opt_in", - "posthog_team"."heatmaps_opt_in", - "posthog_team"."session_recording_version", - "posthog_team"."signup_token", - "posthog_team"."is_demo", - "posthog_team"."access_control", - "posthog_team"."week_start_day", - "posthog_team"."inject_web_apps", - "posthog_team"."test_account_filters", - "posthog_team"."test_account_filters_default_checked", - "posthog_team"."path_cleaning_filters", - "posthog_team"."timezone", - "posthog_team"."data_attributes", - "posthog_team"."person_display_name_properties", - "posthog_team"."live_events_columns", - "posthog_team"."recording_domains", - "posthog_team"."human_friendly_comparison_periods", - "posthog_team"."cookieless_server_hash_mode", - "posthog_team"."primary_dashboard_id", - "posthog_team"."default_data_theme", - "posthog_team"."extra_settings", - "posthog_team"."modifiers", - "posthog_team"."correlation_config", - "posthog_team"."session_recording_retention_period_days", - "posthog_team"."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" - FROM "posthog_team" - WHERE "posthog_team"."id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.196 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.22 ''' - SELECT "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_person" - INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user10' - AND "posthog_persondistinctid"."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_organization"."id", + "posthog_organization"."name", + "posthog_organization"."slug", + "posthog_organization"."logo_media_id", + "posthog_organization"."created_at", + "posthog_organization"."updated_at", + "posthog_organization"."plugins_access_level", + "posthog_organization"."for_internal_metrics", + "posthog_organization"."is_member_join_email_enabled", + "posthog_organization"."enforce_2fa", + "posthog_organization"."is_hipaa", + "posthog_organization"."customer_id", + "posthog_organization"."available_product_features", + "posthog_organization"."usage", + "posthog_organization"."never_drop_data", + "posthog_organization"."customer_trust_scores", + "posthog_organization"."setup_section_2_completed", + "posthog_organization"."personalization", + "posthog_organization"."domain_whitelist" + 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.197 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.23 ''' - SELECT "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_person" - INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user10' - AND "posthog_persondistinctid"."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"."plugins_access_level", + "posthog_organization"."for_internal_metrics", + "posthog_organization"."is_member_join_email_enabled", + "posthog_organization"."enforce_2fa", + "posthog_organization"."is_hipaa", + "posthog_organization"."customer_id", + "posthog_organization"."available_product_features", + "posthog_organization"."usage", + "posthog_organization"."never_drop_data", + "posthog_organization"."customer_trust_scores", + "posthog_organization"."setup_section_2_completed", + "posthog_organization"."personalization", + "posthog_organization"."domain_whitelist" + 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.198 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.24 ''' - 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"."temporary_token", - "posthog_user"."distinct_id", - "posthog_user"."is_email_verified", - "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"."toolbar_mode", - "posthog_user"."hedgehog_config", - "posthog_user"."events_column_config", - "posthog_user"."email_opt_in" - FROM "posthog_user" - WHERE "posthog_user"."id" = 99999 - LIMIT 21 + SELECT "posthog_grouptypemapping"."id", + "posthog_grouptypemapping"."team_id", + "posthog_grouptypemapping"."project_id", + "posthog_grouptypemapping"."group_type", + "posthog_grouptypemapping"."group_type_index", + "posthog_grouptypemapping"."name_singular", + "posthog_grouptypemapping"."name_plural" + FROM "posthog_grouptypemapping" + WHERE "posthog_grouptypemapping"."project_id" = 99999 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.199 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.25 ''' - SELECT "posthog_team"."id", - "posthog_team"."uuid", - "posthog_team"."organization_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"."ingested_event", - "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"."person_processing_opt_out", - "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_url_trigger_config", - "posthog_team"."session_recording_url_blocklist_config", - "posthog_team"."session_recording_event_trigger_config", - "posthog_team"."session_replay_config", - "posthog_team"."survey_config", - "posthog_team"."capture_console_log_opt_in", - "posthog_team"."capture_performance_opt_in", - "posthog_team"."capture_dead_clicks", - "posthog_team"."surveys_opt_in", - "posthog_team"."heatmaps_opt_in", - "posthog_team"."session_recording_version", - "posthog_team"."signup_token", - "posthog_team"."is_demo", - "posthog_team"."access_control", - "posthog_team"."week_start_day", - "posthog_team"."inject_web_apps", - "posthog_team"."test_account_filters", - "posthog_team"."test_account_filters_default_checked", - "posthog_team"."path_cleaning_filters", - "posthog_team"."timezone", - "posthog_team"."data_attributes", - "posthog_team"."person_display_name_properties", - "posthog_team"."live_events_columns", - "posthog_team"."recording_domains", - "posthog_team"."human_friendly_comparison_periods", - "posthog_team"."cookieless_server_hash_mode", - "posthog_team"."primary_dashboard_id", - "posthog_team"."default_data_theme", - "posthog_team"."extra_settings", - "posthog_team"."modifiers", - "posthog_team"."correlation_config", - "posthog_team"."session_recording_retention_period_days", - "posthog_team"."external_data_workspace_id", - "posthog_team"."external_data_workspace_last_synced_at" - FROM "posthog_team" - WHERE "posthog_team"."id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.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_organization"."id", - "posthog_organization"."name", - "posthog_organization"."slug", - "posthog_organization"."logo_media_id", - "posthog_organization"."created_at", - "posthog_organization"."updated_at", - "posthog_organization"."plugins_access_level", - "posthog_organization"."for_internal_metrics", - "posthog_organization"."is_member_join_email_enabled", - "posthog_organization"."enforce_2fa", - "posthog_organization"."is_hipaa", - "posthog_organization"."customer_id", - "posthog_organization"."available_product_features", - "posthog_organization"."usage", - "posthog_organization"."never_drop_data", - "posthog_organization"."customer_trust_scores", - "posthog_organization"."setup_section_2_completed", - "posthog_organization"."personalization", - "posthog_organization"."domain_whitelist" - 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_grouptypemapping"."id", - "posthog_grouptypemapping"."team_id", - "posthog_grouptypemapping"."project_id", - "posthog_grouptypemapping"."group_type", - "posthog_grouptypemapping"."group_type_index", - "posthog_grouptypemapping"."name_singular", - "posthog_grouptypemapping"."name_plural" - FROM "posthog_grouptypemapping" - WHERE "posthog_grouptypemapping"."project_id" = 99999 - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.200 - ''' - SELECT "posthog_organizationmembership"."id", - "posthog_organizationmembership"."organization_id", - "posthog_organizationmembership"."user_id", - "posthog_organizationmembership"."level", - "posthog_organizationmembership"."joined_at", - "posthog_organizationmembership"."updated_at", - "posthog_organization"."id", - "posthog_organization"."name", - "posthog_organization"."slug", - "posthog_organization"."logo_media_id", - "posthog_organization"."created_at", - "posthog_organization"."updated_at", - "posthog_organization"."plugins_access_level", - "posthog_organization"."for_internal_metrics", - "posthog_organization"."is_member_join_email_enabled", - "posthog_organization"."enforce_2fa", - "posthog_organization"."is_hipaa", - "posthog_organization"."customer_id", - "posthog_organization"."available_product_features", - "posthog_organization"."usage", - "posthog_organization"."never_drop_data", - "posthog_organization"."customer_trust_scores", - "posthog_organization"."setup_section_2_completed", - "posthog_organization"."personalization", - "posthog_organization"."domain_whitelist" - 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.201 - ''' - 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"."resource" = 'project' - AND "ee_accesscontrol"."resource_id" = '99999' - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("posthog_organizationmembership"."user_id" = 99999 - AND "ee_accesscontrol"."resource" = 'project' - AND "ee_accesscontrol"."resource_id" = '99999' - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("ee_accesscontrol"."organization_member_id" IS NULL - AND "ee_accesscontrol"."resource" = 'session_recording' - AND "ee_accesscontrol"."resource_id" IS NULL - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("posthog_organizationmembership"."user_id" = 99999 - AND "ee_accesscontrol"."resource" = 'session_recording' - AND "ee_accesscontrol"."resource_id" IS NULL - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("ee_accesscontrol"."organization_member_id" IS NULL - AND "ee_accesscontrol"."resource" = 'session_recording' - AND "ee_accesscontrol"."resource_id" IS NOT NULL - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("posthog_organizationmembership"."user_id" = 99999 - AND "ee_accesscontrol"."resource" = 'session_recording' - AND "ee_accesscontrol"."resource_id" IS NOT NULL - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999)) - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.202 - ''' - SELECT "posthog_organizationmembership"."id", - "posthog_organizationmembership"."organization_id", - "posthog_organizationmembership"."user_id", - "posthog_organizationmembership"."level", - "posthog_organizationmembership"."joined_at", - "posthog_organizationmembership"."updated_at", - "posthog_organization"."id", - "posthog_organization"."name", - "posthog_organization"."slug", - "posthog_organization"."logo_media_id", - "posthog_organization"."created_at", - "posthog_organization"."updated_at", - "posthog_organization"."plugins_access_level", - "posthog_organization"."for_internal_metrics", - "posthog_organization"."is_member_join_email_enabled", - "posthog_organization"."enforce_2fa", - "posthog_organization"."is_hipaa", - "posthog_organization"."customer_id", - "posthog_organization"."available_product_features", - "posthog_organization"."usage", - "posthog_organization"."never_drop_data", - "posthog_organization"."customer_trust_scores", - "posthog_organization"."setup_section_2_completed", - "posthog_organization"."personalization", - "posthog_organization"."domain_whitelist" - 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.203 - ''' - 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"."plugins_access_level", - "posthog_organization"."for_internal_metrics", - "posthog_organization"."is_member_join_email_enabled", - "posthog_organization"."enforce_2fa", - "posthog_organization"."is_hipaa", - "posthog_organization"."customer_id", - "posthog_organization"."available_product_features", - "posthog_organization"."usage", - "posthog_organization"."never_drop_data", - "posthog_organization"."customer_trust_scores", - "posthog_organization"."setup_section_2_completed", - "posthog_organization"."personalization", - "posthog_organization"."domain_whitelist" - 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.204 - ''' - SELECT "posthog_grouptypemapping"."id", - "posthog_grouptypemapping"."team_id", - "posthog_grouptypemapping"."project_id", - "posthog_grouptypemapping"."group_type", - "posthog_grouptypemapping"."group_type_index", - "posthog_grouptypemapping"."name_singular", - "posthog_grouptypemapping"."name_plural" - FROM "posthog_grouptypemapping" - WHERE "posthog_grouptypemapping"."project_id" = 99999 - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.205 - ''' - SELECT "posthog_datawarehousesavedquery"."created_by_id", - "posthog_datawarehousesavedquery"."created_at", - "posthog_datawarehousesavedquery"."deleted", - "posthog_datawarehousesavedquery"."deleted_at", - "posthog_datawarehousesavedquery"."id", - "posthog_datawarehousesavedquery"."name", - "posthog_datawarehousesavedquery"."team_id", - "posthog_datawarehousesavedquery"."columns", - "posthog_datawarehousesavedquery"."external_tables", - "posthog_datawarehousesavedquery"."query", - "posthog_datawarehousesavedquery"."status", - "posthog_datawarehousesavedquery"."last_run_at", - "posthog_datawarehousesavedquery"."table_id" - FROM "posthog_datawarehousesavedquery" - WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999 - AND NOT ("posthog_datawarehousesavedquery"."deleted" - AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.206 - ''' - 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"."credential_id", - "posthog_datawarehousetable"."external_data_source_id", - "posthog_datawarehousetable"."columns", - "posthog_datawarehousetable"."row_count", - "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"."temporary_token", - "posthog_user"."distinct_id", - "posthog_user"."is_email_verified", - "posthog_user"."requested_password_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"."toolbar_mode", - "posthog_user"."hedgehog_config", - "posthog_user"."events_column_config", - "posthog_user"."email_opt_in", - "posthog_datawarehousecredential"."created_by_id", - "posthog_datawarehousecredential"."created_at", - "posthog_datawarehousecredential"."id", - "posthog_datawarehousecredential"."access_key", - "posthog_datawarehousecredential"."access_secret", - "posthog_datawarehousecredential"."team_id", - "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"."job_inputs", - "posthog_externaldatasource"."are_tables_created", - "posthog_externaldatasource"."prefix" - FROM "posthog_datawarehousetable" - LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousetable"."created_by_id" = "posthog_user"."id") - LEFT OUTER JOIN "posthog_datawarehousecredential" ON ("posthog_datawarehousetable"."credential_id" = "posthog_datawarehousecredential"."id") - 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)) - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.207 - ''' - 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.208 - ''' - SELECT "posthog_grouptypemapping"."id", - "posthog_grouptypemapping"."team_id", - "posthog_grouptypemapping"."project_id", - "posthog_grouptypemapping"."group_type", - "posthog_grouptypemapping"."group_type_index", - "posthog_grouptypemapping"."name_singular", - "posthog_grouptypemapping"."name_plural" - FROM "posthog_grouptypemapping" - WHERE "posthog_grouptypemapping"."project_id" = 99999 - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.209 - ''' - SELECT "posthog_datawarehousesavedquery"."created_by_id", - "posthog_datawarehousesavedquery"."created_at", - "posthog_datawarehousesavedquery"."deleted", - "posthog_datawarehousesavedquery"."deleted_at", - "posthog_datawarehousesavedquery"."id", - "posthog_datawarehousesavedquery"."name", - "posthog_datawarehousesavedquery"."team_id", - "posthog_datawarehousesavedquery"."columns", - "posthog_datawarehousesavedquery"."external_tables", - "posthog_datawarehousesavedquery"."query", - "posthog_datawarehousesavedquery"."status", - "posthog_datawarehousesavedquery"."last_run_at", - "posthog_datawarehousesavedquery"."table_id" - FROM "posthog_datawarehousesavedquery" - WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999 - AND NOT ("posthog_datawarehousesavedquery"."deleted" - AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.21 - ''' - SELECT "posthog_datawarehousesavedquery"."created_by_id", - "posthog_datawarehousesavedquery"."created_at", - "posthog_datawarehousesavedquery"."deleted", - "posthog_datawarehousesavedquery"."deleted_at", - "posthog_datawarehousesavedquery"."id", - "posthog_datawarehousesavedquery"."name", - "posthog_datawarehousesavedquery"."team_id", - "posthog_datawarehousesavedquery"."columns", - "posthog_datawarehousesavedquery"."external_tables", - "posthog_datawarehousesavedquery"."query", - "posthog_datawarehousesavedquery"."status", - "posthog_datawarehousesavedquery"."last_run_at", - "posthog_datawarehousesavedquery"."table_id" - FROM "posthog_datawarehousesavedquery" - WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999 - AND NOT ("posthog_datawarehousesavedquery"."deleted" - AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.210 - ''' - 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"."credential_id", - "posthog_datawarehousetable"."external_data_source_id", - "posthog_datawarehousetable"."columns", - "posthog_datawarehousetable"."row_count", - "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"."temporary_token", - "posthog_user"."distinct_id", - "posthog_user"."is_email_verified", - "posthog_user"."requested_password_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"."toolbar_mode", - "posthog_user"."hedgehog_config", - "posthog_user"."events_column_config", - "posthog_user"."email_opt_in", - "posthog_datawarehousecredential"."created_by_id", - "posthog_datawarehousecredential"."created_at", - "posthog_datawarehousecredential"."id", - "posthog_datawarehousecredential"."access_key", - "posthog_datawarehousecredential"."access_secret", - "posthog_datawarehousecredential"."team_id", - "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"."job_inputs", - "posthog_externaldatasource"."are_tables_created", - "posthog_externaldatasource"."prefix" - FROM "posthog_datawarehousetable" - LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousetable"."created_by_id" = "posthog_user"."id") - LEFT OUTER JOIN "posthog_datawarehousecredential" ON ("posthog_datawarehousetable"."credential_id" = "posthog_datawarehousecredential"."id") - 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)) - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.211 - ''' - 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.212 - ''' - SELECT "posthog_sessionrecording"."id", - "posthog_sessionrecording"."session_id", - "posthog_sessionrecording"."team_id", - "posthog_sessionrecording"."created_at", - "posthog_sessionrecording"."deleted", - "posthog_sessionrecording"."object_storage_path", - "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"."storage_version" - FROM "posthog_sessionrecording" - 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.213 - ''' - SELECT "posthog_sessionrecordingviewed"."session_id" - FROM "posthog_sessionrecordingviewed" - WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999 - AND "posthog_sessionrecordingviewed"."user_id" = 99999) - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.214 - ''' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version", - "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_persondistinctid" - INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") - WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1', - 'user10', - 'user2', - 'user3', - 'user4', - 'user5', - 'user6', - 'user7', - 'user8', - 'user9') - AND "posthog_persondistinctid"."team_id" = 99999) - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.22 - ''' - 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"."credential_id", - "posthog_datawarehousetable"."external_data_source_id", - "posthog_datawarehousetable"."columns", - "posthog_datawarehousetable"."row_count", - "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"."temporary_token", - "posthog_user"."distinct_id", - "posthog_user"."is_email_verified", - "posthog_user"."requested_password_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"."toolbar_mode", - "posthog_user"."hedgehog_config", - "posthog_user"."events_column_config", - "posthog_user"."email_opt_in", - "posthog_datawarehousecredential"."created_by_id", - "posthog_datawarehousecredential"."created_at", - "posthog_datawarehousecredential"."id", - "posthog_datawarehousecredential"."access_key", - "posthog_datawarehousecredential"."access_secret", - "posthog_datawarehousecredential"."team_id", - "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"."job_inputs", - "posthog_externaldatasource"."are_tables_created", - "posthog_externaldatasource"."prefix" - FROM "posthog_datawarehousetable" - LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousetable"."created_by_id" = "posthog_user"."id") - LEFT OUTER JOIN "posthog_datawarehousecredential" ON ("posthog_datawarehousetable"."credential_id" = "posthog_datawarehousecredential"."id") - 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)) - ''' -# --- -# 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 "posthog_sessionrecording"."id", - "posthog_sessionrecording"."session_id", - "posthog_sessionrecording"."team_id", - "posthog_sessionrecording"."created_at", - "posthog_sessionrecording"."deleted", - "posthog_sessionrecording"."object_storage_path", - "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"."storage_version" - 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.25 - ''' - SELECT "posthog_sessionrecordingviewed"."session_id" - FROM "posthog_sessionrecordingviewed" - WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999 - AND "posthog_sessionrecordingviewed"."user_id" = 99999) - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.26 - ''' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version", - "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_persondistinctid" - INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") - WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1') - AND "posthog_persondistinctid"."team_id" = 99999) - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.27 - ''' - SELECT "posthog_team"."id", - "posthog_team"."uuid", - "posthog_team"."organization_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"."ingested_event", - "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"."person_processing_opt_out", - "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_url_trigger_config", - "posthog_team"."session_recording_url_blocklist_config", - "posthog_team"."session_recording_event_trigger_config", - "posthog_team"."session_replay_config", - "posthog_team"."survey_config", - "posthog_team"."capture_console_log_opt_in", - "posthog_team"."capture_performance_opt_in", - "posthog_team"."capture_dead_clicks", - "posthog_team"."surveys_opt_in", - "posthog_team"."heatmaps_opt_in", - "posthog_team"."session_recording_version", - "posthog_team"."signup_token", - "posthog_team"."is_demo", - "posthog_team"."access_control", - "posthog_team"."week_start_day", - "posthog_team"."inject_web_apps", - "posthog_team"."test_account_filters", - "posthog_team"."test_account_filters_default_checked", - "posthog_team"."path_cleaning_filters", - "posthog_team"."timezone", - "posthog_team"."data_attributes", - "posthog_team"."person_display_name_properties", - "posthog_team"."live_events_columns", - "posthog_team"."recording_domains", - "posthog_team"."human_friendly_comparison_periods", - "posthog_team"."cookieless_server_hash_mode", - "posthog_team"."primary_dashboard_id", - "posthog_team"."default_data_theme", - "posthog_team"."extra_settings", - "posthog_team"."modifiers", - "posthog_team"."correlation_config", - "posthog_team"."session_recording_retention_period_days", - "posthog_team"."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" - FROM "posthog_team" - WHERE "posthog_team"."id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.28 - ''' - SELECT "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_person" - INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user2' - AND "posthog_persondistinctid"."team_id" = 99999) - LIMIT 21 - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.29 - ''' - SELECT "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_person" - INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user2' - AND "posthog_persondistinctid"."team_id" = 99999) - LIMIT 21 - ''' -# --- -# 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"."resource" = 'project' - AND "ee_accesscontrol"."resource_id" = '99999' - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("posthog_organizationmembership"."user_id" = 99999 - AND "ee_accesscontrol"."resource" = 'project' - AND "ee_accesscontrol"."resource_id" = '99999' - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("ee_accesscontrol"."organization_member_id" IS NULL - AND "ee_accesscontrol"."resource" = 'session_recording' - AND "ee_accesscontrol"."resource_id" IS NULL - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("posthog_organizationmembership"."user_id" = 99999 - AND "ee_accesscontrol"."resource" = 'session_recording' - AND "ee_accesscontrol"."resource_id" IS NULL - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("ee_accesscontrol"."organization_member_id" IS NULL - AND "ee_accesscontrol"."resource" = 'session_recording' - AND "ee_accesscontrol"."resource_id" IS NOT NULL - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("posthog_organizationmembership"."user_id" = 99999 - AND "ee_accesscontrol"."resource" = 'session_recording' - AND "ee_accesscontrol"."resource_id" IS NOT NULL - 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"."deleted", + "posthog_datawarehousesavedquery"."deleted_at", + "posthog_datawarehousesavedquery"."id", + "posthog_datawarehousesavedquery"."name", + "posthog_datawarehousesavedquery"."team_id", + "posthog_datawarehousesavedquery"."columns", + "posthog_datawarehousesavedquery"."external_tables", + "posthog_datawarehousesavedquery"."query", + "posthog_datawarehousesavedquery"."status", + "posthog_datawarehousesavedquery"."last_run_at", + "posthog_datawarehousesavedquery"."table_id" + FROM "posthog_datawarehousesavedquery" + WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999 + AND NOT ("posthog_datawarehousesavedquery"."deleted" + AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.30 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.26 ''' - SELECT "posthog_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"."credential_id", + "posthog_datawarehousetable"."external_data_source_id", + "posthog_datawarehousetable"."columns", + "posthog_datawarehousetable"."row_count", + "posthog_user"."id", "posthog_user"."password", "posthog_user"."last_login", "posthog_user"."first_name", @@ -6220,6 +6099,7 @@ "posthog_user"."temporary_token", "posthog_user"."distinct_id", "posthog_user"."is_email_verified", + "posthog_user"."requested_password_reset_at", "posthog_user"."has_seen_product_intro_for", "posthog_user"."strapi_id", "posthog_user"."is_active", @@ -6230,217 +6110,59 @@ "posthog_user"."toolbar_mode", "posthog_user"."hedgehog_config", "posthog_user"."events_column_config", - "posthog_user"."email_opt_in" - FROM "posthog_user" - WHERE "posthog_user"."id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.31 - ''' - SELECT "posthog_team"."id", - "posthog_team"."uuid", - "posthog_team"."organization_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"."ingested_event", - "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"."person_processing_opt_out", - "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_url_trigger_config", - "posthog_team"."session_recording_url_blocklist_config", - "posthog_team"."session_recording_event_trigger_config", - "posthog_team"."session_replay_config", - "posthog_team"."survey_config", - "posthog_team"."capture_console_log_opt_in", - "posthog_team"."capture_performance_opt_in", - "posthog_team"."capture_dead_clicks", - "posthog_team"."surveys_opt_in", - "posthog_team"."heatmaps_opt_in", - "posthog_team"."session_recording_version", - "posthog_team"."signup_token", - "posthog_team"."is_demo", - "posthog_team"."access_control", - "posthog_team"."week_start_day", - "posthog_team"."inject_web_apps", - "posthog_team"."test_account_filters", - "posthog_team"."test_account_filters_default_checked", - "posthog_team"."path_cleaning_filters", - "posthog_team"."timezone", - "posthog_team"."data_attributes", - "posthog_team"."person_display_name_properties", - "posthog_team"."live_events_columns", - "posthog_team"."recording_domains", - "posthog_team"."human_friendly_comparison_periods", - "posthog_team"."cookieless_server_hash_mode", - "posthog_team"."primary_dashboard_id", - "posthog_team"."default_data_theme", - "posthog_team"."extra_settings", - "posthog_team"."modifiers", - "posthog_team"."correlation_config", - "posthog_team"."session_recording_retention_period_days", - "posthog_team"."external_data_workspace_id", - "posthog_team"."external_data_workspace_last_synced_at" - FROM "posthog_team" - WHERE "posthog_team"."id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.32 - ''' - SELECT "posthog_organizationmembership"."id", - "posthog_organizationmembership"."organization_id", - "posthog_organizationmembership"."user_id", - "posthog_organizationmembership"."level", - "posthog_organizationmembership"."joined_at", - "posthog_organizationmembership"."updated_at", - "posthog_organization"."id", - "posthog_organization"."name", - "posthog_organization"."slug", - "posthog_organization"."logo_media_id", - "posthog_organization"."created_at", - "posthog_organization"."updated_at", - "posthog_organization"."plugins_access_level", - "posthog_organization"."for_internal_metrics", - "posthog_organization"."is_member_join_email_enabled", - "posthog_organization"."enforce_2fa", - "posthog_organization"."is_hipaa", - "posthog_organization"."customer_id", - "posthog_organization"."available_product_features", - "posthog_organization"."usage", - "posthog_organization"."never_drop_data", - "posthog_organization"."customer_trust_scores", - "posthog_organization"."setup_section_2_completed", - "posthog_organization"."personalization", - "posthog_organization"."domain_whitelist" - 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.33 - ''' - 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"."resource" = 'project' - AND "ee_accesscontrol"."resource_id" = '99999' - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("posthog_organizationmembership"."user_id" = 99999 - AND "ee_accesscontrol"."resource" = 'project' - AND "ee_accesscontrol"."resource_id" = '99999' - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("ee_accesscontrol"."organization_member_id" IS NULL - AND "ee_accesscontrol"."resource" = 'session_recording' - AND "ee_accesscontrol"."resource_id" IS NULL - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("posthog_organizationmembership"."user_id" = 99999 - AND "ee_accesscontrol"."resource" = 'session_recording' - AND "ee_accesscontrol"."resource_id" IS NULL - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("ee_accesscontrol"."organization_member_id" IS NULL - AND "ee_accesscontrol"."resource" = 'session_recording' - AND "ee_accesscontrol"."resource_id" IS NOT NULL - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("posthog_organizationmembership"."user_id" = 99999 - AND "ee_accesscontrol"."resource" = 'session_recording' - AND "ee_accesscontrol"."resource_id" IS NOT NULL - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999)) - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.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_organization"."id", - "posthog_organization"."name", - "posthog_organization"."slug", - "posthog_organization"."logo_media_id", - "posthog_organization"."created_at", - "posthog_organization"."updated_at", - "posthog_organization"."plugins_access_level", - "posthog_organization"."for_internal_metrics", - "posthog_organization"."is_member_join_email_enabled", - "posthog_organization"."enforce_2fa", - "posthog_organization"."is_hipaa", - "posthog_organization"."customer_id", - "posthog_organization"."available_product_features", - "posthog_organization"."usage", - "posthog_organization"."never_drop_data", - "posthog_organization"."customer_trust_scores", - "posthog_organization"."setup_section_2_completed", - "posthog_organization"."personalization", - "posthog_organization"."domain_whitelist" - 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.35 - ''' - 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"."plugins_access_level", - "posthog_organization"."for_internal_metrics", - "posthog_organization"."is_member_join_email_enabled", - "posthog_organization"."enforce_2fa", - "posthog_organization"."is_hipaa", - "posthog_organization"."customer_id", - "posthog_organization"."available_product_features", - "posthog_organization"."usage", - "posthog_organization"."never_drop_data", - "posthog_organization"."customer_trust_scores", - "posthog_organization"."setup_section_2_completed", - "posthog_organization"."personalization", - "posthog_organization"."domain_whitelist" - FROM "posthog_organization" - WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid - LIMIT 21 + "posthog_user"."email_opt_in", + "posthog_datawarehousecredential"."created_by_id", + "posthog_datawarehousecredential"."created_at", + "posthog_datawarehousecredential"."id", + "posthog_datawarehousecredential"."access_key", + "posthog_datawarehousecredential"."access_secret", + "posthog_datawarehousecredential"."team_id", + "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"."job_inputs", + "posthog_externaldatasource"."are_tables_created", + "posthog_externaldatasource"."prefix" + FROM "posthog_datawarehousetable" + LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousetable"."created_by_id" = "posthog_user"."id") + LEFT OUTER JOIN "posthog_datawarehousecredential" ON ("posthog_datawarehousetable"."credential_id" = "posthog_datawarehousecredential"."id") + 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)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.36 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.27 + ''' + 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.28 ''' SELECT "posthog_grouptypemapping"."id", "posthog_grouptypemapping"."team_id", @@ -6453,7 +6175,7 @@ WHERE "posthog_grouptypemapping"."project_id" = 99999 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.37 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.29 ''' SELECT "posthog_datawarehousesavedquery"."created_by_id", "posthog_datawarehousesavedquery"."created_at", @@ -6474,7 +6196,53 @@ AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.38 +# 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"."resource" = 'project' + AND "ee_accesscontrol"."resource_id" = '99999' + AND "ee_accesscontrol"."role_id" IS NULL + AND "ee_accesscontrol"."team_id" = 99999) + OR ("posthog_organizationmembership"."user_id" = 99999 + AND "ee_accesscontrol"."resource" = 'project' + AND "ee_accesscontrol"."resource_id" = '99999' + AND "ee_accesscontrol"."role_id" IS NULL + AND "ee_accesscontrol"."team_id" = 99999) + OR ("ee_accesscontrol"."organization_member_id" IS NULL + AND "ee_accesscontrol"."resource" = 'session_recording' + AND "ee_accesscontrol"."resource_id" IS NULL + AND "ee_accesscontrol"."role_id" IS NULL + AND "ee_accesscontrol"."team_id" = 99999) + OR ("posthog_organizationmembership"."user_id" = 99999 + AND "ee_accesscontrol"."resource" = 'session_recording' + AND "ee_accesscontrol"."resource_id" IS NULL + AND "ee_accesscontrol"."role_id" IS NULL + AND "ee_accesscontrol"."team_id" = 99999) + OR ("ee_accesscontrol"."organization_member_id" IS NULL + AND "ee_accesscontrol"."resource" = 'session_recording' + AND "ee_accesscontrol"."resource_id" IS NOT NULL + AND "ee_accesscontrol"."role_id" IS NULL + AND "ee_accesscontrol"."team_id" = 99999) + OR ("posthog_organizationmembership"."user_id" = 99999 + AND "ee_accesscontrol"."resource" = 'session_recording' + AND "ee_accesscontrol"."resource_id" IS NOT NULL + 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_datawarehousetable"."created_by_id", "posthog_datawarehousetable"."created_at", @@ -6548,7 +6316,7 @@ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.39 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.31 ''' SELECT "posthog_datawarehousejoin"."created_by_id", "posthog_datawarehousejoin"."created_at", @@ -6568,39 +6336,7 @@ 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_organization"."id", - "posthog_organization"."name", - "posthog_organization"."slug", - "posthog_organization"."logo_media_id", - "posthog_organization"."created_at", - "posthog_organization"."updated_at", - "posthog_organization"."plugins_access_level", - "posthog_organization"."for_internal_metrics", - "posthog_organization"."is_member_join_email_enabled", - "posthog_organization"."enforce_2fa", - "posthog_organization"."is_hipaa", - "posthog_organization"."customer_id", - "posthog_organization"."available_product_features", - "posthog_organization"."usage", - "posthog_organization"."never_drop_data", - "posthog_organization"."customer_trust_scores", - "posthog_organization"."setup_section_2_completed", - "posthog_organization"."personalization", - "posthog_organization"."domain_whitelist" - 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 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.32 ''' SELECT "posthog_sessionrecording"."id", "posthog_sessionrecording"."session_id", @@ -6623,12 +6359,11 @@ "posthog_sessionrecording"."start_url", "posthog_sessionrecording"."storage_version" FROM "posthog_sessionrecording" - WHERE ("posthog_sessionrecording"."session_id" IN ('1', - '2') + WHERE ("posthog_sessionrecording"."session_id" IN ('1') AND "posthog_sessionrecording"."team_id" = 99999) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.41 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.33 ''' SELECT "posthog_sessionrecordingviewed"."session_id" FROM "posthog_sessionrecordingviewed" @@ -6636,7 +6371,7 @@ AND "posthog_sessionrecordingviewed"."user_id" = 99999) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.42 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.34 ''' SELECT "posthog_persondistinctid"."id", "posthog_persondistinctid"."team_id", @@ -6655,12 +6390,11 @@ "posthog_person"."version" FROM "posthog_persondistinctid" INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") - WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1', - 'user2') + WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1') AND "posthog_persondistinctid"."team_id" = 99999) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.43 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.35 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -6733,7 +6467,7 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.44 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.36 ''' SELECT "posthog_person"."id", "posthog_person"."created_at", @@ -6747,12 +6481,12 @@ "posthog_person"."version" FROM "posthog_person" INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user3' + WHERE ("posthog_persondistinctid"."distinct_id" = 'user2' AND "posthog_persondistinctid"."team_id" = 99999) LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.45 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.37 ''' SELECT "posthog_person"."id", "posthog_person"."created_at", @@ -6766,12 +6500,12 @@ "posthog_person"."version" FROM "posthog_person" INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user3' + WHERE ("posthog_persondistinctid"."distinct_id" = 'user2' AND "posthog_persondistinctid"."team_id" = 99999) LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.46 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.38 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -6804,7 +6538,7 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.47 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.39 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -6870,7 +6604,39 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.48 +# 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_organization"."id", + "posthog_organization"."name", + "posthog_organization"."slug", + "posthog_organization"."logo_media_id", + "posthog_organization"."created_at", + "posthog_organization"."updated_at", + "posthog_organization"."plugins_access_level", + "posthog_organization"."for_internal_metrics", + "posthog_organization"."is_member_join_email_enabled", + "posthog_organization"."enforce_2fa", + "posthog_organization"."is_hipaa", + "posthog_organization"."customer_id", + "posthog_organization"."available_product_features", + "posthog_organization"."usage", + "posthog_organization"."never_drop_data", + "posthog_organization"."customer_trust_scores", + "posthog_organization"."setup_section_2_completed", + "posthog_organization"."personalization", + "posthog_organization"."domain_whitelist" + 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 "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -6904,7 +6670,7 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.49 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.41 ''' SELECT "ee_accesscontrol"."id", "ee_accesscontrol"."team_id", @@ -6950,9 +6716,15 @@ AND "ee_accesscontrol"."team_id" = 99999)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.5 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.42 ''' - 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_organization"."id", "posthog_organization"."name", "posthog_organization"."slug", "posthog_organization"."logo_media_id", @@ -6971,20 +6743,14 @@ "posthog_organization"."setup_section_2_completed", "posthog_organization"."personalization", "posthog_organization"."domain_whitelist" - 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: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.50 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.43 ''' - SELECT "posthog_organizationmembership"."id", - "posthog_organizationmembership"."organization_id", - "posthog_organizationmembership"."user_id", - "posthog_organizationmembership"."level", - "posthog_organizationmembership"."joined_at", - "posthog_organizationmembership"."updated_at", - "posthog_organization"."id", + SELECT "posthog_organization"."id", "posthog_organization"."name", "posthog_organization"."slug", "posthog_organization"."logo_media_id", @@ -7003,38 +6769,140 @@ "posthog_organization"."setup_section_2_completed", "posthog_organization"."personalization", "posthog_organization"."domain_whitelist" - FROM "posthog_organizationmembership" - INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id") - WHERE "posthog_organizationmembership"."user_id" = 99999 + FROM "posthog_organization" + WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid + LIMIT 21 + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.44 + ''' + SELECT "posthog_grouptypemapping"."id", + "posthog_grouptypemapping"."team_id", + "posthog_grouptypemapping"."project_id", + "posthog_grouptypemapping"."group_type", + "posthog_grouptypemapping"."group_type_index", + "posthog_grouptypemapping"."name_singular", + "posthog_grouptypemapping"."name_plural" + FROM "posthog_grouptypemapping" + WHERE "posthog_grouptypemapping"."project_id" = 99999 + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.45 + ''' + SELECT "posthog_datawarehousesavedquery"."created_by_id", + "posthog_datawarehousesavedquery"."created_at", + "posthog_datawarehousesavedquery"."deleted", + "posthog_datawarehousesavedquery"."deleted_at", + "posthog_datawarehousesavedquery"."id", + "posthog_datawarehousesavedquery"."name", + "posthog_datawarehousesavedquery"."team_id", + "posthog_datawarehousesavedquery"."columns", + "posthog_datawarehousesavedquery"."external_tables", + "posthog_datawarehousesavedquery"."query", + "posthog_datawarehousesavedquery"."status", + "posthog_datawarehousesavedquery"."last_run_at", + "posthog_datawarehousesavedquery"."table_id" + FROM "posthog_datawarehousesavedquery" + WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999 + AND NOT ("posthog_datawarehousesavedquery"."deleted" + AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.46 + ''' + 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"."credential_id", + "posthog_datawarehousetable"."external_data_source_id", + "posthog_datawarehousetable"."columns", + "posthog_datawarehousetable"."row_count", + "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"."temporary_token", + "posthog_user"."distinct_id", + "posthog_user"."is_email_verified", + "posthog_user"."requested_password_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"."toolbar_mode", + "posthog_user"."hedgehog_config", + "posthog_user"."events_column_config", + "posthog_user"."email_opt_in", + "posthog_datawarehousecredential"."created_by_id", + "posthog_datawarehousecredential"."created_at", + "posthog_datawarehousecredential"."id", + "posthog_datawarehousecredential"."access_key", + "posthog_datawarehousecredential"."access_secret", + "posthog_datawarehousecredential"."team_id", + "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"."job_inputs", + "posthog_externaldatasource"."are_tables_created", + "posthog_externaldatasource"."prefix" + FROM "posthog_datawarehousetable" + LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousetable"."created_by_id" = "posthog_user"."id") + LEFT OUTER JOIN "posthog_datawarehousecredential" ON ("posthog_datawarehousetable"."credential_id" = "posthog_datawarehousecredential"."id") + 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)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.51 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.47 ''' - 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"."plugins_access_level", - "posthog_organization"."for_internal_metrics", - "posthog_organization"."is_member_join_email_enabled", - "posthog_organization"."enforce_2fa", - "posthog_organization"."is_hipaa", - "posthog_organization"."customer_id", - "posthog_organization"."available_product_features", - "posthog_organization"."usage", - "posthog_organization"."never_drop_data", - "posthog_organization"."customer_trust_scores", - "posthog_organization"."setup_section_2_completed", - "posthog_organization"."personalization", - "posthog_organization"."domain_whitelist" - FROM "posthog_organization" - WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid - 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.52 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.48 ''' SELECT "posthog_grouptypemapping"."id", "posthog_grouptypemapping"."team_id", @@ -7047,7 +6915,7 @@ WHERE "posthog_grouptypemapping"."project_id" = 99999 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.53 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.49 ''' SELECT "posthog_datawarehousesavedquery"."created_by_id", "posthog_datawarehousesavedquery"."created_at", @@ -7068,7 +6936,33 @@ AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.54 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.5 + ''' + 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"."plugins_access_level", + "posthog_organization"."for_internal_metrics", + "posthog_organization"."is_member_join_email_enabled", + "posthog_organization"."enforce_2fa", + "posthog_organization"."is_hipaa", + "posthog_organization"."customer_id", + "posthog_organization"."available_product_features", + "posthog_organization"."usage", + "posthog_organization"."never_drop_data", + "posthog_organization"."customer_trust_scores", + "posthog_organization"."setup_section_2_completed", + "posthog_organization"."personalization", + "posthog_organization"."domain_whitelist" + 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.50 ''' SELECT "posthog_datawarehousetable"."created_by_id", "posthog_datawarehousetable"."created_at", @@ -7142,7 +7036,7 @@ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.55 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.51 ''' SELECT "posthog_datawarehousejoin"."created_by_id", "posthog_datawarehousejoin"."created_at", @@ -7162,7 +7056,7 @@ AND "posthog_datawarehousejoin"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.56 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.52 ''' SELECT "posthog_sessionrecording"."id", "posthog_sessionrecording"."session_id", @@ -7186,12 +7080,11 @@ "posthog_sessionrecording"."storage_version" FROM "posthog_sessionrecording" WHERE ("posthog_sessionrecording"."session_id" IN ('1', - '2', - '3') + '2') AND "posthog_sessionrecording"."team_id" = 99999) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.57 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.53 ''' SELECT "posthog_sessionrecordingviewed"."session_id" FROM "posthog_sessionrecordingviewed" @@ -7199,7 +7092,7 @@ AND "posthog_sessionrecordingviewed"."user_id" = 99999) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.58 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.54 ''' SELECT "posthog_persondistinctid"."id", "posthog_persondistinctid"."team_id", @@ -7219,12 +7112,11 @@ FROM "posthog_persondistinctid" INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1', - 'user2', - 'user3') + 'user2') AND "posthog_persondistinctid"."team_id" = 99999) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.59 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.55 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -7297,20 +7189,7 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.6 - ''' - SELECT "posthog_grouptypemapping"."id", - "posthog_grouptypemapping"."team_id", - "posthog_grouptypemapping"."project_id", - "posthog_grouptypemapping"."group_type", - "posthog_grouptypemapping"."group_type_index", - "posthog_grouptypemapping"."name_singular", - "posthog_grouptypemapping"."name_plural" - FROM "posthog_grouptypemapping" - WHERE "posthog_grouptypemapping"."project_id" = 99999 - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.60 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.56 ''' SELECT "posthog_person"."id", "posthog_person"."created_at", @@ -7324,12 +7203,12 @@ "posthog_person"."version" FROM "posthog_person" INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user4' + WHERE ("posthog_persondistinctid"."distinct_id" = 'user3' AND "posthog_persondistinctid"."team_id" = 99999) LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.61 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.57 ''' SELECT "posthog_person"."id", "posthog_person"."created_at", @@ -7343,12 +7222,12 @@ "posthog_person"."version" FROM "posthog_person" INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user4' + WHERE ("posthog_persondistinctid"."distinct_id" = 'user3' AND "posthog_persondistinctid"."team_id" = 99999) LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.62 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.58 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -7381,7 +7260,7 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.63 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.59 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -7447,7 +7326,20 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.64 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.6 + ''' + SELECT "posthog_grouptypemapping"."id", + "posthog_grouptypemapping"."team_id", + "posthog_grouptypemapping"."project_id", + "posthog_grouptypemapping"."group_type", + "posthog_grouptypemapping"."group_type_index", + "posthog_grouptypemapping"."name_singular", + "posthog_grouptypemapping"."name_plural" + FROM "posthog_grouptypemapping" + WHERE "posthog_grouptypemapping"."project_id" = 99999 + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.60 ''' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -7481,7 +7373,7 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.65 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.61 ''' SELECT "ee_accesscontrol"."id", "ee_accesscontrol"."team_id", @@ -7527,7 +7419,7 @@ AND "ee_accesscontrol"."team_id" = 99999)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.66 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.62 ''' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -7559,30 +7451,158 @@ WHERE "posthog_organizationmembership"."user_id" = 99999 ''' # --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.63 + ''' + 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"."plugins_access_level", + "posthog_organization"."for_internal_metrics", + "posthog_organization"."is_member_join_email_enabled", + "posthog_organization"."enforce_2fa", + "posthog_organization"."is_hipaa", + "posthog_organization"."customer_id", + "posthog_organization"."available_product_features", + "posthog_organization"."usage", + "posthog_organization"."never_drop_data", + "posthog_organization"."customer_trust_scores", + "posthog_organization"."setup_section_2_completed", + "posthog_organization"."personalization", + "posthog_organization"."domain_whitelist" + 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.64 + ''' + SELECT "posthog_grouptypemapping"."id", + "posthog_grouptypemapping"."team_id", + "posthog_grouptypemapping"."project_id", + "posthog_grouptypemapping"."group_type", + "posthog_grouptypemapping"."group_type_index", + "posthog_grouptypemapping"."name_singular", + "posthog_grouptypemapping"."name_plural" + FROM "posthog_grouptypemapping" + WHERE "posthog_grouptypemapping"."project_id" = 99999 + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.65 + ''' + SELECT "posthog_datawarehousesavedquery"."created_by_id", + "posthog_datawarehousesavedquery"."created_at", + "posthog_datawarehousesavedquery"."deleted", + "posthog_datawarehousesavedquery"."deleted_at", + "posthog_datawarehousesavedquery"."id", + "posthog_datawarehousesavedquery"."name", + "posthog_datawarehousesavedquery"."team_id", + "posthog_datawarehousesavedquery"."columns", + "posthog_datawarehousesavedquery"."external_tables", + "posthog_datawarehousesavedquery"."query", + "posthog_datawarehousesavedquery"."status", + "posthog_datawarehousesavedquery"."last_run_at", + "posthog_datawarehousesavedquery"."table_id" + FROM "posthog_datawarehousesavedquery" + WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999 + AND NOT ("posthog_datawarehousesavedquery"."deleted" + AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.66 + ''' + 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"."credential_id", + "posthog_datawarehousetable"."external_data_source_id", + "posthog_datawarehousetable"."columns", + "posthog_datawarehousetable"."row_count", + "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"."temporary_token", + "posthog_user"."distinct_id", + "posthog_user"."is_email_verified", + "posthog_user"."requested_password_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"."toolbar_mode", + "posthog_user"."hedgehog_config", + "posthog_user"."events_column_config", + "posthog_user"."email_opt_in", + "posthog_datawarehousecredential"."created_by_id", + "posthog_datawarehousecredential"."created_at", + "posthog_datawarehousecredential"."id", + "posthog_datawarehousecredential"."access_key", + "posthog_datawarehousecredential"."access_secret", + "posthog_datawarehousecredential"."team_id", + "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"."job_inputs", + "posthog_externaldatasource"."are_tables_created", + "posthog_externaldatasource"."prefix" + FROM "posthog_datawarehousetable" + LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousetable"."created_by_id" = "posthog_user"."id") + LEFT OUTER JOIN "posthog_datawarehousecredential" ON ("posthog_datawarehousetable"."credential_id" = "posthog_datawarehousecredential"."id") + 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)) + ''' +# --- # name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.67 ''' - 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"."plugins_access_level", - "posthog_organization"."for_internal_metrics", - "posthog_organization"."is_member_join_email_enabled", - "posthog_organization"."enforce_2fa", - "posthog_organization"."is_hipaa", - "posthog_organization"."customer_id", - "posthog_organization"."available_product_features", - "posthog_organization"."usage", - "posthog_organization"."never_drop_data", - "posthog_organization"."customer_trust_scores", - "posthog_organization"."setup_section_2_completed", - "posthog_organization"."personalization", - "posthog_organization"."domain_whitelist" - FROM "posthog_organization" - WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid - 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.68 @@ -7759,8 +7779,7 @@ FROM "posthog_sessionrecording" WHERE ("posthog_sessionrecording"."session_id" IN ('1', '2', - '3', - '4') + '3') AND "posthog_sessionrecording"."team_id" = 99999) ''' # --- @@ -7793,8 +7812,7 @@ INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1', 'user2', - 'user3', - 'user4') + 'user3') AND "posthog_persondistinctid"."team_id" = 99999) ''' # --- @@ -7885,7 +7903,7 @@ "posthog_person"."version" FROM "posthog_person" INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user5' + WHERE ("posthog_persondistinctid"."distinct_id" = 'user4' AND "posthog_persondistinctid"."team_id" = 99999) LIMIT 21 ''' @@ -7904,7 +7922,7 @@ "posthog_person"."version" FROM "posthog_person" INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user5' + WHERE ("posthog_persondistinctid"."distinct_id" = 'user4' AND "posthog_persondistinctid"."team_id" = 99999) LIMIT 21 ''' @@ -8194,33 +8212,161 @@ WHERE "posthog_organizationmembership"."user_id" = 99999 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.83 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.83 + ''' + 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"."plugins_access_level", + "posthog_organization"."for_internal_metrics", + "posthog_organization"."is_member_join_email_enabled", + "posthog_organization"."enforce_2fa", + "posthog_organization"."is_hipaa", + "posthog_organization"."customer_id", + "posthog_organization"."available_product_features", + "posthog_organization"."usage", + "posthog_organization"."never_drop_data", + "posthog_organization"."customer_trust_scores", + "posthog_organization"."setup_section_2_completed", + "posthog_organization"."personalization", + "posthog_organization"."domain_whitelist" + 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.84 + ''' + SELECT "posthog_grouptypemapping"."id", + "posthog_grouptypemapping"."team_id", + "posthog_grouptypemapping"."project_id", + "posthog_grouptypemapping"."group_type", + "posthog_grouptypemapping"."group_type_index", + "posthog_grouptypemapping"."name_singular", + "posthog_grouptypemapping"."name_plural" + FROM "posthog_grouptypemapping" + WHERE "posthog_grouptypemapping"."project_id" = 99999 + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.85 + ''' + SELECT "posthog_datawarehousesavedquery"."created_by_id", + "posthog_datawarehousesavedquery"."created_at", + "posthog_datawarehousesavedquery"."deleted", + "posthog_datawarehousesavedquery"."deleted_at", + "posthog_datawarehousesavedquery"."id", + "posthog_datawarehousesavedquery"."name", + "posthog_datawarehousesavedquery"."team_id", + "posthog_datawarehousesavedquery"."columns", + "posthog_datawarehousesavedquery"."external_tables", + "posthog_datawarehousesavedquery"."query", + "posthog_datawarehousesavedquery"."status", + "posthog_datawarehousesavedquery"."last_run_at", + "posthog_datawarehousesavedquery"."table_id" + FROM "posthog_datawarehousesavedquery" + WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999 + AND NOT ("posthog_datawarehousesavedquery"."deleted" + AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.86 + ''' + 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"."credential_id", + "posthog_datawarehousetable"."external_data_source_id", + "posthog_datawarehousetable"."columns", + "posthog_datawarehousetable"."row_count", + "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"."temporary_token", + "posthog_user"."distinct_id", + "posthog_user"."is_email_verified", + "posthog_user"."requested_password_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"."toolbar_mode", + "posthog_user"."hedgehog_config", + "posthog_user"."events_column_config", + "posthog_user"."email_opt_in", + "posthog_datawarehousecredential"."created_by_id", + "posthog_datawarehousecredential"."created_at", + "posthog_datawarehousecredential"."id", + "posthog_datawarehousecredential"."access_key", + "posthog_datawarehousecredential"."access_secret", + "posthog_datawarehousecredential"."team_id", + "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"."job_inputs", + "posthog_externaldatasource"."are_tables_created", + "posthog_externaldatasource"."prefix" + FROM "posthog_datawarehousetable" + LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousetable"."created_by_id" = "posthog_user"."id") + LEFT OUTER JOIN "posthog_datawarehousecredential" ON ("posthog_datawarehousetable"."credential_id" = "posthog_datawarehousecredential"."id") + 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)) + ''' +# --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.87 ''' - 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"."plugins_access_level", - "posthog_organization"."for_internal_metrics", - "posthog_organization"."is_member_join_email_enabled", - "posthog_organization"."enforce_2fa", - "posthog_organization"."is_hipaa", - "posthog_organization"."customer_id", - "posthog_organization"."available_product_features", - "posthog_organization"."usage", - "posthog_organization"."never_drop_data", - "posthog_organization"."customer_trust_scores", - "posthog_organization"."setup_section_2_completed", - "posthog_organization"."personalization", - "posthog_organization"."domain_whitelist" - FROM "posthog_organization" - WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid - 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.84 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.88 ''' SELECT "posthog_grouptypemapping"."id", "posthog_grouptypemapping"."team_id", @@ -8233,7 +8379,7 @@ WHERE "posthog_grouptypemapping"."project_id" = 99999 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.85 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.89 ''' SELECT "posthog_datawarehousesavedquery"."created_by_id", "posthog_datawarehousesavedquery"."created_at", @@ -8254,7 +8400,27 @@ AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.86 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.9 + ''' + 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.90 ''' SELECT "posthog_datawarehousetable"."created_by_id", "posthog_datawarehousetable"."created_at", @@ -8328,7 +8494,7 @@ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.87 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.91 ''' SELECT "posthog_datawarehousejoin"."created_by_id", "posthog_datawarehousejoin"."created_at", @@ -8348,7 +8514,7 @@ AND "posthog_datawarehousejoin"."deleted" IS NOT NULL)) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.88 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.92 ''' SELECT "posthog_sessionrecording"."id", "posthog_sessionrecording"."session_id", @@ -8374,12 +8540,11 @@ WHERE ("posthog_sessionrecording"."session_id" IN ('1', '2', '3', - '4', - '5') + '4') AND "posthog_sessionrecording"."team_id" = 99999) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.89 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.93 ''' SELECT "posthog_sessionrecordingviewed"."session_id" FROM "posthog_sessionrecordingviewed" @@ -8387,27 +8552,7 @@ AND "posthog_sessionrecordingviewed"."user_id" = 99999) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.9 - ''' - 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.90 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.94 ''' SELECT "posthog_persondistinctid"."id", "posthog_persondistinctid"."team_id", @@ -8429,12 +8574,11 @@ WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1', 'user2', 'user3', - 'user4', - 'user5') + 'user4') AND "posthog_persondistinctid"."team_id" = 99999) ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.91 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.95 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -8507,7 +8651,7 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.92 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.96 ''' SELECT "posthog_person"."id", "posthog_person"."created_at", @@ -8521,12 +8665,12 @@ "posthog_person"."version" FROM "posthog_person" INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user6' + WHERE ("posthog_persondistinctid"."distinct_id" = 'user5' AND "posthog_persondistinctid"."team_id" = 99999) LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.93 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.97 ''' SELECT "posthog_person"."id", "posthog_person"."created_at", @@ -8540,12 +8684,12 @@ "posthog_person"."version" FROM "posthog_person" INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'user6' + WHERE ("posthog_persondistinctid"."distinct_id" = 'user5' AND "posthog_persondistinctid"."team_id" = 99999) LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.94 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.98 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -8578,7 +8722,7 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.95 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.99 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -8644,141 +8788,3 @@ LIMIT 21 ''' # --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.96 - ''' - SELECT "posthog_organizationmembership"."id", - "posthog_organizationmembership"."organization_id", - "posthog_organizationmembership"."user_id", - "posthog_organizationmembership"."level", - "posthog_organizationmembership"."joined_at", - "posthog_organizationmembership"."updated_at", - "posthog_organization"."id", - "posthog_organization"."name", - "posthog_organization"."slug", - "posthog_organization"."logo_media_id", - "posthog_organization"."created_at", - "posthog_organization"."updated_at", - "posthog_organization"."plugins_access_level", - "posthog_organization"."for_internal_metrics", - "posthog_organization"."is_member_join_email_enabled", - "posthog_organization"."enforce_2fa", - "posthog_organization"."is_hipaa", - "posthog_organization"."customer_id", - "posthog_organization"."available_product_features", - "posthog_organization"."usage", - "posthog_organization"."never_drop_data", - "posthog_organization"."customer_trust_scores", - "posthog_organization"."setup_section_2_completed", - "posthog_organization"."personalization", - "posthog_organization"."domain_whitelist" - FROM "posthog_organizationmembership" - INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id") - WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid - AND "posthog_organizationmembership"."user_id" = 99999) - LIMIT 21 - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.97 - ''' - SELECT "ee_accesscontrol"."id", - "ee_accesscontrol"."team_id", - "ee_accesscontrol"."access_level", - "ee_accesscontrol"."resource", - "ee_accesscontrol"."resource_id", - "ee_accesscontrol"."organization_member_id", - "ee_accesscontrol"."role_id", - "ee_accesscontrol"."created_by_id", - "ee_accesscontrol"."created_at", - "ee_accesscontrol"."updated_at" - FROM "ee_accesscontrol" - LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id") - WHERE (("ee_accesscontrol"."organization_member_id" IS NULL - AND "ee_accesscontrol"."resource" = 'project' - AND "ee_accesscontrol"."resource_id" = '99999' - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("posthog_organizationmembership"."user_id" = 99999 - AND "ee_accesscontrol"."resource" = 'project' - AND "ee_accesscontrol"."resource_id" = '99999' - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("ee_accesscontrol"."organization_member_id" IS NULL - AND "ee_accesscontrol"."resource" = 'session_recording' - AND "ee_accesscontrol"."resource_id" IS NULL - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("posthog_organizationmembership"."user_id" = 99999 - AND "ee_accesscontrol"."resource" = 'session_recording' - AND "ee_accesscontrol"."resource_id" IS NULL - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("ee_accesscontrol"."organization_member_id" IS NULL - AND "ee_accesscontrol"."resource" = 'session_recording' - AND "ee_accesscontrol"."resource_id" IS NOT NULL - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999) - OR ("posthog_organizationmembership"."user_id" = 99999 - AND "ee_accesscontrol"."resource" = 'session_recording' - AND "ee_accesscontrol"."resource_id" IS NOT NULL - AND "ee_accesscontrol"."role_id" IS NULL - AND "ee_accesscontrol"."team_id" = 99999)) - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.98 - ''' - SELECT "posthog_organizationmembership"."id", - "posthog_organizationmembership"."organization_id", - "posthog_organizationmembership"."user_id", - "posthog_organizationmembership"."level", - "posthog_organizationmembership"."joined_at", - "posthog_organizationmembership"."updated_at", - "posthog_organization"."id", - "posthog_organization"."name", - "posthog_organization"."slug", - "posthog_organization"."logo_media_id", - "posthog_organization"."created_at", - "posthog_organization"."updated_at", - "posthog_organization"."plugins_access_level", - "posthog_organization"."for_internal_metrics", - "posthog_organization"."is_member_join_email_enabled", - "posthog_organization"."enforce_2fa", - "posthog_organization"."is_hipaa", - "posthog_organization"."customer_id", - "posthog_organization"."available_product_features", - "posthog_organization"."usage", - "posthog_organization"."never_drop_data", - "posthog_organization"."customer_trust_scores", - "posthog_organization"."setup_section_2_completed", - "posthog_organization"."personalization", - "posthog_organization"."domain_whitelist" - FROM "posthog_organizationmembership" - INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id") - WHERE "posthog_organizationmembership"."user_id" = 99999 - ''' -# --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.99 - ''' - SELECT "posthog_organization"."id", - "posthog_organization"."name", - "posthog_organization"."slug", - "posthog_organization"."logo_media_id", - "posthog_organization"."created_at", - "posthog_organization"."updated_at", - "posthog_organization"."plugins_access_level", - "posthog_organization"."for_internal_metrics", - "posthog_organization"."is_member_join_email_enabled", - "posthog_organization"."enforce_2fa", - "posthog_organization"."is_hipaa", - "posthog_organization"."customer_id", - "posthog_organization"."available_product_features", - "posthog_organization"."usage", - "posthog_organization"."never_drop_data", - "posthog_organization"."customer_trust_scores", - "posthog_organization"."setup_section_2_completed", - "posthog_organization"."personalization", - "posthog_organization"."domain_whitelist" - FROM "posthog_organization" - WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid - LIMIT 21 - ''' -# ---