:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(experiments): add person-scoped exposure filter for recordings (#82578)
Marcel Poelker70db46ea0b36
diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.jsonindex 9f85e952d13f..93179336641a 100644--- a/frontend/src/queries/schema.json+++ b/frontend/src/queries/schema.json@@ -46651,6 +46651,10 @@},"type": "array"},+ "experiment_exposure": {+ "$ref": "#/definitions/RecordingsQueryExperimentExposureFilter",+ "description": "Only sessions of persons exposed to this experiment, each ending at or after the person's first exposure as the experiment's exposure criteria count it. Resolved server-side from the experiment, so it links sessions even when the exposure events themselves carry no session id (e.g. server-side SDKs). Composes with the query's date range like any other filter, so set date_from to the experiment's start (or earlier) to cover the full run: the default window only reaches back a few days."+ },"filter_test_accounts": {"type": "boolean"},@@ -46728,6 +46732,21 @@"required": ["kind"],"type": "object"},+ "RecordingsQueryExperimentExposureFilter": {+ "additionalProperties": false,+ "properties": {+ "experiment_id": {+ "$ref": "#/definitions/integer",+ "description": "Experiment whose exposed persons' sessions to show. Must belong to the environment the query runs in."+ },+ "variant": {+ "description": "Narrow to persons exposed to this variant. Defaults to all of the experiment's variants.",+ "type": "string"+ }+ },+ "required": ["experiment_id"],+ "type": "object"+ },"RecordingsQueryResponse": {"additionalProperties": false,"properties": {diff --git a/frontend/src/queries/schema/schema-general.ts b/frontend/src/queries/schema/schema-general.tsindex 37f4d59c35db..c978e06e3d83 100644--- a/frontend/src/queries/schema/schema-general.ts+++ b/frontend/src/queries/schema/schema-general.ts@@ -675,6 +675,13 @@ export type RecordingOrder = (typeof VALID_RECORDING_ORDERS)[number]export type RecordingOrderDirection = 'ASC' | 'DESC'+export interface RecordingsQueryExperimentExposureFilter {+ /** Experiment whose exposed persons' sessions to show. Must belong to the environment the query runs in. */+ experiment_id: integer+ /** Narrow to persons exposed to this variant. Defaults to all of the experiment's variants. */+ variant?: string+}+export interface RecordingsQuery extends DataNode<RecordingsQueryResponse> {kind: NodeKind.RecordingsQuery/**@@ -700,6 +707,15 @@ export interface RecordingsQuery extends DataNode<RecordingsQueryResponse> {session_recording_id?: stringperson_uuid?: stringdistinct_ids?: string[]+ /**+ * Only sessions of persons exposed to this experiment, each ending at or after the person's+ * first exposure as the experiment's exposure criteria count it. Resolved server-side from the+ * experiment, so it links sessions even when the exposure events themselves carry no session id+ * (e.g. server-side SDKs). Composes with the query's date range like any other filter, so set+ * date_from to the experiment's start (or earlier) to cover the full run: the default window+ * only reaches back a few days.+ */+ experiment_exposure?: RecordingsQueryExperimentExposureFilter/*** @default "start_time"* */diff --git a/posthog/api/query.py b/posthog/api/query.pyindex 1abf54da7d15..c0c0c5670fc5 100644--- a/posthog/api/query.py+++ b/posthog/api/query.py@@ -176,6 +176,10 @@ def _required_scopes_for_query_payload(query: object) -> list[str] | None:current_query = querywhile isinstance(current_query, dict):kind = current_query.get("kind")+ # The experiment_exposure recordings filter reads experiment data, so it needs+ # experiment:read on top of query:read — keyed on query content, not kind alone.+ if kind == "RecordingsQuery" and current_query.get("experiment_exposure"):+ return ["query:read", "experiment:read"]if isinstance(kind, str) and kind in _QUERY_KIND_SCOPES:return _QUERY_KIND_SCOPES[kind]current_query = current_query.get("source")diff --git a/posthog/schema.py b/posthog/schema.pyindex e0d81393f69e..71f1ff357746 100644--- a/posthog/schema.py+++ b/posthog/schema.py@@ -6388,6 +6388,22 @@ class QueryStatusResponse(BaseModel):query_status: QueryStatus+class RecordingsQueryExperimentExposureFilter(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ experiment_id: int = Field(+ ...,+ description=(+ "Experiment whose exposed persons' sessions to show. Must belong to the environment the query runs in."+ ),+ )+ variant: str | None = Field(+ default=None,+ description=("Narrow to persons exposed to this variant. Defaults to all of the experiment's variants."),+ )++class ResultCustomization(RootModel[ResultCustomizationByValue | ResultCustomizationByPosition]):root: ResultCustomizationByValue | ResultCustomizationByPosition@@ -26371,6 +26387,18 @@ class RecordingsQuery(BaseModel):date_to: str | None = Nonedistinct_ids: list[str] | None = Noneevents: list[dict[str, Any]] | None = None+ experiment_exposure: RecordingsQueryExperimentExposureFilter | None = Field(+ default=None,+ description=(+ "Only sessions of persons exposed to this experiment, each ending at or"+ " after the person's first exposure as the experiment's exposure criteria"+ " count it. Resolved server-side from the experiment, so it links sessions"+ " even when the exposure events themselves carry no session id (e.g."+ " server-side SDKs). Composes with the query's date range like any other"+ " filter, so set date_from to the experiment's start (or earlier) to cover"+ " the full run: the default window only reaches back a few days."+ ),+ )filter_test_accounts: bool | None = Nonehaving_predicates: list[AnyPropertyFilterDiscriminated] | None = Nonehide_viewed_recordings: HideViewedRecordings | None = Field(diff --git a/posthog/session_recordings/queries/recordings_query_runner.py b/posthog/session_recordings/queries/recordings_query_runner.pyindex 94dd3328dd06..b5763592902a 100644--- a/posthog/session_recordings/queries/recordings_query_runner.py+++ b/posthog/session_recordings/queries/recordings_query_runner.py@@ -1,4 +1,4 @@-from typing import Any+from typing import TYPE_CHECKING, Anyfrom posthog.schema import (CachedRecordingsQueryResponse,@@ -13,11 +13,26 @@ from posthog.hogql_queries.query_runner import AnalyticsQueryRunnerfrom posthog.session_recordings.queries.session_recording_list_from_query import SessionRecordingListFromQueryfrom posthog.session_recordings.utils import gate_surfacing_score_order+if TYPE_CHECKING:+ from posthog.models.user import User+class RecordingsQueryRunner(AnalyticsQueryRunner[RecordingsQueryResponse]):query: RecordingsQuerycached_response: CachedRecordingsQueryResponse+ def validate_query_runner_access(self, user: "User") -> bool:+ # The generic query endpoint serves cached responses without rebuilding the query, so+ # the construction-time check in SessionRecordingListFromQuery never runs on a cache+ # hit; this hook is what keeps a denied viewer from reading a cached list.+ if self.query.experiment_exposure is None:+ return True+ # Deferred: the experiments facade package imports posthog.api on init, which circles+ # back into this module's imports through the replay-deletion temporal activities.+ from products.experiments.backend.facade.replay import validate_experiment_exposure_access # noqa: PLC0415++ return validate_experiment_exposure_access(self.team, user, self.query.experiment_exposure.experiment_id)+def _listing(self) -> SessionRecordingListFromQuery:# `surfacing_score` ordering is flag-gated; gate here so every path that materializes the query# (the MCP/query endpoint via `_calculate`, plus `to_query` for explain/debug) shares one check.@@ -26,6 +41,7 @@ class RecordingsQueryRunner(AnalyticsQueryRunner[RecordingsQueryResponse]):team=self.team,query=self.query,hogql_query_modifiers=self.modifiers,+ user=self.user,)def _calculate(self) -> RecordingsQueryResponse:diff --git a/posthog/session_recordings/queries/session_recording_list_from_query.py b/posthog/session_recordings/queries/session_recording_list_from_query.pyindex 7f37d099b492..d2713dc6990a 100644--- a/posthog/session_recordings/queries/session_recording_list_from_query.py+++ b/posthog/session_recordings/queries/session_recording_list_from_query.py@@ -4,6 +4,7 @@ from typing import Any, Literal, Union, castimport structlogfrom dateutil.relativedelta import relativedeltafrom opentelemetry import trace+from rest_framework.exceptions import PermissionDeniedfrom posthog.schema import (HogQLQueryModifiers,@@ -21,6 +22,7 @@ from posthog.hogql.property import property_to_exprfrom posthog.exceptions_capture import capture_exceptionfrom posthog.hogql_queries.insights.paginators import HogQLCursorPaginator, HogQLHasMorePaginatorfrom posthog.models import Team, User+from posthog.rbac.user_access_control import UserAccessControlErrorfrom posthog.session_recordings.models.metadata import ONGOING_SESSION_WINDOW_MINUTESfrom posthog.session_recordings.queries.sub_queries.base_query import SessionRecordingsListingBaseQueryfrom posthog.session_recordings.queries.sub_queries.cohort_subquery import CohortPropertyGroupsSubQuery@@ -283,6 +285,9 @@ class SessionRecordingListFromQuery(SessionRecordingsListingBaseQuery):if isinstance(parsed_query, ast.SelectSetQuery):raise Exception("replay does not support SelectSetQuery")+ if self._query.experiment_exposure is not None:+ self._join_experiment_exposure(parsed_query)+# Include session_id as a tie-breaker for stable cursor-based paginationparsed_query.order_by = [self._order_by_clause(),@@ -293,6 +298,56 @@ class SessionRecordingListFromQuery(SessionRecordingsListingBaseQuery):]return parsed_query+ def _join_experiment_exposure(self, parsed_query: ast.SelectQuery) -> None:+ """Restrict the list to sessions of persons exposed to the queried experiment.++ The joined subquery carries at most one row per distinct id, so the join never+ duplicates a session's rows; the INNER JOIN drops sessions of unexposed persons at+ the row level. A session recorded under several persons' distinct ids keeps only the+ exposed persons' rows, so its aggregates can shrink slightly; the session itself+ still correctly matches. The companion "session ended at or after first exposure"+ bound lives in `_having_predicates`, because end_time only exists after GROUP BY+ and a row-level bound would drop a qualifying session's pre-exposure rows, skewing+ start_time and the activity aggregates.+ """+ # Deferred: the experiments facade package imports posthog.api on init, which+ # circles back into this module through the replay-deletion temporal activities.+ from products.experiments.backend.facade.replay import ( # noqa: PLC0415+ exposed_distinct_ids_select,+ validate_experiment_exposure_access,+ )++ assert self._query.experiment_exposure is not None+ try:+ validate_experiment_exposure_access(self._team, self._user, self._query.experiment_exposure.experiment_id)+ except UserAccessControlError as error:+ # Only the /query pipeline renders UserAccessControlError; on the recordings API+ # it would surface as a 500, so translate to what DRF renders as a 403.+ raise PermissionDenied(str(error))+ join = parsed_query.select_from+ assert join is not None+ while join.next_join is not None:+ join = join.next_join+ join.next_join = ast.JoinExpr(+ # GLOBAL: the subquery scans events over the whole experiment window; without it,+ # every shard of the sharded replay table re-evaluates that scan independently.+ join_type="GLOBAL INNER JOIN",+ table=exposed_distinct_ids_select(+ self._team,+ experiment_id=self._query.experiment_exposure.experiment_id,+ variant=self._query.experiment_exposure.variant,+ ),+ alias="exposure",+ constraint=ast.JoinConstraint(+ expr=ast.CompareOperation(+ op=ast.CompareOperationOp.Eq,+ left=ast.Field(chain=["exposure", "distinct_id"]),+ right=ast.Field(chain=["s", "distinct_id"]),+ ),+ constraint_type="ON",+ ),+ )+@tracer.start_as_current_span("SessionRecordingListFromQuery._order_by_clause")def _order_by_clause(self) -> ast.OrderExpr:# KLUDGE: we only need a default here because mypy is silly@@ -628,4 +683,15 @@ class SessionRecordingListFromQuery(SessionRecordingsListingBaseQuery):exprs.extend(self._extra_having_predicates)+ # See _join_experiment_exposure for why this bound lives in HAVING. min() is safe+ # because the join carries at most one exposure row per distinct id.+ if self._query.experiment_exposure is not None:+ exprs.append(+ ast.CompareOperation(+ op=ast.CompareOperationOp.GtEq,+ left=ast.Field(chain=["end_time"]),+ right=ast.Call(name="min", args=[ast.Field(chain=["exposure", "first_exposure_time"])]),+ )+ )+return ast.And(exprs=exprs)diff --git a/posthog/session_recordings/queries/test/listing_recordings/test_session_recordings_list_by_experiment_exposure.py b/posthog/session_recordings/queries/test/listing_recordings/test_session_recordings_list_by_experiment_exposure.pynew file mode 100644index 000000000000..c4aa837b5915--- /dev/null+++ b/posthog/session_recordings/queries/test/listing_recordings/test_session_recordings_list_by_experiment_exposure.py@@ -0,0 +1,577 @@+import json+from datetime import UTC, datetime, timedelta++from freezegun import freeze_time+from posthog.test.base import APIBaseTest, ClickhouseTestMixin, _create_event, flush_persons_and_events++from parameterized import parameterized+from rest_framework.exceptions import PermissionDenied, ValidationError++from posthog.schema import RecordingsQuery++from posthog.clickhouse.client import sync_execute+from posthog.constants import AvailableFeature+from posthog.models import User+from posthog.models.personal_api_key import PersonalAPIKey+from posthog.models.utils import generate_random_token_personal, hash_key_value+from posthog.rbac.user_access_control import UserAccessControlError+from posthog.session_recordings.models.session_recording import SessionRecording+from posthog.session_recordings.models.session_recording_playlist import SessionRecordingPlaylist+from posthog.session_recordings.queries.recordings_query_runner import RecordingsQueryRunner+from posthog.session_recordings.queries.session_recording_list_from_query import SessionRecordingListFromQuery+from posthog.session_recordings.queries.test.listing_recordings.test_utils import (+ assert_query_matches_session_ids,+ filter_recordings_by,+)+from posthog.session_recordings.queries.test.session_replay_sql import produce_replay_summary+from posthog.session_recordings.session_recording_api import list_recordings_from_query+from posthog.session_recordings.sql.session_replay_event_sql import TRUNCATE_SESSION_REPLAY_EVENTS_TABLE_SQL+from posthog.test.persons import create_person++from products.experiments.backend.models.experiment import Experiment+from products.feature_flags.backend.models.feature_flag import FeatureFlag++from ee.models.rbac.access_control import AccessControl++FROZEN_NOW = "2021-08-21T20:00:00Z"+BASE_TIME = datetime(2021, 8, 21, 10, 0, tzinfo=UTC)+++@freeze_time(FROZEN_NOW)+class TestSessionRecordingsListByExperimentExposure(ClickhouseTestMixin, APIBaseTest):+ def setUp(self) -> None:+ super().setUp()+ sync_execute(TRUNCATE_SESSION_REPLAY_EVENTS_TABLE_SQL())++ def _create_experiment(+ self,+ exposure_criteria: dict | None = None,+ flag_filters: dict | None = None,+ start_date: datetime | None = BASE_TIME - timedelta(days=1),+ key: str = "recordings-linkage-flag",+ excluded_variants: list[str] | None = None,+ ) -> Experiment:+ flag = FeatureFlag.objects.create(+ team=self.team,+ key=key,+ created_by=self.user,+ filters=flag_filters+ or {+ "groups": [{"properties": [], "rollout_percentage": 100}],+ "multivariate": {+ "variants": [+ {"key": "control", "rollout_percentage": 50},+ {"key": "test", "rollout_percentage": 50},+ ]+ },+ },+ )+ return Experiment.objects.create(+ team=self.team,+ name=f"experiment for {key}",+ feature_flag=flag,+ created_by=self.user,+ start_date=start_date,+ exposure_criteria=exposure_criteria or {},+ excluded_variants=excluded_variants,+ metrics=[],+ )++ def _create_exposure_event(+ self,+ distinct_id: str,+ timestamp: datetime,+ variant: str,+ flag_key: str = "recordings-linkage-flag",+ person_uuid: str | None = None,+ event: str = "$feature_flag_called",+ properties: dict | None = None,+ ) -> None:+ _create_event(+ team=self.team,+ event=event,+ distinct_id=distinct_id,+ timestamp=timestamp,+ properties={+ "$feature_flag": flag_key,+ "$feature_flag_response": variant,+ **(properties or {}),+ },+ **({"person_id": person_uuid} if person_uuid else {}),+ )++ def _produce_recording(self, distinct_id: str, session_id: str, start: datetime, end: datetime) -> None:+ produce_replay_summary(+ team_id=self.team.id,+ session_id=session_id,+ distinct_id=distinct_id,+ first_timestamp=start,+ last_timestamp=end,+ )++ def _assert_query_matches_session_ids(self, query: dict, expected: list[str]) -> None:+ assert_query_matches_session_ids(team=self.team, query=query, expected=expected, user=self.user)++ def test_filters_to_sessions_of_exposed_persons_ending_at_or_after_first_exposure(self) -> None:+ experiment = self._create_experiment()+ create_person(team=self.team, distinct_ids=["exposed-user"])+ create_person(team=self.team, distinct_ids=["other-user"])+ exposure_time = BASE_TIME + timedelta(hours=2)+ self._create_exposure_event("exposed-user", exposure_time, "test")+ flush_persons_and_events()++ self._produce_recording(+ "exposed-user",+ "session-after",+ exposure_time + timedelta(hours=1),+ exposure_time + timedelta(hours=1, minutes=10),+ )+ self._produce_recording(+ "exposed-user",+ "session-spanning",+ exposure_time - timedelta(minutes=10),+ exposure_time + timedelta(minutes=30),+ )+ self._produce_recording("exposed-user", "session-ended-before", BASE_TIME, BASE_TIME + timedelta(minutes=30))+ self._produce_recording(+ "other-user",+ "session-of-unexposed",+ exposure_time + timedelta(hours=1),+ exposure_time + timedelta(hours=1, minutes=10),+ )++ self._assert_query_matches_session_ids(+ {"experiment_exposure": {"experiment_id": experiment.id}},+ ["session-after", "session-spanning"],+ )++ def test_filters_by_variant(self) -> None:+ experiment = self._create_experiment()+ create_person(team=self.team, distinct_ids=["control-user"])+ create_person(team=self.team, distinct_ids=["test-user"])+ exposure_time = BASE_TIME + timedelta(hours=2)+ self._create_exposure_event("control-user", exposure_time, "control")+ self._create_exposure_event("test-user", exposure_time, "test")+ flush_persons_and_events()++ session_start = exposure_time + timedelta(hours=1)+ self._produce_recording("control-user", "session-control", session_start, session_start + timedelta(minutes=10))+ self._produce_recording("test-user", "session-test", session_start, session_start + timedelta(minutes=10))++ self._assert_query_matches_session_ids(+ {"experiment_exposure": {"experiment_id": experiment.id, "variant": "test"}},+ ["session-test"],+ )+ self._assert_query_matches_session_ids(+ {"experiment_exposure": {"experiment_id": experiment.id}},+ ["session-control", "session-test"],+ )++ def test_links_server_side_exposures_through_the_person(self) -> None:+ # The case the person-scoped linkage exists for: the exposure event is captured+ # server-side under a backend distinct id and without a usable $session_id, while the+ # recording belongs to the same person's browser distinct id.+ experiment = self._create_experiment()+ person = create_person(team=self.team, distinct_ids=["server-side-id", "browser-id"])+ exposure_time = BASE_TIME + timedelta(hours=2)+ self._create_exposure_event("server-side-id", exposure_time, "test", person_uuid=str(person.uuid))+ flush_persons_and_events()++ session_start = exposure_time + timedelta(hours=1)+ self._produce_recording(+ "browser-id", "session-on-browser", session_start, session_start + timedelta(minutes=10)+ )++ self._assert_query_matches_session_ids(+ {"experiment_exposure": {"experiment_id": experiment.id}},+ ["session-on-browser"],+ )++ def test_excludes_persons_exposed_to_multiple_variants(self) -> None:+ # Default multiple-variant handling is "exclude": the analysis counts these persons in+ # no variant, so their sessions must not appear as exposed either.+ experiment = self._create_experiment()+ create_person(team=self.team, distinct_ids=["contaminated-user"])+ self._create_exposure_event("contaminated-user", BASE_TIME + timedelta(hours=1), "control")+ self._create_exposure_event("contaminated-user", BASE_TIME + timedelta(hours=2), "test")+ flush_persons_and_events()++ session_start = BASE_TIME + timedelta(hours=3)+ self._produce_recording(+ "contaminated-user", "session-contaminated", session_start, session_start + timedelta(minutes=10)+ )++ self._assert_query_matches_session_ids(+ {"experiment_exposure": {"experiment_id": experiment.id}},+ [],+ )++ def test_excluded_variants_are_invisible_to_the_linkage(self) -> None:+ experiment = self._create_experiment(+ flag_filters={+ "groups": [{"properties": [], "rollout_percentage": 100}],+ "multivariate": {+ "variants": [+ {"key": "control", "rollout_percentage": 50},+ {"key": "test", "rollout_percentage": 25},+ {"key": "beta", "rollout_percentage": 25},+ ]+ },+ },+ excluded_variants=["beta"],+ )+ create_person(team=self.team, distinct_ids=["beta-only-user"])+ create_person(team=self.team, distinct_ids=["control-and-beta-user"])+ exposure_time = BASE_TIME + timedelta(hours=1)+ self._create_exposure_event("beta-only-user", exposure_time, "beta")+ # Exposures to an excluded variant are invisible to the analysis, so this person+ # attributes cleanly to control rather than counting as multiple-variant.+ self._create_exposure_event("control-and-beta-user", exposure_time, "control")+ self._create_exposure_event("control-and-beta-user", exposure_time + timedelta(minutes=5), "beta")+ flush_persons_and_events()++ session_start = exposure_time + timedelta(hours=1)+ self._produce_recording(+ "beta-only-user", "session-of-beta-only", session_start, session_start + timedelta(minutes=10)+ )+ self._produce_recording(+ "control-and-beta-user", "session-of-control", session_start, session_start + timedelta(minutes=10)+ )++ self._assert_query_matches_session_ids(+ {"experiment_exposure": {"experiment_id": experiment.id}},+ ["session-of-control"],+ )+ with self.assertRaises(ValidationError):+ filter_recordings_by(+ team=self.team,+ recordings_filter={"experiment_exposure": {"experiment_id": experiment.id, "variant": "beta"}},+ user=self.user,+ )++ def test_activation_mode_counts_exposure_from_the_activation_event(self) -> None:+ experiment = self._create_experiment(+ exposure_criteria={+ "activation_config": {+ "kind": "ExperimentEventExposureConfig",+ "event": "task_completed",+ "properties": [],+ }+ }+ )+ create_person(team=self.team, distinct_ids=["activated-user"])+ flag_exposure_time = BASE_TIME + timedelta(minutes=30)+ activation_time = BASE_TIME + timedelta(hours=3)+ self._create_exposure_event("activated-user", flag_exposure_time, "test")+ _create_event(+ team=self.team,+ event="task_completed",+ distinct_id="activated-user",+ timestamp=activation_time,+ properties={},+ )+ flush_persons_and_events()++ self._produce_recording(+ "activated-user",+ "session-before-activation",+ BASE_TIME + timedelta(hours=1),+ BASE_TIME + timedelta(hours=1, minutes=30),+ )+ self._produce_recording(+ "activated-user",+ "session-after-activation",+ activation_time + timedelta(minutes=30),+ activation_time + timedelta(minutes=45),+ )++ self._assert_query_matches_session_ids(+ {"experiment_exposure": {"experiment_id": experiment.id}},+ ["session-after-activation"],+ )++ def test_custom_exposure_event_defines_the_exposure_moment(self) -> None:+ experiment = self._create_experiment(+ exposure_criteria={+ "exposure_config": {+ "kind": "ExperimentEventExposureConfig",+ "event": "checkout_started",+ "properties": [],+ }+ }+ )+ create_person(team=self.team, distinct_ids=["custom-exposed-user"])+ flag_call_time = BASE_TIME + timedelta(minutes=30)+ custom_exposure_time = BASE_TIME + timedelta(hours=3)+ # The flag-called event must not count as exposure for custom criteria.+ self._create_exposure_event("custom-exposed-user", flag_call_time, "test")+ # Custom exposure events carry the variant in the stamped flag property.+ _create_event(+ team=self.team,+ event="checkout_started",+ distinct_id="custom-exposed-user",+ timestamp=custom_exposure_time,+ properties={"$feature/recordings-linkage-flag": "test"},+ )+ flush_persons_and_events()++ self._produce_recording(+ "custom-exposed-user",+ "session-before-custom",+ BASE_TIME + timedelta(hours=1),+ BASE_TIME + timedelta(hours=1, minutes=30),+ )+ self._produce_recording(+ "custom-exposed-user",+ "session-after-custom",+ custom_exposure_time + timedelta(minutes=30),+ custom_exposure_time + timedelta(minutes=45),+ )++ self._assert_query_matches_session_ids(+ {"experiment_exposure": {"experiment_id": experiment.id}},+ ["session-after-custom"],+ )++ @parameterized.expand(+ [+ ("unknown_experiment", None, None),+ ("draft_experiment", {"start_date": None, "key": "draft-flag"}, None),+ (+ "group_aggregated_experiment",+ {+ "key": "group-flag",+ "flag_filters": {+ "groups": [{"properties": [], "rollout_percentage": 100}],+ "aggregation_group_type_index": 0,+ "multivariate": {+ "variants": [+ {"key": "control", "rollout_percentage": 50},+ {"key": "test", "rollout_percentage": 50},+ ]+ },+ },+ },+ None,+ ),+ ("unknown_variant", {"key": "variant-check-flag"}, "nope"),+ ]+ )+ def test_rejects_experiments_the_linkage_cannot_answer_for(+ self, _name: str, experiment_kwargs: dict | None, variant: str | None+ ) -> None:+ experiment_id = self._create_experiment(**experiment_kwargs).id if experiment_kwargs is not None else 999999+ exposure_filter: dict = {"experiment_id": experiment_id}+ if variant is not None:+ exposure_filter["variant"] = variant++ with self.assertRaises(ValidationError):+ filter_recordings_by(+ team=self.team, recordings_filter={"experiment_exposure": exposure_filter}, user=self.user+ )++ def test_composes_with_event_filters(self) -> None:+ experiment = self._create_experiment()+ create_person(team=self.team, distinct_ids=["exposed-user"])+ exposure_time = BASE_TIME + timedelta(hours=1)+ self._create_exposure_event("exposed-user", exposure_time, "test")++ with_event_session = "session-with-purchase"+ without_event_session = "session-without-purchase"+ first_session_start = exposure_time + timedelta(hours=1)+ second_session_start = exposure_time + timedelta(hours=2)+ _create_event(+ team=self.team,+ event="purchase_completed",+ distinct_id="exposed-user",+ timestamp=first_session_start + timedelta(minutes=1),+ properties={"$session_id": with_event_session},+ )+ flush_persons_and_events()++ self._produce_recording(+ "exposed-user", with_event_session, first_session_start, first_session_start + timedelta(minutes=10)+ )+ self._produce_recording(+ "exposed-user", without_event_session, second_session_start, second_session_start + timedelta(minutes=10)+ )++ self._assert_query_matches_session_ids(+ {+ "experiment_exposure": {"experiment_id": experiment.id},+ "events": [{"id": "purchase_completed", "type": "events", "name": "purchase_completed"}],+ },+ [with_event_session],+ )+ self._assert_query_matches_session_ids(+ {"experiment_exposure": {"experiment_id": experiment.id}},+ [with_event_session, without_event_session],+ )++ def test_persisted_pinned_recordings_still_go_through_the_exposure_filter(self) -> None:+ # Recordings persisted to S3 are normally served straight from Postgres when queried by+ # session id, skipping the ClickHouse query the exposure join lives in; with the filter+ # set they must take the ClickHouse path so unexposed persons' sessions stay out.+ experiment = self._create_experiment()+ create_person(team=self.team, distinct_ids=["exposed-user"])+ create_person(team=self.team, distinct_ids=["other-user"])+ exposure_time = BASE_TIME + timedelta(hours=1)+ self._create_exposure_event("exposed-user", exposure_time, "test")+ flush_persons_and_events()++ session_start = exposure_time + timedelta(hours=1)+ self._produce_recording(+ "exposed-user", "session-of-exposed", session_start, session_start + timedelta(minutes=10)+ )+ self._produce_recording(+ "other-user", "session-of-unexposed", session_start, session_start + timedelta(minutes=10)+ )+ for session_id in ("session-of-exposed", "session-of-unexposed"):+ SessionRecording.objects.create(+ team=self.team, session_id=session_id, full_recording_v2_path=f"s3://bucket/{session_id}"+ )++ result = list_recordings_from_query(+ RecordingsQuery.model_validate(+ {+ "session_ids": ["session-of-exposed", "session-of-unexposed"],+ "experiment_exposure": {"experiment_id": experiment.id},+ }+ ),+ user=self.user,+ team=self.team,+ )++ assert [recording.session_id for recording in result.recordings] == ["session-of-exposed"]++ def _create_denied_experiment_and_viewer(self) -> tuple[Experiment, User]:+ self.organization.available_product_features = [+ {"key": AvailableFeature.ACCESS_CONTROL, "name": AvailableFeature.ACCESS_CONTROL}+ ]+ self.organization.save()+ experiment = self._create_experiment()+ AccessControl.objects.create(+ team=self.team, resource="experiment", resource_id=str(experiment.pk), access_level="none"+ )+ return experiment, self._create_user("[email protected]")++ def test_denies_viewers_the_experiment_denies(self) -> None:+ # The filter reveals which recordings belong to an experiment's exposed persons, so a+ # viewer barred from the experiment must not be able to list them.+ experiment, denied_viewer = self._create_denied_experiment_and_viewer()+ query = RecordingsQuery.model_validate({"experiment_exposure": {"experiment_id": experiment.id}})++ with self.assertRaises(PermissionDenied):+ SessionRecordingListFromQuery(+ team=self.team, query=query, hogql_query_modifiers=None, user=denied_viewer+ ).run()++ # The creator keeps access despite the team-wide "none".+ result = SessionRecordingListFromQuery(+ team=self.team, query=query, hogql_query_modifiers=None, user=self.user+ ).run()+ assert result.results == []++ def test_refuses_userless_callers(self) -> None:+ # Userless background jobs (the playlist counting task, scanner sweeps) cache or surface+ # their output to viewers this check never evaluated, so the filter fails closed without+ # a viewer, regardless of the experiment's access controls.+ experiment = self._create_experiment()+ query = RecordingsQuery.model_validate({"experiment_exposure": {"experiment_id": experiment.id}})++ with self.assertRaises(PermissionDenied):+ SessionRecordingListFromQuery(team=self.team, query=query, hogql_query_modifiers=None, user=None).run()++ def test_query_runner_refuses_denied_viewers_before_running(self) -> None:+ # The generic query endpoint serves cached responses without rebuilding the query, so+ # only the runner-level hook keeps a denied viewer from reading a cached list.+ experiment, denied_viewer = self._create_denied_experiment_and_viewer()+ runner = RecordingsQueryRunner(+ query=RecordingsQuery.model_validate({"experiment_exposure": {"experiment_id": experiment.id}}),+ team=self.team,+ )++ with self.assertRaises(UserAccessControlError):+ runner.validate_query_runner_access(denied_viewer)++ # Without the filter there is no experiment to protect; the same viewer passes.+ unfiltered = RecordingsQueryRunner(query=RecordingsQuery.model_validate({}), team=self.team)+ assert unfiltered.validate_query_runner_access(denied_viewer) is True++ @parameterized.expand(+ [+ ("query_scope_only", ["query:read"], True, 403),+ ("with_experiment_scope", ["query:read", "experiment:read"], True, 200),+ ("no_filter_needs_no_experiment_scope", ["query:read"], False, 200),+ ]+ )+ def test_query_endpoint_scope_parity_for_api_keys(+ self, _name: str, scopes: list[str], with_filter: bool, expected_status: int+ ) -> None:+ experiment = self._create_experiment()+ value = generate_random_token_personal()+ PersonalAPIKey.objects.create(label="test", user=self.user, secure_value=hash_key_value(value), scopes=scopes)+ query: dict = {"kind": "RecordingsQuery"}+ if with_filter:+ query["experiment_exposure"] = {"experiment_id": experiment.id}++ response = self.client.post(+ f"/api/projects/{self.team.pk}/query/",+ {"query": query},+ HTTP_AUTHORIZATION=f"Bearer {value}",+ )++ assert response.status_code == expected_status, response.json()++ @parameterized.expand(+ [+ ("replay_scope_only", ["session_recording:read"], True, 403),+ ("with_experiment_scope", ["session_recording:read", "experiment:read"], True, 200),+ ("no_filter_needs_no_experiment_scope", ["session_recording:read"], False, 200),+ ]+ )+ def test_list_endpoint_scope_parity_for_api_keys(+ self, _name: str, scopes: list[str], with_filter: bool, expected_status: int+ ) -> None:+ experiment = self._create_experiment()+ value = generate_random_token_personal()+ PersonalAPIKey.objects.create(label="test", user=self.user, secure_value=hash_key_value(value), scopes=scopes)+ params = {"experiment_exposure": json.dumps({"experiment_id": experiment.id})} if with_filter else {}++ response = self.client.get(+ f"/api/projects/{self.team.pk}/session_recordings/",+ params,+ HTTP_AUTHORIZATION=f"Bearer {value}",+ )++ assert response.status_code == expected_status, response.content++ @parameterized.expand(+ [+ ("playlist_scope_only", ["session_recording_playlist:read"], True, 403),+ ("with_experiment_scope", ["session_recording_playlist:read", "experiment:read"], True, 200),+ ("no_filter_needs_no_experiment_scope", ["session_recording_playlist:read"], False, 200),+ ]+ )+ def test_playlist_recordings_endpoint_scope_parity_for_api_keys(+ self, _name: str, scopes: list[str], with_filter: bool, expected_status: int+ ) -> None:+ # A filters playlist's recordings action parses the same query params into a+ # RecordingsQuery as the recordings list, so without the conditional scope a+ # playlist-read token could read which recordings belong to an experiment's+ # exposed population, per variant.+ experiment = self._create_experiment()+ playlist = SessionRecordingPlaylist.objects.create(+ team=self.team, created_by=self.user, type=SessionRecordingPlaylist.PlaylistType.FILTERS+ )+ value = generate_random_token_personal()+ PersonalAPIKey.objects.create(label="test", user=self.user, secure_value=hash_key_value(value), scopes=scopes)+ params = {"experiment_exposure": json.dumps({"experiment_id": experiment.id})} if with_filter else {}++ response = self.client.get(+ f"/api/projects/{self.team.pk}/session_recording_playlists/{playlist.short_id}/recordings",+ params,+ HTTP_AUTHORIZATION=f"Bearer {value}",+ )++ assert response.status_code == expected_status, response.contentdiff --git a/posthog/session_recordings/queries/test/listing_recordings/test_utils.py b/posthog/session_recordings/queries/test/listing_recordings/test_utils.pyindex a601b89be885..0cdb397038d9 100644--- a/posthog/session_recordings/queries/test/listing_recordings/test_utils.py+++ b/posthog/session_recordings/queries/test/listing_recordings/test_utils.py@@ -4,7 +4,7 @@ from posthog.test.base import _create_eventfrom posthog.schema import RecordingsQuery-from posthog.models import Team+from posthog.models import Team, Userfrom posthog.session_recordings.queries.session_recording_list_from_query import (SessionRecordingListFromQuery,SessionRecordingQueryResult,@@ -31,7 +31,10 @@ def create_event(def filter_recordings_by(- team: Team, recordings_filter: dict | None = None, allow_event_property_expansion: bool = False+ team: Team,+ recordings_filter: dict | None = None,+ allow_event_property_expansion: bool = False,+ user: User | None = None,) -> SessionRecordingQueryResult:the_query = RecordingsQuery.model_validate(query_as_params_to_dict(recordings_filter or {}))session_recording_list_instance = SessionRecordingListFromQuery(@@ -39,6 +42,7 @@ def filter_recordings_by(team=team,hogql_query_modifiers=None,allow_event_property_expansion=allow_event_property_expansion,+ user=user,)return session_recording_list_instance.run()@@ -49,9 +53,10 @@ def assert_query_matches_session_ids(expected: list[str],sort_results_when_asserting: bool = True,allow_event_property_expansion: bool = False,+ user: User | None = None,) -> None:(session_recordings, more_recordings_available, _, _) = filter_recordings_by(- team=team, recordings_filter=query, allow_event_property_expansion=allow_event_property_expansion+ team=team, recordings_filter=query, allow_event_property_expansion=allow_event_property_expansion, user=user)# in some tests we care about the order of results e.g. when testing sortingdiff --git a/posthog/session_recordings/session_recording_api.py b/posthog/session_recordings/session_recording_api.pyindex 5b6e7f81179f..2dd5779a242f 100644--- a/posthog/session_recordings/session_recording_api.py+++ b/posthog/session_recordings/session_recording_api.py@@ -825,6 +825,14 @@ class SessionRecordingViewSet(sharing_enabled_actions = ["retrieve", "snapshots", "snapshot_file"]+ def dangerously_get_required_scopes(self, request: Request, view: Any) -> list[str] | None:+ # Scope parity with the experiments API: the experiment_exposure filter reads+ # experiment data through the recordings list, so a token needs experiment:read on+ # top of the replay scope. The result replaces the default, so both are listed.+ if getattr(view, "action", None) == "list" and request.query_params.get("experiment_exposure"):+ return ["session_recording:read", "experiment:read"]+ return None+def get_serializer_class(self) -> type[serializers.Serializer]:if isinstance(self.request.successful_authenticator, SharingAccessTokenAuthentication):return SessionRecordingSharedSerializer@@ -1755,6 +1763,7 @@ def _load_recording_if_matches_filters(session_id: str,query: RecordingsQuery,team: Team,+ user: User | None,allow_event_property_expansion: bool,) -> SessionRecording | None:"""@@ -1779,6 +1788,7 @@ def _load_recording_if_matches_filters(ch_query_result = SessionRecordingListFromQuery(query=prepend_check_query,team=team,+ user=user,hogql_query_modifiers=None,allow_event_property_expansion=allow_event_property_expansion,).run()@@ -1855,6 +1865,7 @@ def list_recordings_from_query(session_recording_id_to_prepend,query,team,+ user,allow_event_property_expansion,)if prepend_recording is None:@@ -1864,7 +1875,14 @@ def list_recordings_from_query(if prepend_recording:recordings.append(prepend_recording)- if all_session_ids:+ if all_session_ids and query.experiment_exposure is not None:+ # The exposure filter only exists as a join in the ClickHouse query, so the persisted+ # Postgres shortcut below would return these sessions unfiltered and skip the+ # experiment access check with them. Route every requested id through ClickHouse+ # instead; a persisted recording that has left ClickHouse can't be verified as an+ # exposed person's and so stays out of the list.+ remaining_session_ids = list(all_session_ids)+ elif all_session_ids:with timer("load_persisted_recordings"), tracer.start_as_current_span("load_persisted_recordings"):# If we specify the session ids (like from pinned recordings) we can optimise by only going to Postgressorted_session_ids = sorted(all_session_ids)@@ -1911,6 +1929,7 @@ def list_recordings_from_query(query_result = SessionRecordingListFromQuery(query=query_for_list,team=team,+ user=user,hogql_query_modifiers=None,allow_event_property_expansion=allow_event_property_expansion,session_ids_to_exclude=session_ids_to_exclude,diff --git a/posthog/session_recordings/session_recording_playlist_api.py b/posthog/session_recordings/session_recording_playlist_api.pyindex 254695365bcc..8367fd91e1cd 100644--- a/posthog/session_recordings/session_recording_playlist_api.py+++ b/posthog/session_recordings/session_recording_playlist_api.py@@ -639,6 +639,14 @@ class SessionRecordingPlaylistViewSet(filterset_fields = ["short_id", "created_by"]lookup_field = "short_id"+ def dangerously_get_required_scopes(self, request: request.Request, view: Any) -> list[str] | None:+ # Scope parity with the recordings list: a filters playlist's recordings action parses+ # the same query params into a RecordingsQuery, so the experiment_exposure filter reads+ # experiment data here too. The result replaces the default, so both are listed.+ if getattr(view, "action", None) == "recordings" and request.query_params.get("experiment_exposure"):+ return ["session_recording_playlist:read", "experiment:read"]+ return None+def safely_get_object(self, queryset: QuerySet) -> SessionRecordingPlaylist:"""Override to handle synthetic playlists in retrieve actions"""lookup_value = self.kwargs.get(self.lookup_field)diff --git a/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr b/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambrindex ddc902a3d538..f650873c2e21 100644--- a/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr+++ b/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr@@ -98,6 +98,44 @@'''# ---# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.10+ '''+ SELECT "posthog_externaldatasource"."created_by_id",+ "posthog_externaldatasource"."created_at",+ "posthog_externaldatasource"."updated_at",+ "posthog_externaldatasource"."deleted",+ "posthog_externaldatasource"."deleted_at",+ "posthog_externaldatasource"."id",+ "posthog_externaldatasource"."source_id",+ "posthog_externaldatasource"."connection_id",+ "posthog_externaldatasource"."destination_id",+ "posthog_externaldatasource"."team_id",+ "posthog_externaldatasource"."sync_frequency",+ "posthog_externaldatasource"."status",+ "posthog_externaldatasource"."source_type",+ "posthog_externaldatasource"."api_version",+ "posthog_externaldatasource"."job_inputs",+ "posthog_externaldatasource"."connection_metadata",+ "posthog_externaldatasource"."are_tables_created",+ "posthog_externaldatasource"."prefix",+ "posthog_externaldatasource"."description",+ "posthog_externaldatasource"."created_via",+ "posthog_externaldatasource"."access_method",+ "posthog_externaldatasource"."direct_query_enabled",+ "posthog_externaldatasource"."auto_sync_new_schemas",+ "posthog_externaldatasource"."auto_sync_schema_patterns",+ "posthog_externaldatasource"."revenue_analytics_enabled",+ "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",+ "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",+ "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"+ FROM "posthog_externaldatasource"+ LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")+ WHERE ("posthog_externaldatasource"."source_type" IN ('Stripe')+ AND "posthog_externaldatasource"."team_id" = 99999+ AND NOT ("posthog_externaldatasource"."deleted"+ AND "posthog_externaldatasource"."deleted" IS NOT NULL))+ '''+# ---+# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.11'''SELECT "posthog_datawarehousetable"."created_by_id","posthog_datawarehousetable"."created_at",@@ -170,7 +208,7 @@ORDER BY "posthog_datawarehousetable"."created_at" DESC'''# ----# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.11+# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.12'''SELECT "posthog_datawarehousejoin"."created_by_id","posthog_datawarehousejoin"."created_at",@@ -190,7 +228,7 @@AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.12+# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.13'''SELECT "data_tools_datawarehouseexpression"."deleted","data_tools_datawarehouseexpression"."deleted_at",@@ -209,7 +247,7 @@AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)'''# ----# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.13+# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.14'''SELECT "posthog_sessionrecording"."id","posthog_sessionrecording"."session_id",@@ -240,7 +278,7 @@AND "posthog_sessionrecording"."team_id" = 99999)'''# ----# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.14+# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.15'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"FROM "posthog_sessionrecordingviewed"@@ -251,7 +289,7 @@'old_session'))'''# ----# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.15+# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.16'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id","posthog_user"."email" AS "user__email"@@ -534,6 +572,59 @@'''# ---# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.6+ '''+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21+ '''+# ---+# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.7'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -635,7 +726,7 @@ORDER BY "posthog_datawarehousesavedquery"."name" ASC'''# ----# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.7+# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.8'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -729,7 +820,7 @@AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.8+# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.9'''SELECT "posthog_teamrevenueanalyticsconfig"."team_id","posthog_teamrevenueanalyticsconfig"."filter_test_accounts",@@ -742,44 +833,6 @@LIMIT 21'''# ----# name: TestSessionRecordings.test_get_session_recordings_returns_newest_first.9- '''- SELECT "posthog_externaldatasource"."created_by_id",- "posthog_externaldatasource"."created_at",- "posthog_externaldatasource"."updated_at",- "posthog_externaldatasource"."deleted",- "posthog_externaldatasource"."deleted_at",- "posthog_externaldatasource"."id",- "posthog_externaldatasource"."source_id",- "posthog_externaldatasource"."connection_id",- "posthog_externaldatasource"."destination_id",- "posthog_externaldatasource"."team_id",- "posthog_externaldatasource"."sync_frequency",- "posthog_externaldatasource"."status",- "posthog_externaldatasource"."source_type",- "posthog_externaldatasource"."api_version",- "posthog_externaldatasource"."job_inputs",- "posthog_externaldatasource"."connection_metadata",- "posthog_externaldatasource"."are_tables_created",- "posthog_externaldatasource"."prefix",- "posthog_externaldatasource"."description",- "posthog_externaldatasource"."created_via",- "posthog_externaldatasource"."access_method",- "posthog_externaldatasource"."direct_query_enabled",- "posthog_externaldatasource"."auto_sync_new_schemas",- "posthog_externaldatasource"."auto_sync_schema_patterns",- "posthog_externaldatasource"."revenue_analytics_enabled",- "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",- "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",- "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"- FROM "posthog_externaldatasource"- LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")- WHERE ("posthog_externaldatasource"."source_type" IN ('Stripe')- AND "posthog_externaldatasource"."team_id" = 99999- AND NOT ("posthog_externaldatasource"."deleted"- AND "posthog_externaldatasource"."deleted" IS NOT NULL))- '''-# ---# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing'''SELECT "posthog_user"."id",@@ -871,6 +924,44 @@'''# ---# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.10+ '''+ SELECT "posthog_externaldatasource"."created_by_id",+ "posthog_externaldatasource"."created_at",+ "posthog_externaldatasource"."updated_at",+ "posthog_externaldatasource"."deleted",+ "posthog_externaldatasource"."deleted_at",+ "posthog_externaldatasource"."id",+ "posthog_externaldatasource"."source_id",+ "posthog_externaldatasource"."connection_id",+ "posthog_externaldatasource"."destination_id",+ "posthog_externaldatasource"."team_id",+ "posthog_externaldatasource"."sync_frequency",+ "posthog_externaldatasource"."status",+ "posthog_externaldatasource"."source_type",+ "posthog_externaldatasource"."api_version",+ "posthog_externaldatasource"."job_inputs",+ "posthog_externaldatasource"."connection_metadata",+ "posthog_externaldatasource"."are_tables_created",+ "posthog_externaldatasource"."prefix",+ "posthog_externaldatasource"."description",+ "posthog_externaldatasource"."created_via",+ "posthog_externaldatasource"."access_method",+ "posthog_externaldatasource"."direct_query_enabled",+ "posthog_externaldatasource"."auto_sync_new_schemas",+ "posthog_externaldatasource"."auto_sync_schema_patterns",+ "posthog_externaldatasource"."revenue_analytics_enabled",+ "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",+ "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",+ "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"+ FROM "posthog_externaldatasource"+ LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")+ WHERE ("posthog_externaldatasource"."source_type" IN ('Stripe')+ AND "posthog_externaldatasource"."team_id" = 99999+ AND NOT ("posthog_externaldatasource"."deleted"+ AND "posthog_externaldatasource"."deleted" IS NOT NULL))+ '''+# ---+# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.11'''SELECT "posthog_datawarehousetable"."created_by_id","posthog_datawarehousetable"."created_at",@@ -943,7 +1034,7 @@ORDER BY "posthog_datawarehousetable"."created_at" DESC'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.11+# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.12'''SELECT "posthog_datawarehousejoin"."created_by_id","posthog_datawarehousejoin"."created_at",@@ -963,7 +1054,7 @@AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.12+# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.13'''SELECT "data_tools_datawarehouseexpression"."deleted","data_tools_datawarehouseexpression"."deleted_at",@@ -982,7 +1073,7 @@AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.13+# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.14'''SELECT "posthog_sessionrecording"."id","posthog_sessionrecording"."session_id",@@ -1012,7 +1103,7 @@AND "posthog_sessionrecording"."team_id" = 99999)'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.14+# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.15'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"FROM "posthog_sessionrecordingviewed"@@ -1022,7 +1113,7 @@'session1'))'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.15+# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.16'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id","posthog_user"."email" AS "user__email"@@ -1304,6 +1395,59 @@'''# ---# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.6+ '''+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21+ '''+# ---+# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.7'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -1405,7 +1549,7 @@ORDER BY "posthog_datawarehousesavedquery"."name" ASC'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.7+# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.8'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -1499,7 +1643,7 @@AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.8+# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.9'''SELECT "posthog_teamrevenueanalyticsconfig"."team_id","posthog_teamrevenueanalyticsconfig"."filter_test_accounts",@@ -1512,45 +1656,7 @@LIMIT 21'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_0_basic_listing.9- '''- SELECT "posthog_externaldatasource"."created_by_id",- "posthog_externaldatasource"."created_at",- "posthog_externaldatasource"."updated_at",- "posthog_externaldatasource"."deleted",- "posthog_externaldatasource"."deleted_at",- "posthog_externaldatasource"."id",- "posthog_externaldatasource"."source_id",- "posthog_externaldatasource"."connection_id",- "posthog_externaldatasource"."destination_id",- "posthog_externaldatasource"."team_id",- "posthog_externaldatasource"."sync_frequency",- "posthog_externaldatasource"."status",- "posthog_externaldatasource"."source_type",- "posthog_externaldatasource"."api_version",- "posthog_externaldatasource"."job_inputs",- "posthog_externaldatasource"."connection_metadata",- "posthog_externaldatasource"."are_tables_created",- "posthog_externaldatasource"."prefix",- "posthog_externaldatasource"."description",- "posthog_externaldatasource"."created_via",- "posthog_externaldatasource"."access_method",- "posthog_externaldatasource"."direct_query_enabled",- "posthog_externaldatasource"."auto_sync_new_schemas",- "posthog_externaldatasource"."auto_sync_schema_patterns",- "posthog_externaldatasource"."revenue_analytics_enabled",- "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",- "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",- "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"- FROM "posthog_externaldatasource"- LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")- WHERE ("posthog_externaldatasource"."source_type" IN ('Stripe')- AND "posthog_externaldatasource"."team_id" = 99999- AND NOT ("posthog_externaldatasource"."deleted"- AND "posthog_externaldatasource"."deleted" IS NOT NULL))- '''-# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots'''SELECT "posthog_user"."id","posthog_user"."password",@@ -1641,6 +1747,44 @@'''# ---# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.10+ '''+ SELECT "posthog_externaldatasource"."created_by_id",+ "posthog_externaldatasource"."created_at",+ "posthog_externaldatasource"."updated_at",+ "posthog_externaldatasource"."deleted",+ "posthog_externaldatasource"."deleted_at",+ "posthog_externaldatasource"."id",+ "posthog_externaldatasource"."source_id",+ "posthog_externaldatasource"."connection_id",+ "posthog_externaldatasource"."destination_id",+ "posthog_externaldatasource"."team_id",+ "posthog_externaldatasource"."sync_frequency",+ "posthog_externaldatasource"."status",+ "posthog_externaldatasource"."source_type",+ "posthog_externaldatasource"."api_version",+ "posthog_externaldatasource"."job_inputs",+ "posthog_externaldatasource"."connection_metadata",+ "posthog_externaldatasource"."are_tables_created",+ "posthog_externaldatasource"."prefix",+ "posthog_externaldatasource"."description",+ "posthog_externaldatasource"."created_via",+ "posthog_externaldatasource"."access_method",+ "posthog_externaldatasource"."direct_query_enabled",+ "posthog_externaldatasource"."auto_sync_new_schemas",+ "posthog_externaldatasource"."auto_sync_schema_patterns",+ "posthog_externaldatasource"."revenue_analytics_enabled",+ "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",+ "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",+ "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"+ FROM "posthog_externaldatasource"+ LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")+ WHERE ("posthog_externaldatasource"."source_type" IN ('Stripe')+ AND "posthog_externaldatasource"."team_id" = 99999+ AND NOT ("posthog_externaldatasource"."deleted"+ AND "posthog_externaldatasource"."deleted" IS NOT NULL))+ '''+# ---+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.11'''SELECT "posthog_datawarehousetable"."created_by_id","posthog_datawarehousetable"."created_at",@@ -1713,7 +1857,7 @@ORDER BY "posthog_datawarehousetable"."created_at" DESC'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.11+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.12'''SELECT "posthog_datawarehousejoin"."created_by_id","posthog_datawarehousejoin"."created_at",@@ -1733,7 +1877,7 @@AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.12+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.13'''SELECT "data_tools_datawarehouseexpression"."deleted","data_tools_datawarehouseexpression"."deleted_at",@@ -1752,7 +1896,7 @@AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.13+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.14'''SELECT "posthog_sessionrecording"."id","posthog_sessionrecording"."session_id",@@ -1781,7 +1925,7 @@AND "posthog_sessionrecording"."team_id" = 99999)'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.14+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.15'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"FROM "posthog_sessionrecordingviewed"@@ -1790,7 +1934,7 @@AND "posthog_sessionrecordingviewed"."session_id" IN ('session_with_duration'))'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.15+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.16'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id","posthog_user"."email" AS "user__email"@@ -2071,6 +2215,59 @@'''# ---# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.6+ '''+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21+ '''+# ---+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.7'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -2172,7 +2369,7 @@ORDER BY "posthog_datawarehousesavedquery"."name" ASC'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.7+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.8'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -2266,7 +2463,7 @@AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.8+# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.9'''SELECT "posthog_teamrevenueanalyticsconfig"."team_id","posthog_teamrevenueanalyticsconfig"."filter_test_accounts",@@ -2279,44 +2476,6 @@LIMIT 21'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_1_multiple_snapshots.9- '''- SELECT "posthog_externaldatasource"."created_by_id",- "posthog_externaldatasource"."created_at",- "posthog_externaldatasource"."updated_at",- "posthog_externaldatasource"."deleted",- "posthog_externaldatasource"."deleted_at",- "posthog_externaldatasource"."id",- "posthog_externaldatasource"."source_id",- "posthog_externaldatasource"."connection_id",- "posthog_externaldatasource"."destination_id",- "posthog_externaldatasource"."team_id",- "posthog_externaldatasource"."sync_frequency",- "posthog_externaldatasource"."status",- "posthog_externaldatasource"."source_type",- "posthog_externaldatasource"."api_version",- "posthog_externaldatasource"."job_inputs",- "posthog_externaldatasource"."connection_metadata",- "posthog_externaldatasource"."are_tables_created",- "posthog_externaldatasource"."prefix",- "posthog_externaldatasource"."description",- "posthog_externaldatasource"."created_via",- "posthog_externaldatasource"."access_method",- "posthog_externaldatasource"."direct_query_enabled",- "posthog_externaldatasource"."auto_sync_new_schemas",- "posthog_externaldatasource"."auto_sync_schema_patterns",- "posthog_externaldatasource"."revenue_analytics_enabled",- "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",- "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",- "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"- FROM "posthog_externaldatasource"- LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")- WHERE ("posthog_externaldatasource"."source_type" IN ('Stripe')- AND "posthog_externaldatasource"."team_id" = 99999- AND NOT ("posthog_externaldatasource"."deleted"- AND "posthog_externaldatasource"."deleted" IS NOT NULL))- '''-# ---# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids'''SELECT "posthog_user"."id",@@ -2408,6 +2567,44 @@'''# ---# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.10+ '''+ SELECT "posthog_externaldatasource"."created_by_id",+ "posthog_externaldatasource"."created_at",+ "posthog_externaldatasource"."updated_at",+ "posthog_externaldatasource"."deleted",+ "posthog_externaldatasource"."deleted_at",+ "posthog_externaldatasource"."id",+ "posthog_externaldatasource"."source_id",+ "posthog_externaldatasource"."connection_id",+ "posthog_externaldatasource"."destination_id",+ "posthog_externaldatasource"."team_id",+ "posthog_externaldatasource"."sync_frequency",+ "posthog_externaldatasource"."status",+ "posthog_externaldatasource"."source_type",+ "posthog_externaldatasource"."api_version",+ "posthog_externaldatasource"."job_inputs",+ "posthog_externaldatasource"."connection_metadata",+ "posthog_externaldatasource"."are_tables_created",+ "posthog_externaldatasource"."prefix",+ "posthog_externaldatasource"."description",+ "posthog_externaldatasource"."created_via",+ "posthog_externaldatasource"."access_method",+ "posthog_externaldatasource"."direct_query_enabled",+ "posthog_externaldatasource"."auto_sync_new_schemas",+ "posthog_externaldatasource"."auto_sync_schema_patterns",+ "posthog_externaldatasource"."revenue_analytics_enabled",+ "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",+ "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",+ "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"+ FROM "posthog_externaldatasource"+ LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")+ WHERE ("posthog_externaldatasource"."source_type" IN ('Stripe')+ AND "posthog_externaldatasource"."team_id" = 99999+ AND NOT ("posthog_externaldatasource"."deleted"+ AND "posthog_externaldatasource"."deleted" IS NOT NULL))+ '''+# ---+# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.11'''SELECT "posthog_datawarehousetable"."created_by_id","posthog_datawarehousetable"."created_at",@@ -2480,7 +2677,7 @@ORDER BY "posthog_datawarehousetable"."created_at" DESC'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.11+# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.12'''SELECT "posthog_datawarehousejoin"."created_by_id","posthog_datawarehousejoin"."created_at",@@ -2500,7 +2697,7 @@AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.12+# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.13'''SELECT "data_tools_datawarehouseexpression"."deleted","data_tools_datawarehouseexpression"."deleted_at",@@ -2519,7 +2716,7 @@AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.13+# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.14'''SELECT "posthog_sessionrecording"."id","posthog_sessionrecording"."session_id",@@ -2548,7 +2745,7 @@AND "posthog_sessionrecording"."team_id" = 99999)'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.14+# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.15'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"FROM "posthog_sessionrecordingviewed"@@ -2557,7 +2754,7 @@AND "posthog_sessionrecordingviewed"."session_id" IN ('session_many_ids'))'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.15+# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.16'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id","posthog_user"."email" AS "user__email"@@ -2839,43 +3036,96 @@# ---# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.6'''- SELECT "posthog_datawarehousesavedquery"."created_by_id",- "posthog_datawarehousesavedquery"."created_at",- "posthog_datawarehousesavedquery"."updated_at",- "posthog_datawarehousesavedquery"."deleted",- "posthog_datawarehousesavedquery"."deleted_at",- "posthog_datawarehousesavedquery"."id",- "posthog_datawarehousesavedquery"."name",- "posthog_datawarehousesavedquery"."team_id",- "posthog_datawarehousesavedquery"."latest_error",- "posthog_datawarehousesavedquery"."columns",- "posthog_datawarehousesavedquery"."column_order",- "posthog_datawarehousesavedquery"."external_tables",- "posthog_datawarehousesavedquery"."query",- "posthog_datawarehousesavedquery"."status",- "posthog_datawarehousesavedquery"."last_run_at",- "posthog_datawarehousesavedquery"."sync_frequency_interval",- "posthog_datawarehousesavedquery"."table_id",- "posthog_datawarehousesavedquery"."is_materialized",- "posthog_datawarehousesavedquery"."deleted_name",- "posthog_datawarehousesavedquery"."managed_viewset_id",- "posthog_datawarehousesavedquery"."folder_id",- "posthog_datawarehousesavedquery"."origin",- "posthog_datawarehousesavedquery"."is_test",- "posthog_datawarehousesavedquery"."expires_at",- "posthog_datawarehousesavedquery"."semantic_enrichment_hash",- "posthog_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",+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21+ '''+# ---+# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.7+ '''+ SELECT "posthog_datawarehousesavedquery"."created_by_id",+ "posthog_datawarehousesavedquery"."created_at",+ "posthog_datawarehousesavedquery"."updated_at",+ "posthog_datawarehousesavedquery"."deleted",+ "posthog_datawarehousesavedquery"."deleted_at",+ "posthog_datawarehousesavedquery"."id",+ "posthog_datawarehousesavedquery"."name",+ "posthog_datawarehousesavedquery"."team_id",+ "posthog_datawarehousesavedquery"."latest_error",+ "posthog_datawarehousesavedquery"."columns",+ "posthog_datawarehousesavedquery"."column_order",+ "posthog_datawarehousesavedquery"."external_tables",+ "posthog_datawarehousesavedquery"."query",+ "posthog_datawarehousesavedquery"."status",+ "posthog_datawarehousesavedquery"."last_run_at",+ "posthog_datawarehousesavedquery"."sync_frequency_interval",+ "posthog_datawarehousesavedquery"."table_id",+ "posthog_datawarehousesavedquery"."is_materialized",+ "posthog_datawarehousesavedquery"."deleted_name",+ "posthog_datawarehousesavedquery"."managed_viewset_id",+ "posthog_datawarehousesavedquery"."folder_id",+ "posthog_datawarehousesavedquery"."origin",+ "posthog_datawarehousesavedquery"."is_test",+ "posthog_datawarehousesavedquery"."expires_at",+ "posthog_datawarehousesavedquery"."semantic_enrichment_hash",+ "posthog_user"."id",+ "posthog_user"."password",+ "posthog_user"."last_login",+ "posthog_user"."first_name",+ "posthog_user"."last_name",+ "posthog_user"."is_staff",+ "posthog_user"."date_joined",+ "posthog_user"."uuid",+ "posthog_user"."current_organization_id",+ "posthog_user"."current_team_id",+ "posthog_user"."email",+ "posthog_user"."pending_email","posthog_user"."distinct_id","posthog_user"."is_email_verified","posthog_user"."credentials_reviewed_at",@@ -2939,7 +3189,7 @@ORDER BY "posthog_datawarehousesavedquery"."name" ASC'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.7+# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.8'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -3033,7 +3283,7 @@AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.8+# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.9'''SELECT "posthog_teamrevenueanalyticsconfig"."team_id","posthog_teamrevenueanalyticsconfig"."filter_test_accounts",@@ -3046,44 +3296,6 @@LIMIT 21'''# ----# name: TestSessionRecordings.test_get_session_recordings_scenarios_2_many_distinct_ids.9- '''- SELECT "posthog_externaldatasource"."created_by_id",- "posthog_externaldatasource"."created_at",- "posthog_externaldatasource"."updated_at",- "posthog_externaldatasource"."deleted",- "posthog_externaldatasource"."deleted_at",- "posthog_externaldatasource"."id",- "posthog_externaldatasource"."source_id",- "posthog_externaldatasource"."connection_id",- "posthog_externaldatasource"."destination_id",- "posthog_externaldatasource"."team_id",- "posthog_externaldatasource"."sync_frequency",- "posthog_externaldatasource"."status",- "posthog_externaldatasource"."source_type",- "posthog_externaldatasource"."api_version",- "posthog_externaldatasource"."job_inputs",- "posthog_externaldatasource"."connection_metadata",- "posthog_externaldatasource"."are_tables_created",- "posthog_externaldatasource"."prefix",- "posthog_externaldatasource"."description",- "posthog_externaldatasource"."created_via",- "posthog_externaldatasource"."access_method",- "posthog_externaldatasource"."direct_query_enabled",- "posthog_externaldatasource"."auto_sync_new_schemas",- "posthog_externaldatasource"."auto_sync_schema_patterns",- "posthog_externaldatasource"."revenue_analytics_enabled",- "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",- "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",- "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"- FROM "posthog_externaldatasource"- LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")- WHERE ("posthog_externaldatasource"."source_type" IN ('Stripe')- AND "posthog_externaldatasource"."team_id" = 99999- AND NOT ("posthog_externaldatasource"."deleted"- AND "posthog_externaldatasource"."deleted" IS NOT NULL))- '''-# ---# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_'''SELECT "posthog_user"."id",@@ -3175,6 +3387,44 @@'''# ---# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.10+ '''+ SELECT "posthog_externaldatasource"."created_by_id",+ "posthog_externaldatasource"."created_at",+ "posthog_externaldatasource"."updated_at",+ "posthog_externaldatasource"."deleted",+ "posthog_externaldatasource"."deleted_at",+ "posthog_externaldatasource"."id",+ "posthog_externaldatasource"."source_id",+ "posthog_externaldatasource"."connection_id",+ "posthog_externaldatasource"."destination_id",+ "posthog_externaldatasource"."team_id",+ "posthog_externaldatasource"."sync_frequency",+ "posthog_externaldatasource"."status",+ "posthog_externaldatasource"."source_type",+ "posthog_externaldatasource"."api_version",+ "posthog_externaldatasource"."job_inputs",+ "posthog_externaldatasource"."connection_metadata",+ "posthog_externaldatasource"."are_tables_created",+ "posthog_externaldatasource"."prefix",+ "posthog_externaldatasource"."description",+ "posthog_externaldatasource"."created_via",+ "posthog_externaldatasource"."access_method",+ "posthog_externaldatasource"."direct_query_enabled",+ "posthog_externaldatasource"."auto_sync_new_schemas",+ "posthog_externaldatasource"."auto_sync_schema_patterns",+ "posthog_externaldatasource"."revenue_analytics_enabled",+ "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",+ "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",+ "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"+ FROM "posthog_externaldatasource"+ LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")+ WHERE ("posthog_externaldatasource"."source_type" IN ('Stripe')+ AND "posthog_externaldatasource"."team_id" = 99999+ AND NOT ("posthog_externaldatasource"."deleted"+ AND "posthog_externaldatasource"."deleted" IS NOT NULL))+ '''+# ---+# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.11'''SELECT "posthog_datawarehousetable"."created_by_id","posthog_datawarehousetable"."created_at",@@ -3247,7 +3497,7 @@ORDER BY "posthog_datawarehousetable"."created_at" DESC'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.11+# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.12'''SELECT "posthog_datawarehousejoin"."created_by_id","posthog_datawarehousejoin"."created_at",@@ -3267,7 +3517,7 @@AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.12+# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.13'''SELECT "data_tools_datawarehouseexpression"."deleted","data_tools_datawarehouseexpression"."deleted_at",@@ -3286,7 +3536,7 @@AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.13+# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.14'''SELECT "posthog_sessionrecording"."id","posthog_sessionrecording"."session_id",@@ -3316,7 +3566,7 @@AND "posthog_sessionrecording"."team_id" = 99999)'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.14+# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.15'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"FROM "posthog_sessionrecordingviewed"@@ -3326,7 +3576,7 @@'at_base_time'))'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.15+# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.16'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id","posthog_user"."email" AS "user__email"@@ -3608,6 +3858,59 @@'''# ---# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.6+ '''+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21+ '''+# ---+# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.7'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -3709,7 +4012,7 @@ORDER BY "posthog_datawarehousesavedquery"."name" ASC'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.7+# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.8'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -3803,7 +4106,7 @@AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.8+# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.9'''SELECT "posthog_teamrevenueanalyticsconfig"."team_id","posthog_teamrevenueanalyticsconfig"."filter_test_accounts",@@ -3816,45 +4119,7 @@LIMIT 21'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_0_descending_original_.9- '''- SELECT "posthog_externaldatasource"."created_by_id",- "posthog_externaldatasource"."created_at",- "posthog_externaldatasource"."updated_at",- "posthog_externaldatasource"."deleted",- "posthog_externaldatasource"."deleted_at",- "posthog_externaldatasource"."id",- "posthog_externaldatasource"."source_id",- "posthog_externaldatasource"."connection_id",- "posthog_externaldatasource"."destination_id",- "posthog_externaldatasource"."team_id",- "posthog_externaldatasource"."sync_frequency",- "posthog_externaldatasource"."status",- "posthog_externaldatasource"."source_type",- "posthog_externaldatasource"."api_version",- "posthog_externaldatasource"."job_inputs",- "posthog_externaldatasource"."connection_metadata",- "posthog_externaldatasource"."are_tables_created",- "posthog_externaldatasource"."prefix",- "posthog_externaldatasource"."description",- "posthog_externaldatasource"."created_via",- "posthog_externaldatasource"."access_method",- "posthog_externaldatasource"."direct_query_enabled",- "posthog_externaldatasource"."auto_sync_new_schemas",- "posthog_externaldatasource"."auto_sync_schema_patterns",- "posthog_externaldatasource"."revenue_analytics_enabled",- "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",- "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",- "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"- FROM "posthog_externaldatasource"- LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")- WHERE ("posthog_externaldatasource"."source_type" IN ('Stripe')- AND "posthog_externaldatasource"."team_id" = 99999- AND NOT ("posthog_externaldatasource"."deleted"- AND "posthog_externaldatasource"."deleted" IS NOT NULL))- '''-# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending'''SELECT "posthog_user"."id","posthog_user"."password",@@ -3945,6 +4210,44 @@'''# ---# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.10+ '''+ SELECT "posthog_externaldatasource"."created_by_id",+ "posthog_externaldatasource"."created_at",+ "posthog_externaldatasource"."updated_at",+ "posthog_externaldatasource"."deleted",+ "posthog_externaldatasource"."deleted_at",+ "posthog_externaldatasource"."id",+ "posthog_externaldatasource"."source_id",+ "posthog_externaldatasource"."connection_id",+ "posthog_externaldatasource"."destination_id",+ "posthog_externaldatasource"."team_id",+ "posthog_externaldatasource"."sync_frequency",+ "posthog_externaldatasource"."status",+ "posthog_externaldatasource"."source_type",+ "posthog_externaldatasource"."api_version",+ "posthog_externaldatasource"."job_inputs",+ "posthog_externaldatasource"."connection_metadata",+ "posthog_externaldatasource"."are_tables_created",+ "posthog_externaldatasource"."prefix",+ "posthog_externaldatasource"."description",+ "posthog_externaldatasource"."created_via",+ "posthog_externaldatasource"."access_method",+ "posthog_externaldatasource"."direct_query_enabled",+ "posthog_externaldatasource"."auto_sync_new_schemas",+ "posthog_externaldatasource"."auto_sync_schema_patterns",+ "posthog_externaldatasource"."revenue_analytics_enabled",+ "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",+ "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",+ "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"+ FROM "posthog_externaldatasource"+ LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")+ WHERE ("posthog_externaldatasource"."source_type" IN ('Stripe')+ AND "posthog_externaldatasource"."team_id" = 99999+ AND NOT ("posthog_externaldatasource"."deleted"+ AND "posthog_externaldatasource"."deleted" IS NOT NULL))+ '''+# ---+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.11'''SELECT "posthog_datawarehousetable"."created_by_id","posthog_datawarehousetable"."created_at",@@ -4017,7 +4320,7 @@ORDER BY "posthog_datawarehousetable"."created_at" DESC'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.11+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.12'''SELECT "posthog_datawarehousejoin"."created_by_id","posthog_datawarehousejoin"."created_at",@@ -4037,7 +4340,7 @@AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.12+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.13'''SELECT "data_tools_datawarehouseexpression"."deleted","data_tools_datawarehouseexpression"."deleted_at",@@ -4056,7 +4359,7 @@AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.13+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.14'''SELECT "posthog_sessionrecording"."id","posthog_sessionrecording"."session_id",@@ -4086,7 +4389,7 @@AND "posthog_sessionrecording"."team_id" = 99999)'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.14+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.15'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"FROM "posthog_sessionrecordingviewed"@@ -4096,7 +4399,7 @@'at_base_time'))'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.15+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.16'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id","posthog_user"."email" AS "user__email"@@ -4378,6 +4681,59 @@'''# ---# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.6+ '''+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21+ '''+# ---+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.7'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -4479,7 +4835,7 @@ORDER BY "posthog_datawarehousesavedquery"."name" ASC'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.7+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.8'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -4573,7 +4929,7 @@AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.8+# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.9'''SELECT "posthog_teamrevenueanalyticsconfig"."team_id","posthog_teamrevenueanalyticsconfig"."filter_test_accounts",@@ -4586,44 +4942,6 @@LIMIT 21'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_1_descending.9- '''- SELECT "posthog_externaldatasource"."created_by_id",- "posthog_externaldatasource"."created_at",- "posthog_externaldatasource"."updated_at",- "posthog_externaldatasource"."deleted",- "posthog_externaldatasource"."deleted_at",- "posthog_externaldatasource"."id",- "posthog_externaldatasource"."source_id",- "posthog_externaldatasource"."connection_id",- "posthog_externaldatasource"."destination_id",- "posthog_externaldatasource"."team_id",- "posthog_externaldatasource"."sync_frequency",- "posthog_externaldatasource"."status",- "posthog_externaldatasource"."source_type",- "posthog_externaldatasource"."api_version",- "posthog_externaldatasource"."job_inputs",- "posthog_externaldatasource"."connection_metadata",- "posthog_externaldatasource"."are_tables_created",- "posthog_externaldatasource"."prefix",- "posthog_externaldatasource"."description",- "posthog_externaldatasource"."created_via",- "posthog_externaldatasource"."access_method",- "posthog_externaldatasource"."direct_query_enabled",- "posthog_externaldatasource"."auto_sync_new_schemas",- "posthog_externaldatasource"."auto_sync_schema_patterns",- "posthog_externaldatasource"."revenue_analytics_enabled",- "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",- "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",- "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"- FROM "posthog_externaldatasource"- LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")- WHERE ("posthog_externaldatasource"."source_type" IN ('Stripe')- AND "posthog_externaldatasource"."team_id" = 99999- AND NOT ("posthog_externaldatasource"."deleted"- AND "posthog_externaldatasource"."deleted" IS NOT NULL))- '''-# ---# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending'''SELECT "posthog_user"."id",@@ -4715,6 +5033,44 @@'''# ---# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.10+ '''+ SELECT "posthog_externaldatasource"."created_by_id",+ "posthog_externaldatasource"."created_at",+ "posthog_externaldatasource"."updated_at",+ "posthog_externaldatasource"."deleted",+ "posthog_externaldatasource"."deleted_at",+ "posthog_externaldatasource"."id",+ "posthog_externaldatasource"."source_id",+ "posthog_externaldatasource"."connection_id",+ "posthog_externaldatasource"."destination_id",+ "posthog_externaldatasource"."team_id",+ "posthog_externaldatasource"."sync_frequency",+ "posthog_externaldatasource"."status",+ "posthog_externaldatasource"."source_type",+ "posthog_externaldatasource"."api_version",+ "posthog_externaldatasource"."job_inputs",+ "posthog_externaldatasource"."connection_metadata",+ "posthog_externaldatasource"."are_tables_created",+ "posthog_externaldatasource"."prefix",+ "posthog_externaldatasource"."description",+ "posthog_externaldatasource"."created_via",+ "posthog_externaldatasource"."access_method",+ "posthog_externaldatasource"."direct_query_enabled",+ "posthog_externaldatasource"."auto_sync_new_schemas",+ "posthog_externaldatasource"."auto_sync_schema_patterns",+ "posthog_externaldatasource"."revenue_analytics_enabled",+ "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",+ "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",+ "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"+ FROM "posthog_externaldatasource"+ LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")+ WHERE ("posthog_externaldatasource"."source_type" IN ('Stripe')+ AND "posthog_externaldatasource"."team_id" = 99999+ AND NOT ("posthog_externaldatasource"."deleted"+ AND "posthog_externaldatasource"."deleted" IS NOT NULL))+ '''+# ---+# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.11'''SELECT "posthog_datawarehousetable"."created_by_id","posthog_datawarehousetable"."created_at",@@ -4787,7 +5143,7 @@ORDER BY "posthog_datawarehousetable"."created_at" DESC'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.11+# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.12'''SELECT "posthog_datawarehousejoin"."created_by_id","posthog_datawarehousejoin"."created_at",@@ -4807,7 +5163,7 @@AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.12+# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.13'''SELECT "data_tools_datawarehouseexpression"."deleted","data_tools_datawarehouseexpression"."deleted_at",@@ -4826,7 +5182,7 @@AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.13+# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.14'''SELECT "posthog_sessionrecording"."id","posthog_sessionrecording"."session_id",@@ -4856,7 +5212,7 @@AND "posthog_sessionrecording"."team_id" = 99999)'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.14+# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.15'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"FROM "posthog_sessionrecordingviewed"@@ -4866,7 +5222,7 @@'at_base_time_plus_20'))'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.15+# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.16'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id","posthog_user"."email" AS "user__email"@@ -5149,53 +5505,106 @@# ---# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.6'''- SELECT "posthog_datawarehousesavedquery"."created_by_id",- "posthog_datawarehousesavedquery"."created_at",- "posthog_datawarehousesavedquery"."updated_at",- "posthog_datawarehousesavedquery"."deleted",- "posthog_datawarehousesavedquery"."deleted_at",- "posthog_datawarehousesavedquery"."id",- "posthog_datawarehousesavedquery"."name",- "posthog_datawarehousesavedquery"."team_id",- "posthog_datawarehousesavedquery"."latest_error",- "posthog_datawarehousesavedquery"."columns",- "posthog_datawarehousesavedquery"."column_order",- "posthog_datawarehousesavedquery"."external_tables",- "posthog_datawarehousesavedquery"."query",- "posthog_datawarehousesavedquery"."status",- "posthog_datawarehousesavedquery"."last_run_at",- "posthog_datawarehousesavedquery"."sync_frequency_interval",- "posthog_datawarehousesavedquery"."table_id",- "posthog_datawarehousesavedquery"."is_materialized",- "posthog_datawarehousesavedquery"."deleted_name",- "posthog_datawarehousesavedquery"."managed_viewset_id",- "posthog_datawarehousesavedquery"."folder_id",- "posthog_datawarehousesavedquery"."origin",- "posthog_datawarehousesavedquery"."is_test",- "posthog_datawarehousesavedquery"."expires_at",- "posthog_datawarehousesavedquery"."semantic_enrichment_hash",- "posthog_user"."id",- "posthog_user"."password",- "posthog_user"."last_login",- "posthog_user"."first_name",- "posthog_user"."last_name",- "posthog_user"."is_staff",- "posthog_user"."date_joined",- "posthog_user"."uuid",- "posthog_user"."current_organization_id",- "posthog_user"."current_team_id",- "posthog_user"."email",- "posthog_user"."pending_email",- "posthog_user"."distinct_id",- "posthog_user"."is_email_verified",- "posthog_user"."credentials_reviewed_at",- "posthog_user"."requested_password_reset_at",- "posthog_user"."requested_2fa_reset_at",- "posthog_user"."has_seen_product_intro_for",- "posthog_user"."strapi_id",- "posthog_user"."is_active",- "posthog_user"."role_at_organization",- "posthog_user"."theme_mode",+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21+ '''+# ---+# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.7+ '''+ SELECT "posthog_datawarehousesavedquery"."created_by_id",+ "posthog_datawarehousesavedquery"."created_at",+ "posthog_datawarehousesavedquery"."updated_at",+ "posthog_datawarehousesavedquery"."deleted",+ "posthog_datawarehousesavedquery"."deleted_at",+ "posthog_datawarehousesavedquery"."id",+ "posthog_datawarehousesavedquery"."name",+ "posthog_datawarehousesavedquery"."team_id",+ "posthog_datawarehousesavedquery"."latest_error",+ "posthog_datawarehousesavedquery"."columns",+ "posthog_datawarehousesavedquery"."column_order",+ "posthog_datawarehousesavedquery"."external_tables",+ "posthog_datawarehousesavedquery"."query",+ "posthog_datawarehousesavedquery"."status",+ "posthog_datawarehousesavedquery"."last_run_at",+ "posthog_datawarehousesavedquery"."sync_frequency_interval",+ "posthog_datawarehousesavedquery"."table_id",+ "posthog_datawarehousesavedquery"."is_materialized",+ "posthog_datawarehousesavedquery"."deleted_name",+ "posthog_datawarehousesavedquery"."managed_viewset_id",+ "posthog_datawarehousesavedquery"."folder_id",+ "posthog_datawarehousesavedquery"."origin",+ "posthog_datawarehousesavedquery"."is_test",+ "posthog_datawarehousesavedquery"."expires_at",+ "posthog_datawarehousesavedquery"."semantic_enrichment_hash",+ "posthog_user"."id",+ "posthog_user"."password",+ "posthog_user"."last_login",+ "posthog_user"."first_name",+ "posthog_user"."last_name",+ "posthog_user"."is_staff",+ "posthog_user"."date_joined",+ "posthog_user"."uuid",+ "posthog_user"."current_organization_id",+ "posthog_user"."current_team_id",+ "posthog_user"."email",+ "posthog_user"."pending_email",+ "posthog_user"."distinct_id",+ "posthog_user"."is_email_verified",+ "posthog_user"."credentials_reviewed_at",+ "posthog_user"."requested_password_reset_at",+ "posthog_user"."requested_2fa_reset_at",+ "posthog_user"."has_seen_product_intro_for",+ "posthog_user"."strapi_id",+ "posthog_user"."is_active",+ "posthog_user"."role_at_organization",+ "posthog_user"."theme_mode","posthog_user"."partial_notification_settings","posthog_user"."anonymize_data","posthog_user"."allow_impersonation",@@ -5249,7 +5658,7 @@ORDER BY "posthog_datawarehousesavedquery"."name" ASC'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.7+# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.8'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -5343,7 +5752,7 @@AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.8+# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.9'''SELECT "posthog_teamrevenueanalyticsconfig"."team_id","posthog_teamrevenueanalyticsconfig"."filter_test_accounts",@@ -5356,44 +5765,6 @@LIMIT 21'''# ----# name: TestSessionRecordings.test_get_session_recordings_sorted_2_ascending.9- '''- SELECT "posthog_externaldatasource"."created_by_id",- "posthog_externaldatasource"."created_at",- "posthog_externaldatasource"."updated_at",- "posthog_externaldatasource"."deleted",- "posthog_externaldatasource"."deleted_at",- "posthog_externaldatasource"."id",- "posthog_externaldatasource"."source_id",- "posthog_externaldatasource"."connection_id",- "posthog_externaldatasource"."destination_id",- "posthog_externaldatasource"."team_id",- "posthog_externaldatasource"."sync_frequency",- "posthog_externaldatasource"."status",- "posthog_externaldatasource"."source_type",- "posthog_externaldatasource"."api_version",- "posthog_externaldatasource"."job_inputs",- "posthog_externaldatasource"."connection_metadata",- "posthog_externaldatasource"."are_tables_created",- "posthog_externaldatasource"."prefix",- "posthog_externaldatasource"."description",- "posthog_externaldatasource"."created_via",- "posthog_externaldatasource"."access_method",- "posthog_externaldatasource"."direct_query_enabled",- "posthog_externaldatasource"."auto_sync_new_schemas",- "posthog_externaldatasource"."auto_sync_schema_patterns",- "posthog_externaldatasource"."revenue_analytics_enabled",- "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",- "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",- "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"- FROM "posthog_externaldatasource"- LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")- WHERE ("posthog_externaldatasource"."source_type" IN ('Stripe')- AND "posthog_externaldatasource"."team_id" = 99999- AND NOT ("posthog_externaldatasource"."deleted"- AND "posthog_externaldatasource"."deleted" IS NOT NULL))- '''-# ---# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons'''SELECT "posthog_user"."id",@@ -5486,57 +5857,25 @@# ---# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.10'''- SELECT "posthog_datawarehousejoin"."created_by_id",- "posthog_datawarehousejoin"."created_at",- "posthog_datawarehousejoin"."deleted",- "posthog_datawarehousejoin"."deleted_at",- "posthog_datawarehousejoin"."id",- "posthog_datawarehousejoin"."team_id",- "posthog_datawarehousejoin"."source_table_name",- "posthog_datawarehousejoin"."source_table_key",- "posthog_datawarehousejoin"."joining_table_name",- "posthog_datawarehousejoin"."joining_table_key",- "posthog_datawarehousejoin"."field_name",- "posthog_datawarehousejoin"."configuration"- FROM "posthog_datawarehousejoin"- WHERE ("posthog_datawarehousejoin"."team_id" = 99999- AND NOT ("posthog_datawarehousejoin"."deleted"- AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.100- '''- SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"- FROM "posthog_sessionrecordingviewed"- WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999- AND "posthog_sessionrecordingviewed"."user_id" = 99999- AND "posthog_sessionrecordingviewed"."session_id" IN ('6',- '5',- '4',- '3',- '2',- '1'))- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.101- '''- SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id",- "posthog_user"."email" AS "user__email"- FROM "posthog_sessionrecordingviewed"- INNER JOIN "posthog_user" ON ("posthog_sessionrecordingviewed"."user_id" = "posthog_user"."id")- WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('6',- '5',- '4',- '3',- '2',- '1')- AND "posthog_sessionrecordingviewed"."team_id" = 99999- AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.102- '''- 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"."queryable_folder",+ "posthog_datawarehousetable"."credential_id",+ "posthog_datawarehousetable"."external_data_source_id",+ "posthog_datawarehousetable"."columns",+ "posthog_datawarehousetable"."column_order",+ "posthog_datawarehousetable"."options",+ "posthog_datawarehousetable"."row_count",+ "posthog_datawarehousetable"."size_in_s3_mib",+ "posthog_user"."id","posthog_user"."password","posthog_user"."last_login","posthog_user"."first_name",@@ -5551,6 +5890,7 @@"posthog_user"."distinct_id","posthog_user"."is_email_verified","posthog_user"."credentials_reviewed_at",+ "posthog_user"."requested_password_reset_at","posthog_user"."requested_2fa_reset_at","posthog_user"."has_seen_product_intro_for","posthog_user"."strapi_id",@@ -5575,325 +5915,20 @@"posthog_user"."onboarding_delegation_accepted_at","posthog_user"."events_column_config","posthog_user"."email_opt_in"- FROM "posthog_user"- WHERE ("posthog_user"."is_active"- AND "posthog_user"."id" = 99999)+ FROM "posthog_datawarehousetable"+ LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")+ LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousetable"."created_by_id" = "posthog_user"."id")+ WHERE ("posthog_datawarehousetable"."team_id" = 99999+ AND NOT ("posthog_datawarehousetable"."deleted"+ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)+ AND NOT ("posthog_externaldatasource"."deleted"+ AND "posthog_externaldatasource"."deleted" IS NOT NULL)+ AND NOT ("posthog_externaldatasource"."access_method" = 'direct'+ AND "posthog_externaldatasource"."access_method" IS NOT NULL))+ ORDER BY "posthog_datawarehousetable"."created_at" DESC'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.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"."is_active",- "posthog_organization"."is_not_active_reason",- "posthog_organization"."session_cookie_age",- "posthog_organization"."is_member_join_email_enabled",- "posthog_organization"."is_ai_data_processing_approved",- "posthog_organization"."is_ai_training_opted_in",- "posthog_organization"."is_ai_training_locked",- "posthog_organization"."is_ai_training_cta_shown",- "posthog_organization"."enforce_2fa",- "posthog_organization"."enforce_verified_domains",- "posthog_organization"."members_can_invite",- "posthog_organization"."members_can_create_projects",- "posthog_organization"."members_can_use_personal_api_keys",- "posthog_organization"."members_can_see_org_members",- "posthog_organization"."allow_publicly_shared_resources",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "posthog_organization"."is_pending_deletion",- "posthog_organization"."customer_id",- "posthog_organization"."available_product_features",- "posthog_organization"."usage",- "posthog_organization"."never_drop_data",- "posthog_organization"."customer_trust_scores",- "posthog_organization"."setup_section_2_completed",- "posthog_organization"."personalization",- "posthog_organization"."domain_whitelist",- "posthog_organization"."is_platform"- FROM "posthog_organization"- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid- LIMIT 21- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.104- '''- SELECT "posthog_team"."id",- "posthog_team"."uuid",- "posthog_team"."organization_id",- "posthog_team"."parent_team_id",- "posthog_team"."project_id",- "posthog_team"."api_token",- "posthog_team"."app_urls",- "posthog_team"."name",- "posthog_team"."slack_incoming_webhook",- "posthog_team"."created_at",- "posthog_team"."updated_at",- "posthog_team"."anonymize_ips",- "posthog_team"."completed_snippet_onboarding",- "posthog_team"."has_completed_onboarding_for",- "posthog_team"."onboarding_tasks",- "posthog_team"."ingested_event",- "posthog_team"."ingested_production_event",- "posthog_team"."ingested_production_event_last_checked_at",- "posthog_team"."person_processing_opt_out",- "posthog_team"."secret_api_token",- "posthog_team"."secret_api_token_backup",- "posthog_team"."session_recording_opt_in",- "posthog_team"."session_recording_sample_rate",- "posthog_team"."session_recording_minimum_duration_milliseconds",- "posthog_team"."session_recording_linked_flag",- "posthog_team"."session_recording_network_payload_capture_config",- "posthog_team"."session_recording_masking_config",- "posthog_team"."session_recording_url_trigger_config",- "posthog_team"."session_recording_url_blocklist_config",- "posthog_team"."session_recording_event_trigger_config",- "posthog_team"."session_recording_trigger_match_type_config",- "posthog_team"."session_recording_trigger_groups",- "posthog_team"."session_replay_config",- "posthog_team"."session_recording_retention_period",- "posthog_team"."event_retention_months",- "posthog_team"."conversations_enabled",- "posthog_team"."conversations_settings",- "posthog_team"."proactive_tasks_enabled",- "posthog_team"."survey_config",- "posthog_team"."surveys_opt_in",- "posthog_team"."product_tours_opt_in",- "posthog_team"."capture_console_log_opt_in",- "posthog_team"."capture_performance_opt_in",- "posthog_team"."capture_dead_clicks",- "posthog_team"."autocapture_opt_out",- "posthog_team"."autocapture_web_vitals_opt_in",- "posthog_team"."autocapture_web_vitals_allowed_metrics",- "posthog_team"."autocapture_exceptions_opt_in",- "posthog_team"."autocapture_exceptions_errors_to_ignore",- "posthog_team"."logs_settings",- "posthog_team"."llm_gateway_enabled_at",- "posthog_team"."llm_gateway_revoked_at",- "posthog_team"."llm_gateway_overspend_allowance_usd",- "posthog_team"."heatmaps_opt_in",- "posthog_team"."receive_org_level_activity_logs",- "posthog_team"."web_analytics_pre_aggregated_tables_enabled",- "posthog_team"."web_analytics_pre_aggregated_tables_version",- "posthog_team"."flags_persistence_default",- "posthog_team"."feature_flag_confirmation_enabled",- "posthog_team"."feature_flag_confirmation_message",- "posthog_team"."default_evaluation_environments_enabled",- "posthog_team"."require_evaluation_environment_tags",- "posthog_team"."default_evaluation_contexts_enabled",- "posthog_team"."require_evaluation_contexts",- "posthog_team"."session_recording_version",- "posthog_team"."signup_token",- "posthog_team"."is_demo",- "posthog_team"."access_control",- "posthog_team"."week_start_day",- "posthog_team"."inject_web_apps",- "posthog_team"."test_account_filters",- "posthog_team"."test_account_filters_default_checked",- "posthog_team"."path_cleaning_filters",- "posthog_team"."timezone",- "posthog_team"."data_attributes",- "posthog_team"."person_display_name_properties",- "posthog_team"."live_events_columns",- "posthog_team"."recording_domains",- "posthog_team"."human_friendly_comparison_periods",- "posthog_team"."cookieless_server_hash_mode",- "posthog_team"."primary_dashboard_id",- "posthog_team"."default_data_theme",- "posthog_team"."extra_settings",- "posthog_team"."modifiers",- "posthog_team"."correlation_config",- "posthog_team"."session_recording_retention_period_days",- "posthog_team"."external_data_workspace_id",- "posthog_team"."external_data_workspace_last_synced_at",- "posthog_team"."api_query_rate_limit",- "posthog_team"."drop_events_older_than",- "posthog_team"."base_currency",- "posthog_team"."experiment_recalculation_time",- "posthog_team"."default_experiment_confidence_level",- "posthog_team"."default_experiment_stats_method",- "posthog_team"."business_model",- "posthog_organization"."id",- "posthog_organization"."name",- "posthog_organization"."slug",- "posthog_organization"."logo_media_id",- "posthog_organization"."created_at",- "posthog_organization"."updated_at",- "posthog_organization"."is_active",- "posthog_organization"."is_not_active_reason",- "posthog_organization"."session_cookie_age",- "posthog_organization"."is_member_join_email_enabled",- "posthog_organization"."is_ai_data_processing_approved",- "posthog_organization"."is_ai_training_opted_in",- "posthog_organization"."is_ai_training_locked",- "posthog_organization"."is_ai_training_cta_shown",- "posthog_organization"."enforce_2fa",- "posthog_organization"."enforce_verified_domains",- "posthog_organization"."members_can_invite",- "posthog_organization"."members_can_create_projects",- "posthog_organization"."members_can_use_personal_api_keys",- "posthog_organization"."members_can_see_org_members",- "posthog_organization"."allow_publicly_shared_resources",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "posthog_organization"."is_pending_deletion",- "posthog_organization"."customer_id",- "posthog_organization"."available_product_features",- "posthog_organization"."usage",- "posthog_organization"."never_drop_data",- "posthog_organization"."customer_trust_scores",- "posthog_organization"."setup_section_2_completed",- "posthog_organization"."personalization",- "posthog_organization"."domain_whitelist",- "posthog_organization"."is_platform"- FROM "posthog_team"- INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")- WHERE "posthog_team"."id" = 99999- LIMIT 21- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.105- '''- SELECT "posthog_organizationmembership"."id",- "posthog_organizationmembership"."organization_id",- "posthog_organizationmembership"."user_id",- "posthog_organizationmembership"."level",- "posthog_organizationmembership"."joined_at",- "posthog_organizationmembership"."updated_at",- "posthog_organizationmembership"."invited_by_id",- "posthog_organization"."id",- "posthog_organization"."name",- "posthog_organization"."slug",- "posthog_organization"."logo_media_id",- "posthog_organization"."created_at",- "posthog_organization"."updated_at",- "posthog_organization"."is_active",- "posthog_organization"."is_not_active_reason",- "posthog_organization"."session_cookie_age",- "posthog_organization"."is_member_join_email_enabled",- "posthog_organization"."is_ai_data_processing_approved",- "posthog_organization"."is_ai_training_opted_in",- "posthog_organization"."is_ai_training_locked",- "posthog_organization"."is_ai_training_cta_shown",- "posthog_organization"."enforce_2fa",- "posthog_organization"."enforce_verified_domains",- "posthog_organization"."members_can_invite",- "posthog_organization"."members_can_create_projects",- "posthog_organization"."members_can_use_personal_api_keys",- "posthog_organization"."members_can_see_org_members",- "posthog_organization"."allow_publicly_shared_resources",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "posthog_organization"."is_pending_deletion",- "posthog_organization"."customer_id",- "posthog_organization"."available_product_features",- "posthog_organization"."usage",- "posthog_organization"."never_drop_data",- "posthog_organization"."customer_trust_scores",- "posthog_organization"."setup_section_2_completed",- "posthog_organization"."personalization",- "posthog_organization"."domain_whitelist",- "posthog_organization"."is_platform"- FROM "posthog_organizationmembership"- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999)- LIMIT 21- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.106- '''- 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",- "posthog_team"."organization_id" AS "_team_organization_id"- FROM "ee_accesscontrol"- INNER JOIN "posthog_team" ON ("ee_accesscontrol"."team_id" = "posthog_team"."id")- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")- WHERE (("ee_accesscontrol"."organization_member_id" IS NULL- AND "ee_accesscontrol"."role_id" IS NULL- AND "ee_accesscontrol"."team_id" = 99999)- OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999- AND "ee_accesscontrol"."role_id" IS NULL- AND "ee_accesscontrol"."team_id" = 99999))- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.107- '''- SELECT "posthog_organizationmembership"."id",- "posthog_organizationmembership"."organization_id",- "posthog_organizationmembership"."user_id",- "posthog_organizationmembership"."level",- "posthog_organizationmembership"."joined_at",- "posthog_organizationmembership"."updated_at",- "posthog_organizationmembership"."invited_by_id",- "posthog_organization"."id",- "posthog_organization"."name",- "posthog_organization"."slug",- "posthog_organization"."logo_media_id",- "posthog_organization"."created_at",- "posthog_organization"."updated_at",- "posthog_organization"."is_active",- "posthog_organization"."is_not_active_reason",- "posthog_organization"."session_cookie_age",- "posthog_organization"."is_member_join_email_enabled",- "posthog_organization"."is_ai_data_processing_approved",- "posthog_organization"."is_ai_training_opted_in",- "posthog_organization"."is_ai_training_locked",- "posthog_organization"."is_ai_training_cta_shown",- "posthog_organization"."enforce_2fa",- "posthog_organization"."enforce_verified_domains",- "posthog_organization"."members_can_invite",- "posthog_organization"."members_can_create_projects",- "posthog_organization"."members_can_use_personal_api_keys",- "posthog_organization"."members_can_see_org_members",- "posthog_organization"."allow_publicly_shared_resources",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "posthog_organization"."is_pending_deletion",- "posthog_organization"."customer_id",- "posthog_organization"."available_product_features",- "posthog_organization"."usage",- "posthog_organization"."never_drop_data",- "posthog_organization"."customer_trust_scores",- "posthog_organization"."setup_section_2_completed",- "posthog_organization"."personalization",- "posthog_organization"."domain_whitelist",- "posthog_organization"."is_platform"- FROM "posthog_organizationmembership"- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE "posthog_organizationmembership"."user_id" = 99999- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.108+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.100'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -5995,7 +6030,7 @@ORDER BY "posthog_datawarehousesavedquery"."name" ASC'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.109+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.101'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -6089,26 +6124,7 @@AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.11- '''- SELECT "data_tools_datawarehouseexpression"."deleted",- "data_tools_datawarehouseexpression"."deleted_at",- "data_tools_datawarehouseexpression"."id",- "data_tools_datawarehouseexpression"."team_id",- "data_tools_datawarehouseexpression"."created_at",- "data_tools_datawarehouseexpression"."created_by_id",- "data_tools_datawarehouseexpression"."table_name",- "data_tools_datawarehouseexpression"."field_name",- "data_tools_datawarehouseexpression"."expression",- "data_tools_datawarehouseexpression"."connection_id"- FROM "data_tools_datawarehouseexpression"- WHERE ("data_tools_datawarehouseexpression"."team_id" = 99999- AND NOT ("data_tools_datawarehouseexpression"."deleted"- AND "data_tools_datawarehouseexpression"."deleted" IS NOT NULL)- AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.110+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.102'''SELECT "posthog_externaldatasource"."created_by_id","posthog_externaldatasource"."created_at",@@ -6146,7 +6162,7 @@AND "posthog_externaldatasource"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.111+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.103'''SELECT "posthog_datawarehousetable"."created_by_id","posthog_datawarehousetable"."created_at",@@ -6219,7 +6235,7 @@ORDER BY "posthog_datawarehousetable"."created_at" DESC'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.112+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.104'''SELECT "posthog_datawarehousejoin"."created_by_id","posthog_datawarehousejoin"."created_at",@@ -6239,7 +6255,7 @@AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.113+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.105'''SELECT "data_tools_datawarehouseexpression"."deleted","data_tools_datawarehouseexpression"."deleted_at",@@ -6258,7 +6274,7 @@AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.114+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.106'''SELECT "posthog_sessionrecording"."id","posthog_sessionrecording"."session_id",@@ -6288,19 +6304,17 @@'3','4','5',- '6',- '7')+ '6')AND "posthog_sessionrecording"."team_id" = 99999)'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.115+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.107'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"FROM "posthog_sessionrecordingviewed"WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999AND "posthog_sessionrecordingviewed"."user_id" = 99999- AND "posthog_sessionrecordingviewed"."session_id" IN ('7',- '6',+ AND "posthog_sessionrecordingviewed"."session_id" IN ('6','5','4','3',@@ -6308,14 +6322,13 @@'1'))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.116+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.108'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id","posthog_user"."email" AS "user__email"FROM "posthog_sessionrecordingviewed"INNER JOIN "posthog_user" ON ("posthog_sessionrecordingviewed"."user_id" = "posthog_user"."id")- WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('7',- '6',+ WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('6','5','4','3',@@ -6325,7 +6338,7 @@AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.117+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.109'''SELECT "posthog_user"."id","posthog_user"."password",@@ -6371,7 +6384,27 @@AND "posthog_user"."id" = 99999)'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.118+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.11+ '''+ SELECT "posthog_datawarehousejoin"."created_by_id",+ "posthog_datawarehousejoin"."created_at",+ "posthog_datawarehousejoin"."deleted",+ "posthog_datawarehousejoin"."deleted_at",+ "posthog_datawarehousejoin"."id",+ "posthog_datawarehousejoin"."team_id",+ "posthog_datawarehousejoin"."source_table_name",+ "posthog_datawarehousejoin"."source_table_key",+ "posthog_datawarehousejoin"."joining_table_name",+ "posthog_datawarehousejoin"."joining_table_key",+ "posthog_datawarehousejoin"."field_name",+ "posthog_datawarehousejoin"."configuration"+ FROM "posthog_datawarehousejoin"+ WHERE ("posthog_datawarehousejoin"."team_id" = 99999+ AND NOT ("posthog_datawarehousejoin"."deleted"+ AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.110'''SELECT "posthog_organization"."id","posthog_organization"."name",@@ -6415,7 +6448,7 @@LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.119+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.111'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -6555,53 +6588,7 @@LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.12- '''- SELECT "posthog_user"."id",- "posthog_user"."password",- "posthog_user"."last_login",- "posthog_user"."first_name",- "posthog_user"."last_name",- "posthog_user"."is_staff",- "posthog_user"."date_joined",- "posthog_user"."uuid",- "posthog_user"."current_organization_id",- "posthog_user"."current_team_id",- "posthog_user"."email",- "posthog_user"."pending_email",- "posthog_user"."distinct_id",- "posthog_user"."is_email_verified",- "posthog_user"."credentials_reviewed_at",- "posthog_user"."requested_2fa_reset_at",- "posthog_user"."has_seen_product_intro_for",- "posthog_user"."strapi_id",- "posthog_user"."is_active",- "posthog_user"."role_at_organization",- "posthog_user"."theme_mode",- "posthog_user"."partial_notification_settings",- "posthog_user"."anonymize_data",- "posthog_user"."allow_impersonation",- "posthog_user"."toolbar_mode",- "posthog_user"."hedgehog_config",- "posthog_user"."allow_sidebar_suggestions",- "posthog_user"."shortcut_position",- "posthog_user"."passkeys_enabled_for_2fa",- "posthog_user"."hide_mcp_hints",- "posthog_user"."ui_configuration",- "posthog_user"."onboarding_skipped_at",- "posthog_user"."onboarding_skipped_reason",- "posthog_user"."onboarding_skipped_organization_id",- "posthog_user"."onboarding_delegated_to_invite_id",- "posthog_user"."onboarding_delegated_to_organization_id",- "posthog_user"."onboarding_delegation_accepted_at",- "posthog_user"."events_column_config",- "posthog_user"."email_opt_in"- FROM "posthog_user"- WHERE ("posthog_user"."is_active"- AND "posthog_user"."id" = 99999)- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.120+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.112'''SELECT "posthog_organizationmembership"."id","posthog_organizationmembership"."organization_id",@@ -6654,7 +6641,7 @@LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.121+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.113'''SELECT "ee_accesscontrol"."id","ee_accesscontrol"."team_id",@@ -6679,7 +6666,7 @@AND "ee_accesscontrol"."team_id" = 99999))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.122+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.114'''SELECT "posthog_organizationmembership"."id","posthog_organizationmembership"."organization_id",@@ -6730,7 +6717,60 @@WHERE "posthog_organizationmembership"."user_id" = 99999'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.123+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.115+ '''+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.116'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -6832,7 +6872,7 @@ORDER BY "posthog_datawarehousesavedquery"."name" ASC'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.124+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.117'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -6926,7 +6966,7 @@AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.125+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.118'''SELECT "posthog_externaldatasource"."created_by_id","posthog_externaldatasource"."created_at",@@ -6964,7 +7004,7 @@AND "posthog_externaldatasource"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.126+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.119'''SELECT "posthog_datawarehousetable"."created_by_id","posthog_datawarehousetable"."created_at",@@ -7037,84 +7077,495 @@ORDER BY "posthog_datawarehousetable"."created_at" DESC'''# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.12+ '''+ SELECT "data_tools_datawarehouseexpression"."deleted",+ "data_tools_datawarehouseexpression"."deleted_at",+ "data_tools_datawarehouseexpression"."id",+ "data_tools_datawarehouseexpression"."team_id",+ "data_tools_datawarehouseexpression"."created_at",+ "data_tools_datawarehouseexpression"."created_by_id",+ "data_tools_datawarehouseexpression"."table_name",+ "data_tools_datawarehouseexpression"."field_name",+ "data_tools_datawarehouseexpression"."expression",+ "data_tools_datawarehouseexpression"."connection_id"+ FROM "data_tools_datawarehouseexpression"+ WHERE ("data_tools_datawarehouseexpression"."team_id" = 99999+ AND NOT ("data_tools_datawarehouseexpression"."deleted"+ AND "data_tools_datawarehouseexpression"."deleted" IS NOT NULL)+ AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.120+ '''+ SELECT "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.121+ '''+ SELECT "data_tools_datawarehouseexpression"."deleted",+ "data_tools_datawarehouseexpression"."deleted_at",+ "data_tools_datawarehouseexpression"."id",+ "data_tools_datawarehouseexpression"."team_id",+ "data_tools_datawarehouseexpression"."created_at",+ "data_tools_datawarehouseexpression"."created_by_id",+ "data_tools_datawarehouseexpression"."table_name",+ "data_tools_datawarehouseexpression"."field_name",+ "data_tools_datawarehouseexpression"."expression",+ "data_tools_datawarehouseexpression"."connection_id"+ FROM "data_tools_datawarehouseexpression"+ WHERE ("data_tools_datawarehouseexpression"."team_id" = 99999+ AND NOT ("data_tools_datawarehouseexpression"."deleted"+ AND "data_tools_datawarehouseexpression"."deleted" IS NOT NULL)+ AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.122+ '''+ 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"."full_recording_v2_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",+ "posthog_sessionrecording"."retention_period_days"+ 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.123+ '''+ SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"+ FROM "posthog_sessionrecordingviewed"+ WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999+ AND "posthog_sessionrecordingviewed"."user_id" = 99999+ AND "posthog_sessionrecordingviewed"."session_id" IN ('7',+ '6',+ '5',+ '4',+ '3',+ '2',+ '1'))+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.124+ '''+ SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id",+ "posthog_user"."email" AS "user__email"+ FROM "posthog_sessionrecordingviewed"+ INNER JOIN "posthog_user" ON ("posthog_sessionrecordingviewed"."user_id" = "posthog_user"."id")+ WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('7',+ '6',+ '5',+ '4',+ '3',+ '2',+ '1')+ AND "posthog_sessionrecordingviewed"."team_id" = 99999+ AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.125+ '''+ SELECT "posthog_user"."id",+ "posthog_user"."password",+ "posthog_user"."last_login",+ "posthog_user"."first_name",+ "posthog_user"."last_name",+ "posthog_user"."is_staff",+ "posthog_user"."date_joined",+ "posthog_user"."uuid",+ "posthog_user"."current_organization_id",+ "posthog_user"."current_team_id",+ "posthog_user"."email",+ "posthog_user"."pending_email",+ "posthog_user"."distinct_id",+ "posthog_user"."is_email_verified",+ "posthog_user"."credentials_reviewed_at",+ "posthog_user"."requested_2fa_reset_at",+ "posthog_user"."has_seen_product_intro_for",+ "posthog_user"."strapi_id",+ "posthog_user"."is_active",+ "posthog_user"."role_at_organization",+ "posthog_user"."theme_mode",+ "posthog_user"."partial_notification_settings",+ "posthog_user"."anonymize_data",+ "posthog_user"."allow_impersonation",+ "posthog_user"."toolbar_mode",+ "posthog_user"."hedgehog_config",+ "posthog_user"."allow_sidebar_suggestions",+ "posthog_user"."shortcut_position",+ "posthog_user"."passkeys_enabled_for_2fa",+ "posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration",+ "posthog_user"."onboarding_skipped_at",+ "posthog_user"."onboarding_skipped_reason",+ "posthog_user"."onboarding_skipped_organization_id",+ "posthog_user"."onboarding_delegated_to_invite_id",+ "posthog_user"."onboarding_delegated_to_organization_id",+ "posthog_user"."onboarding_delegation_accepted_at",+ "posthog_user"."events_column_config",+ "posthog_user"."email_opt_in"+ FROM "posthog_user"+ WHERE ("posthog_user"."is_active"+ AND "posthog_user"."id" = 99999)+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.126+ '''+ SELECT "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organization"+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid+ LIMIT 21+ '''+# ---# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.127'''- SELECT "posthog_datawarehousejoin"."created_by_id",- "posthog_datawarehousejoin"."created_at",- "posthog_datawarehousejoin"."deleted",- "posthog_datawarehousejoin"."deleted_at",- "posthog_datawarehousejoin"."id",- "posthog_datawarehousejoin"."team_id",- "posthog_datawarehousejoin"."source_table_name",- "posthog_datawarehousejoin"."source_table_key",- "posthog_datawarehousejoin"."joining_table_name",- "posthog_datawarehousejoin"."joining_table_key",- "posthog_datawarehousejoin"."field_name",- "posthog_datawarehousejoin"."configuration"- FROM "posthog_datawarehousejoin"- WHERE ("posthog_datawarehousejoin"."team_id" = 99999- AND NOT ("posthog_datawarehousejoin"."deleted"- AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))+ SELECT "posthog_team"."id",+ "posthog_team"."uuid",+ "posthog_team"."organization_id",+ "posthog_team"."parent_team_id",+ "posthog_team"."project_id",+ "posthog_team"."api_token",+ "posthog_team"."app_urls",+ "posthog_team"."name",+ "posthog_team"."slack_incoming_webhook",+ "posthog_team"."created_at",+ "posthog_team"."updated_at",+ "posthog_team"."anonymize_ips",+ "posthog_team"."completed_snippet_onboarding",+ "posthog_team"."has_completed_onboarding_for",+ "posthog_team"."onboarding_tasks",+ "posthog_team"."ingested_event",+ "posthog_team"."ingested_production_event",+ "posthog_team"."ingested_production_event_last_checked_at",+ "posthog_team"."person_processing_opt_out",+ "posthog_team"."secret_api_token",+ "posthog_team"."secret_api_token_backup",+ "posthog_team"."session_recording_opt_in",+ "posthog_team"."session_recording_sample_rate",+ "posthog_team"."session_recording_minimum_duration_milliseconds",+ "posthog_team"."session_recording_linked_flag",+ "posthog_team"."session_recording_network_payload_capture_config",+ "posthog_team"."session_recording_masking_config",+ "posthog_team"."session_recording_url_trigger_config",+ "posthog_team"."session_recording_url_blocklist_config",+ "posthog_team"."session_recording_event_trigger_config",+ "posthog_team"."session_recording_trigger_match_type_config",+ "posthog_team"."session_recording_trigger_groups",+ "posthog_team"."session_replay_config",+ "posthog_team"."session_recording_retention_period",+ "posthog_team"."event_retention_months",+ "posthog_team"."conversations_enabled",+ "posthog_team"."conversations_settings",+ "posthog_team"."proactive_tasks_enabled",+ "posthog_team"."survey_config",+ "posthog_team"."surveys_opt_in",+ "posthog_team"."product_tours_opt_in",+ "posthog_team"."capture_console_log_opt_in",+ "posthog_team"."capture_performance_opt_in",+ "posthog_team"."capture_dead_clicks",+ "posthog_team"."autocapture_opt_out",+ "posthog_team"."autocapture_web_vitals_opt_in",+ "posthog_team"."autocapture_web_vitals_allowed_metrics",+ "posthog_team"."autocapture_exceptions_opt_in",+ "posthog_team"."autocapture_exceptions_errors_to_ignore",+ "posthog_team"."logs_settings",+ "posthog_team"."llm_gateway_enabled_at",+ "posthog_team"."llm_gateway_revoked_at",+ "posthog_team"."llm_gateway_overspend_allowance_usd",+ "posthog_team"."heatmaps_opt_in",+ "posthog_team"."receive_org_level_activity_logs",+ "posthog_team"."web_analytics_pre_aggregated_tables_enabled",+ "posthog_team"."web_analytics_pre_aggregated_tables_version",+ "posthog_team"."flags_persistence_default",+ "posthog_team"."feature_flag_confirmation_enabled",+ "posthog_team"."feature_flag_confirmation_message",+ "posthog_team"."default_evaluation_environments_enabled",+ "posthog_team"."require_evaluation_environment_tags",+ "posthog_team"."default_evaluation_contexts_enabled",+ "posthog_team"."require_evaluation_contexts",+ "posthog_team"."session_recording_version",+ "posthog_team"."signup_token",+ "posthog_team"."is_demo",+ "posthog_team"."access_control",+ "posthog_team"."week_start_day",+ "posthog_team"."inject_web_apps",+ "posthog_team"."test_account_filters",+ "posthog_team"."test_account_filters_default_checked",+ "posthog_team"."path_cleaning_filters",+ "posthog_team"."timezone",+ "posthog_team"."data_attributes",+ "posthog_team"."person_display_name_properties",+ "posthog_team"."live_events_columns",+ "posthog_team"."recording_domains",+ "posthog_team"."human_friendly_comparison_periods",+ "posthog_team"."cookieless_server_hash_mode",+ "posthog_team"."primary_dashboard_id",+ "posthog_team"."default_data_theme",+ "posthog_team"."extra_settings",+ "posthog_team"."modifiers",+ "posthog_team"."correlation_config",+ "posthog_team"."session_recording_retention_period_days",+ "posthog_team"."external_data_workspace_id",+ "posthog_team"."external_data_workspace_last_synced_at",+ "posthog_team"."api_query_rate_limit",+ "posthog_team"."drop_events_older_than",+ "posthog_team"."base_currency",+ "posthog_team"."experiment_recalculation_time",+ "posthog_team"."default_experiment_confidence_level",+ "posthog_team"."default_experiment_stats_method",+ "posthog_team"."business_model",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_team"+ INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")+ WHERE "posthog_team"."id" = 99999+ LIMIT 21'''# ---# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.128'''- SELECT "data_tools_datawarehouseexpression"."deleted",- "data_tools_datawarehouseexpression"."deleted_at",- "data_tools_datawarehouseexpression"."id",- "data_tools_datawarehouseexpression"."team_id",- "data_tools_datawarehouseexpression"."created_at",- "data_tools_datawarehouseexpression"."created_by_id",- "data_tools_datawarehouseexpression"."table_name",- "data_tools_datawarehouseexpression"."field_name",- "data_tools_datawarehouseexpression"."expression",- "data_tools_datawarehouseexpression"."connection_id"- FROM "data_tools_datawarehouseexpression"- WHERE ("data_tools_datawarehouseexpression"."team_id" = 99999- AND NOT ("data_tools_datawarehouseexpression"."deleted"- AND "data_tools_datawarehouseexpression"."deleted" IS NOT NULL)- AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.129+ '''+ 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",+ "posthog_team"."organization_id" AS "_team_organization_id"+ FROM "ee_accesscontrol"+ INNER JOIN "posthog_team" ON ("ee_accesscontrol"."team_id" = "posthog_team"."id")+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")+ WHERE (("ee_accesscontrol"."organization_member_id" IS NULL+ AND "ee_accesscontrol"."role_id" IS NULL+ AND "ee_accesscontrol"."team_id" = 99999)+ OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999+ AND "ee_accesscontrol"."role_id" IS NULL+ AND "ee_accesscontrol"."team_id" = 99999))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.129+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.13'''- 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"."full_recording_v2_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",- "posthog_sessionrecording"."retention_period_days"- FROM "posthog_sessionrecording"- WHERE ("posthog_sessionrecording"."session_id" IN ('1',- '2',- '3',- '4',- '5',- '6',- '7',- '8')- AND "posthog_sessionrecording"."team_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"."distinct_id",+ "posthog_user"."is_email_verified",+ "posthog_user"."credentials_reviewed_at",+ "posthog_user"."requested_2fa_reset_at",+ "posthog_user"."has_seen_product_intro_for",+ "posthog_user"."strapi_id",+ "posthog_user"."is_active",+ "posthog_user"."role_at_organization",+ "posthog_user"."theme_mode",+ "posthog_user"."partial_notification_settings",+ "posthog_user"."anonymize_data",+ "posthog_user"."allow_impersonation",+ "posthog_user"."toolbar_mode",+ "posthog_user"."hedgehog_config",+ "posthog_user"."allow_sidebar_suggestions",+ "posthog_user"."shortcut_position",+ "posthog_user"."passkeys_enabled_for_2fa",+ "posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration",+ "posthog_user"."onboarding_skipped_at",+ "posthog_user"."onboarding_skipped_reason",+ "posthog_user"."onboarding_skipped_organization_id",+ "posthog_user"."onboarding_delegated_to_invite_id",+ "posthog_user"."onboarding_delegated_to_organization_id",+ "posthog_user"."onboarding_delegation_accepted_at",+ "posthog_user"."events_column_config",+ "posthog_user"."email_opt_in"+ FROM "posthog_user"+ WHERE ("posthog_user"."is_active"+ AND "posthog_user"."id" = 99999)'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.13+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.130'''- SELECT "posthog_organization"."id",+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id","posthog_organization"."name","posthog_organization"."slug","posthog_organization"."logo_media_id",@@ -7151,48 +7602,194 @@"posthog_organization"."personalization","posthog_organization"."domain_whitelist","posthog_organization"."is_platform"- FROM "posthog_organization"- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid- LIMIT 21+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE "posthog_organizationmembership"."user_id" = 99999'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.130+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.131'''- SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"- FROM "posthog_sessionrecordingviewed"- WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999- AND "posthog_sessionrecordingviewed"."user_id" = 99999- AND "posthog_sessionrecordingviewed"."session_id" IN ('8',- '7',- '6',- '5',- '4',- '3',- '2',- '1'))+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.131+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.132'''- SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id",- "posthog_user"."email" AS "user__email"- FROM "posthog_sessionrecordingviewed"- INNER JOIN "posthog_user" ON ("posthog_sessionrecordingviewed"."user_id" = "posthog_user"."id")- WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('8',- '7',- '6',- '5',- '4',- '3',- '2',- '1')- AND "posthog_sessionrecordingviewed"."team_id" = 99999- AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))+ SELECT "posthog_datawarehousesavedquery"."created_by_id",+ "posthog_datawarehousesavedquery"."created_at",+ "posthog_datawarehousesavedquery"."updated_at",+ "posthog_datawarehousesavedquery"."deleted",+ "posthog_datawarehousesavedquery"."deleted_at",+ "posthog_datawarehousesavedquery"."id",+ "posthog_datawarehousesavedquery"."name",+ "posthog_datawarehousesavedquery"."team_id",+ "posthog_datawarehousesavedquery"."latest_error",+ "posthog_datawarehousesavedquery"."columns",+ "posthog_datawarehousesavedquery"."column_order",+ "posthog_datawarehousesavedquery"."external_tables",+ "posthog_datawarehousesavedquery"."query",+ "posthog_datawarehousesavedquery"."status",+ "posthog_datawarehousesavedquery"."last_run_at",+ "posthog_datawarehousesavedquery"."sync_frequency_interval",+ "posthog_datawarehousesavedquery"."table_id",+ "posthog_datawarehousesavedquery"."is_materialized",+ "posthog_datawarehousesavedquery"."deleted_name",+ "posthog_datawarehousesavedquery"."managed_viewset_id",+ "posthog_datawarehousesavedquery"."folder_id",+ "posthog_datawarehousesavedquery"."origin",+ "posthog_datawarehousesavedquery"."is_test",+ "posthog_datawarehousesavedquery"."expires_at",+ "posthog_datawarehousesavedquery"."semantic_enrichment_hash",+ "posthog_user"."id",+ "posthog_user"."password",+ "posthog_user"."last_login",+ "posthog_user"."first_name",+ "posthog_user"."last_name",+ "posthog_user"."is_staff",+ "posthog_user"."date_joined",+ "posthog_user"."uuid",+ "posthog_user"."current_organization_id",+ "posthog_user"."current_team_id",+ "posthog_user"."email",+ "posthog_user"."pending_email",+ "posthog_user"."distinct_id",+ "posthog_user"."is_email_verified",+ "posthog_user"."credentials_reviewed_at",+ "posthog_user"."requested_password_reset_at",+ "posthog_user"."requested_2fa_reset_at",+ "posthog_user"."has_seen_product_intro_for",+ "posthog_user"."strapi_id",+ "posthog_user"."is_active",+ "posthog_user"."role_at_organization",+ "posthog_user"."theme_mode",+ "posthog_user"."partial_notification_settings",+ "posthog_user"."anonymize_data",+ "posthog_user"."allow_impersonation",+ "posthog_user"."toolbar_mode",+ "posthog_user"."hedgehog_config",+ "posthog_user"."allow_sidebar_suggestions",+ "posthog_user"."shortcut_position",+ "posthog_user"."passkeys_enabled_for_2fa",+ "posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration",+ "posthog_user"."onboarding_skipped_at",+ "posthog_user"."onboarding_skipped_reason",+ "posthog_user"."onboarding_skipped_organization_id",+ "posthog_user"."onboarding_delegated_to_invite_id",+ "posthog_user"."onboarding_delegated_to_organization_id",+ "posthog_user"."onboarding_delegation_accepted_at",+ "posthog_user"."events_column_config",+ "posthog_user"."email_opt_in",+ "posthog_datawarehousetable"."created_by_id",+ "posthog_datawarehousetable"."created_at",+ "posthog_datawarehousetable"."updated_at",+ "posthog_datawarehousetable"."deleted",+ "posthog_datawarehousetable"."deleted_at",+ "posthog_datawarehousetable"."id",+ "posthog_datawarehousetable"."name",+ "posthog_datawarehousetable"."format",+ "posthog_datawarehousetable"."team_id",+ "posthog_datawarehousetable"."url_pattern",+ "posthog_datawarehousetable"."queryable_folder",+ "posthog_datawarehousetable"."credential_id",+ "posthog_datawarehousetable"."external_data_source_id",+ "posthog_datawarehousetable"."columns",+ "posthog_datawarehousetable"."column_order",+ "posthog_datawarehousetable"."options",+ "posthog_datawarehousetable"."row_count",+ "posthog_datawarehousetable"."size_in_s3_mib",+ "posthog_datawarehousemanagedviewset"."created_by_id",+ "posthog_datawarehousemanagedviewset"."created_at",+ "posthog_datawarehousemanagedviewset"."updated_at",+ "posthog_datawarehousemanagedviewset"."id",+ "posthog_datawarehousemanagedviewset"."team_id",+ "posthog_datawarehousemanagedviewset"."kind"+ FROM "posthog_datawarehousesavedquery"+ LEFT OUTER JOIN "posthog_datawarehousemanagedviewset" ON ("posthog_datawarehousesavedquery"."managed_viewset_id" = "posthog_datawarehousemanagedviewset"."id")+ LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousesavedquery"."created_by_id" = "posthog_user"."id")+ LEFT OUTER JOIN "posthog_datawarehousetable" ON ("posthog_datawarehousesavedquery"."table_id" = "posthog_datawarehousetable"."id")+ WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999+ AND NOT ("posthog_datawarehousesavedquery"."deleted"+ AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)+ AND "posthog_datawarehousesavedquery"."managed_viewset_id" IS NULL)+ ORDER BY "posthog_datawarehousesavedquery"."name" ASC'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.132+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.133'''- SELECT "posthog_user"."id",+ SELECT "posthog_datawarehousesavedquery"."created_by_id",+ "posthog_datawarehousesavedquery"."created_at",+ "posthog_datawarehousesavedquery"."updated_at",+ "posthog_datawarehousesavedquery"."deleted",+ "posthog_datawarehousesavedquery"."deleted_at",+ "posthog_datawarehousesavedquery"."id",+ "posthog_datawarehousesavedquery"."name",+ "posthog_datawarehousesavedquery"."team_id",+ "posthog_datawarehousesavedquery"."latest_error",+ "posthog_datawarehousesavedquery"."columns",+ "posthog_datawarehousesavedquery"."column_order",+ "posthog_datawarehousesavedquery"."external_tables",+ "posthog_datawarehousesavedquery"."query",+ "posthog_datawarehousesavedquery"."status",+ "posthog_datawarehousesavedquery"."last_run_at",+ "posthog_datawarehousesavedquery"."sync_frequency_interval",+ "posthog_datawarehousesavedquery"."table_id",+ "posthog_datawarehousesavedquery"."is_materialized",+ "posthog_datawarehousesavedquery"."deleted_name",+ "posthog_datawarehousesavedquery"."managed_viewset_id",+ "posthog_datawarehousesavedquery"."folder_id",+ "posthog_datawarehousesavedquery"."origin",+ "posthog_datawarehousesavedquery"."is_test",+ "posthog_datawarehousesavedquery"."expires_at",+ "posthog_datawarehousesavedquery"."semantic_enrichment_hash",+ "posthog_user"."id","posthog_user"."password","posthog_user"."last_login","posthog_user"."first_name",@@ -7207,6 +7804,7 @@"posthog_user"."distinct_id","posthog_user"."is_email_verified","posthog_user"."credentials_reviewed_at",+ "posthog_user"."requested_password_reset_at","posthog_user"."requested_2fa_reset_at","posthog_user"."has_seen_product_intro_for","posthog_user"."strapi_id",@@ -7230,284 +7828,239 @@"posthog_user"."onboarding_delegated_to_organization_id","posthog_user"."onboarding_delegation_accepted_at","posthog_user"."events_column_config",- "posthog_user"."email_opt_in"- FROM "posthog_user"- WHERE ("posthog_user"."is_active"- AND "posthog_user"."id" = 99999)- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.133- '''- SELECT "posthog_organization"."id",- "posthog_organization"."name",- "posthog_organization"."slug",- "posthog_organization"."logo_media_id",- "posthog_organization"."created_at",- "posthog_organization"."updated_at",- "posthog_organization"."is_active",- "posthog_organization"."is_not_active_reason",- "posthog_organization"."session_cookie_age",- "posthog_organization"."is_member_join_email_enabled",- "posthog_organization"."is_ai_data_processing_approved",- "posthog_organization"."is_ai_training_opted_in",- "posthog_organization"."is_ai_training_locked",- "posthog_organization"."is_ai_training_cta_shown",- "posthog_organization"."enforce_2fa",- "posthog_organization"."enforce_verified_domains",- "posthog_organization"."members_can_invite",- "posthog_organization"."members_can_create_projects",- "posthog_organization"."members_can_use_personal_api_keys",- "posthog_organization"."members_can_see_org_members",- "posthog_organization"."allow_publicly_shared_resources",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "posthog_organization"."is_pending_deletion",- "posthog_organization"."customer_id",- "posthog_organization"."available_product_features",- "posthog_organization"."usage",- "posthog_organization"."never_drop_data",- "posthog_organization"."customer_trust_scores",- "posthog_organization"."setup_section_2_completed",- "posthog_organization"."personalization",- "posthog_organization"."domain_whitelist",- "posthog_organization"."is_platform"- FROM "posthog_organization"- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid- LIMIT 21- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.134- '''- SELECT "posthog_team"."id",- "posthog_team"."uuid",- "posthog_team"."organization_id",- "posthog_team"."parent_team_id",- "posthog_team"."project_id",- "posthog_team"."api_token",- "posthog_team"."app_urls",- "posthog_team"."name",- "posthog_team"."slack_incoming_webhook",- "posthog_team"."created_at",- "posthog_team"."updated_at",- "posthog_team"."anonymize_ips",- "posthog_team"."completed_snippet_onboarding",- "posthog_team"."has_completed_onboarding_for",- "posthog_team"."onboarding_tasks",- "posthog_team"."ingested_event",- "posthog_team"."ingested_production_event",- "posthog_team"."ingested_production_event_last_checked_at",- "posthog_team"."person_processing_opt_out",- "posthog_team"."secret_api_token",- "posthog_team"."secret_api_token_backup",- "posthog_team"."session_recording_opt_in",- "posthog_team"."session_recording_sample_rate",- "posthog_team"."session_recording_minimum_duration_milliseconds",- "posthog_team"."session_recording_linked_flag",- "posthog_team"."session_recording_network_payload_capture_config",- "posthog_team"."session_recording_masking_config",- "posthog_team"."session_recording_url_trigger_config",- "posthog_team"."session_recording_url_blocklist_config",- "posthog_team"."session_recording_event_trigger_config",- "posthog_team"."session_recording_trigger_match_type_config",- "posthog_team"."session_recording_trigger_groups",- "posthog_team"."session_replay_config",- "posthog_team"."session_recording_retention_period",- "posthog_team"."event_retention_months",- "posthog_team"."conversations_enabled",- "posthog_team"."conversations_settings",- "posthog_team"."proactive_tasks_enabled",- "posthog_team"."survey_config",- "posthog_team"."surveys_opt_in",- "posthog_team"."product_tours_opt_in",- "posthog_team"."capture_console_log_opt_in",- "posthog_team"."capture_performance_opt_in",- "posthog_team"."capture_dead_clicks",- "posthog_team"."autocapture_opt_out",- "posthog_team"."autocapture_web_vitals_opt_in",- "posthog_team"."autocapture_web_vitals_allowed_metrics",- "posthog_team"."autocapture_exceptions_opt_in",- "posthog_team"."autocapture_exceptions_errors_to_ignore",- "posthog_team"."logs_settings",- "posthog_team"."llm_gateway_enabled_at",- "posthog_team"."llm_gateway_revoked_at",- "posthog_team"."llm_gateway_overspend_allowance_usd",- "posthog_team"."heatmaps_opt_in",- "posthog_team"."receive_org_level_activity_logs",- "posthog_team"."web_analytics_pre_aggregated_tables_enabled",- "posthog_team"."web_analytics_pre_aggregated_tables_version",- "posthog_team"."flags_persistence_default",- "posthog_team"."feature_flag_confirmation_enabled",- "posthog_team"."feature_flag_confirmation_message",- "posthog_team"."default_evaluation_environments_enabled",- "posthog_team"."require_evaluation_environment_tags",- "posthog_team"."default_evaluation_contexts_enabled",- "posthog_team"."require_evaluation_contexts",- "posthog_team"."session_recording_version",- "posthog_team"."signup_token",- "posthog_team"."is_demo",- "posthog_team"."access_control",- "posthog_team"."week_start_day",- "posthog_team"."inject_web_apps",- "posthog_team"."test_account_filters",- "posthog_team"."test_account_filters_default_checked",- "posthog_team"."path_cleaning_filters",- "posthog_team"."timezone",- "posthog_team"."data_attributes",- "posthog_team"."person_display_name_properties",- "posthog_team"."live_events_columns",- "posthog_team"."recording_domains",- "posthog_team"."human_friendly_comparison_periods",- "posthog_team"."cookieless_server_hash_mode",- "posthog_team"."primary_dashboard_id",- "posthog_team"."default_data_theme",- "posthog_team"."extra_settings",- "posthog_team"."modifiers",- "posthog_team"."correlation_config",- "posthog_team"."session_recording_retention_period_days",- "posthog_team"."external_data_workspace_id",- "posthog_team"."external_data_workspace_last_synced_at",- "posthog_team"."api_query_rate_limit",- "posthog_team"."drop_events_older_than",- "posthog_team"."base_currency",- "posthog_team"."experiment_recalculation_time",- "posthog_team"."default_experiment_confidence_level",- "posthog_team"."default_experiment_stats_method",- "posthog_team"."business_model",- "posthog_organization"."id",- "posthog_organization"."name",- "posthog_organization"."slug",- "posthog_organization"."logo_media_id",- "posthog_organization"."created_at",- "posthog_organization"."updated_at",- "posthog_organization"."is_active",- "posthog_organization"."is_not_active_reason",- "posthog_organization"."session_cookie_age",- "posthog_organization"."is_member_join_email_enabled",- "posthog_organization"."is_ai_data_processing_approved",- "posthog_organization"."is_ai_training_opted_in",- "posthog_organization"."is_ai_training_locked",- "posthog_organization"."is_ai_training_cta_shown",- "posthog_organization"."enforce_2fa",- "posthog_organization"."enforce_verified_domains",- "posthog_organization"."members_can_invite",- "posthog_organization"."members_can_create_projects",- "posthog_organization"."members_can_use_personal_api_keys",- "posthog_organization"."members_can_see_org_members",- "posthog_organization"."allow_publicly_shared_resources",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "posthog_organization"."is_pending_deletion",- "posthog_organization"."customer_id",- "posthog_organization"."available_product_features",- "posthog_organization"."usage",- "posthog_organization"."never_drop_data",- "posthog_organization"."customer_trust_scores",- "posthog_organization"."setup_section_2_completed",- "posthog_organization"."personalization",- "posthog_organization"."domain_whitelist",- "posthog_organization"."is_platform"- FROM "posthog_team"- INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")- WHERE "posthog_team"."id" = 99999- LIMIT 21+ "posthog_user"."email_opt_in",+ "posthog_datawarehousetable"."created_by_id",+ "posthog_datawarehousetable"."created_at",+ "posthog_datawarehousetable"."updated_at",+ "posthog_datawarehousetable"."deleted",+ "posthog_datawarehousetable"."deleted_at",+ "posthog_datawarehousetable"."id",+ "posthog_datawarehousetable"."name",+ "posthog_datawarehousetable"."format",+ "posthog_datawarehousetable"."team_id",+ "posthog_datawarehousetable"."url_pattern",+ "posthog_datawarehousetable"."queryable_folder",+ "posthog_datawarehousetable"."credential_id",+ "posthog_datawarehousetable"."external_data_source_id",+ "posthog_datawarehousetable"."columns",+ "posthog_datawarehousetable"."column_order",+ "posthog_datawarehousetable"."options",+ "posthog_datawarehousetable"."row_count",+ "posthog_datawarehousetable"."size_in_s3_mib"+ FROM "posthog_datawarehousesavedquery"+ LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousesavedquery"."created_by_id" = "posthog_user"."id")+ LEFT OUTER JOIN "posthog_datawarehousetable" ON ("posthog_datawarehousesavedquery"."table_id" = "posthog_datawarehousetable"."id")+ WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999+ AND "posthog_datawarehousesavedquery"."origin" = 'endpoint'+ AND NOT ("posthog_datawarehousesavedquery"."deleted"+ AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.134+ '''+ SELECT "posthog_externaldatasource"."created_by_id",+ "posthog_externaldatasource"."created_at",+ "posthog_externaldatasource"."updated_at",+ "posthog_externaldatasource"."deleted",+ "posthog_externaldatasource"."deleted_at",+ "posthog_externaldatasource"."id",+ "posthog_externaldatasource"."source_id",+ "posthog_externaldatasource"."connection_id",+ "posthog_externaldatasource"."destination_id",+ "posthog_externaldatasource"."team_id",+ "posthog_externaldatasource"."sync_frequency",+ "posthog_externaldatasource"."status",+ "posthog_externaldatasource"."source_type",+ "posthog_externaldatasource"."api_version",+ "posthog_externaldatasource"."job_inputs",+ "posthog_externaldatasource"."connection_metadata",+ "posthog_externaldatasource"."are_tables_created",+ "posthog_externaldatasource"."prefix",+ "posthog_externaldatasource"."description",+ "posthog_externaldatasource"."created_via",+ "posthog_externaldatasource"."access_method",+ "posthog_externaldatasource"."direct_query_enabled",+ "posthog_externaldatasource"."auto_sync_new_schemas",+ "posthog_externaldatasource"."auto_sync_schema_patterns",+ "posthog_externaldatasource"."revenue_analytics_enabled",+ "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",+ "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",+ "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"+ FROM "posthog_externaldatasource"+ LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")+ WHERE ("posthog_externaldatasource"."source_type" IN ('Stripe')+ AND "posthog_externaldatasource"."team_id" = 99999+ AND NOT ("posthog_externaldatasource"."deleted"+ AND "posthog_externaldatasource"."deleted" IS NOT NULL))'''# ---# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.135'''- SELECT "posthog_organizationmembership"."id",- "posthog_organizationmembership"."organization_id",- "posthog_organizationmembership"."user_id",- "posthog_organizationmembership"."level",- "posthog_organizationmembership"."joined_at",- "posthog_organizationmembership"."updated_at",- "posthog_organizationmembership"."invited_by_id",- "posthog_organization"."id",- "posthog_organization"."name",- "posthog_organization"."slug",- "posthog_organization"."logo_media_id",- "posthog_organization"."created_at",- "posthog_organization"."updated_at",- "posthog_organization"."is_active",- "posthog_organization"."is_not_active_reason",- "posthog_organization"."session_cookie_age",- "posthog_organization"."is_member_join_email_enabled",- "posthog_organization"."is_ai_data_processing_approved",- "posthog_organization"."is_ai_training_opted_in",- "posthog_organization"."is_ai_training_locked",- "posthog_organization"."is_ai_training_cta_shown",- "posthog_organization"."enforce_2fa",- "posthog_organization"."enforce_verified_domains",- "posthog_organization"."members_can_invite",- "posthog_organization"."members_can_create_projects",- "posthog_organization"."members_can_use_personal_api_keys",- "posthog_organization"."members_can_see_org_members",- "posthog_organization"."allow_publicly_shared_resources",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "posthog_organization"."is_pending_deletion",- "posthog_organization"."customer_id",- "posthog_organization"."available_product_features",- "posthog_organization"."usage",- "posthog_organization"."never_drop_data",- "posthog_organization"."customer_trust_scores",- "posthog_organization"."setup_section_2_completed",- "posthog_organization"."personalization",- "posthog_organization"."domain_whitelist",- "posthog_organization"."is_platform"- FROM "posthog_organizationmembership"- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999)- LIMIT 21+ SELECT "posthog_datawarehousetable"."created_by_id",+ "posthog_datawarehousetable"."created_at",+ "posthog_datawarehousetable"."updated_at",+ "posthog_datawarehousetable"."deleted",+ "posthog_datawarehousetable"."deleted_at",+ "posthog_datawarehousetable"."id",+ "posthog_datawarehousetable"."name",+ "posthog_datawarehousetable"."format",+ "posthog_datawarehousetable"."team_id",+ "posthog_datawarehousetable"."url_pattern",+ "posthog_datawarehousetable"."queryable_folder",+ "posthog_datawarehousetable"."credential_id",+ "posthog_datawarehousetable"."external_data_source_id",+ "posthog_datawarehousetable"."columns",+ "posthog_datawarehousetable"."column_order",+ "posthog_datawarehousetable"."options",+ "posthog_datawarehousetable"."row_count",+ "posthog_datawarehousetable"."size_in_s3_mib",+ "posthog_user"."id",+ "posthog_user"."password",+ "posthog_user"."last_login",+ "posthog_user"."first_name",+ "posthog_user"."last_name",+ "posthog_user"."is_staff",+ "posthog_user"."date_joined",+ "posthog_user"."uuid",+ "posthog_user"."current_organization_id",+ "posthog_user"."current_team_id",+ "posthog_user"."email",+ "posthog_user"."pending_email",+ "posthog_user"."distinct_id",+ "posthog_user"."is_email_verified",+ "posthog_user"."credentials_reviewed_at",+ "posthog_user"."requested_password_reset_at",+ "posthog_user"."requested_2fa_reset_at",+ "posthog_user"."has_seen_product_intro_for",+ "posthog_user"."strapi_id",+ "posthog_user"."is_active",+ "posthog_user"."role_at_organization",+ "posthog_user"."theme_mode",+ "posthog_user"."partial_notification_settings",+ "posthog_user"."anonymize_data",+ "posthog_user"."allow_impersonation",+ "posthog_user"."toolbar_mode",+ "posthog_user"."hedgehog_config",+ "posthog_user"."allow_sidebar_suggestions",+ "posthog_user"."shortcut_position",+ "posthog_user"."passkeys_enabled_for_2fa",+ "posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration",+ "posthog_user"."onboarding_skipped_at",+ "posthog_user"."onboarding_skipped_reason",+ "posthog_user"."onboarding_skipped_organization_id",+ "posthog_user"."onboarding_delegated_to_invite_id",+ "posthog_user"."onboarding_delegated_to_organization_id",+ "posthog_user"."onboarding_delegation_accepted_at",+ "posthog_user"."events_column_config",+ "posthog_user"."email_opt_in"+ FROM "posthog_datawarehousetable"+ LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")+ LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousetable"."created_by_id" = "posthog_user"."id")+ WHERE ("posthog_datawarehousetable"."team_id" = 99999+ AND NOT ("posthog_datawarehousetable"."deleted"+ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)+ AND NOT ("posthog_externaldatasource"."deleted"+ AND "posthog_externaldatasource"."deleted" IS NOT NULL)+ AND NOT ("posthog_externaldatasource"."access_method" = 'direct'+ AND "posthog_externaldatasource"."access_method" IS NOT NULL))+ ORDER BY "posthog_datawarehousetable"."created_at" DESC'''# ---# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.136'''- 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",- "posthog_team"."organization_id" AS "_team_organization_id"- FROM "ee_accesscontrol"- INNER JOIN "posthog_team" ON ("ee_accesscontrol"."team_id" = "posthog_team"."id")- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")- WHERE (("ee_accesscontrol"."organization_member_id" IS NULL- AND "ee_accesscontrol"."role_id" IS NULL- AND "ee_accesscontrol"."team_id" = 99999)- OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999- AND "ee_accesscontrol"."role_id" IS NULL- AND "ee_accesscontrol"."team_id" = 99999))+ SELECT "posthog_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.137+ '''+ SELECT "data_tools_datawarehouseexpression"."deleted",+ "data_tools_datawarehouseexpression"."deleted_at",+ "data_tools_datawarehouseexpression"."id",+ "data_tools_datawarehouseexpression"."team_id",+ "data_tools_datawarehouseexpression"."created_at",+ "data_tools_datawarehouseexpression"."created_by_id",+ "data_tools_datawarehouseexpression"."table_name",+ "data_tools_datawarehouseexpression"."field_name",+ "data_tools_datawarehouseexpression"."expression",+ "data_tools_datawarehouseexpression"."connection_id"+ FROM "data_tools_datawarehouseexpression"+ WHERE ("data_tools_datawarehouseexpression"."team_id" = 99999+ AND NOT ("data_tools_datawarehouseexpression"."deleted"+ AND "data_tools_datawarehouseexpression"."deleted" IS NOT NULL)+ AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.138+ '''+ 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"."full_recording_v2_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",+ "posthog_sessionrecording"."retention_period_days"+ 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+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.139'''- SELECT "posthog_organizationmembership"."id",- "posthog_organizationmembership"."organization_id",- "posthog_organizationmembership"."user_id",- "posthog_organizationmembership"."level",- "posthog_organizationmembership"."joined_at",- "posthog_organizationmembership"."updated_at",- "posthog_organizationmembership"."invited_by_id",- "posthog_organization"."id",+ SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"+ FROM "posthog_sessionrecordingviewed"+ WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999+ AND "posthog_sessionrecordingviewed"."user_id" = 99999+ AND "posthog_sessionrecordingviewed"."session_id" IN ('8',+ '7',+ '6',+ '5',+ '4',+ '3',+ '2',+ '1'))+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.14+ '''+ SELECT "posthog_organization"."id","posthog_organization"."name","posthog_organization"."slug","posthog_organization"."logo_media_id",@@ -7544,141 +8097,32 @@"posthog_organization"."personalization","posthog_organization"."domain_whitelist","posthog_organization"."is_platform"- FROM "posthog_organizationmembership"- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE "posthog_organizationmembership"."user_id" = 99999+ FROM "posthog_organization"+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid+ LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.138+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.140'''- SELECT "posthog_datawarehousesavedquery"."created_by_id",- "posthog_datawarehousesavedquery"."created_at",- "posthog_datawarehousesavedquery"."updated_at",- "posthog_datawarehousesavedquery"."deleted",- "posthog_datawarehousesavedquery"."deleted_at",- "posthog_datawarehousesavedquery"."id",- "posthog_datawarehousesavedquery"."name",- "posthog_datawarehousesavedquery"."team_id",- "posthog_datawarehousesavedquery"."latest_error",- "posthog_datawarehousesavedquery"."columns",- "posthog_datawarehousesavedquery"."column_order",- "posthog_datawarehousesavedquery"."external_tables",- "posthog_datawarehousesavedquery"."query",- "posthog_datawarehousesavedquery"."status",- "posthog_datawarehousesavedquery"."last_run_at",- "posthog_datawarehousesavedquery"."sync_frequency_interval",- "posthog_datawarehousesavedquery"."table_id",- "posthog_datawarehousesavedquery"."is_materialized",- "posthog_datawarehousesavedquery"."deleted_name",- "posthog_datawarehousesavedquery"."managed_viewset_id",- "posthog_datawarehousesavedquery"."folder_id",- "posthog_datawarehousesavedquery"."origin",- "posthog_datawarehousesavedquery"."is_test",- "posthog_datawarehousesavedquery"."expires_at",- "posthog_datawarehousesavedquery"."semantic_enrichment_hash",- "posthog_user"."id",- "posthog_user"."password",- "posthog_user"."last_login",- "posthog_user"."first_name",- "posthog_user"."last_name",- "posthog_user"."is_staff",- "posthog_user"."date_joined",- "posthog_user"."uuid",- "posthog_user"."current_organization_id",- "posthog_user"."current_team_id",- "posthog_user"."email",- "posthog_user"."pending_email",- "posthog_user"."distinct_id",- "posthog_user"."is_email_verified",- "posthog_user"."credentials_reviewed_at",- "posthog_user"."requested_password_reset_at",- "posthog_user"."requested_2fa_reset_at",- "posthog_user"."has_seen_product_intro_for",- "posthog_user"."strapi_id",- "posthog_user"."is_active",- "posthog_user"."role_at_organization",- "posthog_user"."theme_mode",- "posthog_user"."partial_notification_settings",- "posthog_user"."anonymize_data",- "posthog_user"."allow_impersonation",- "posthog_user"."toolbar_mode",- "posthog_user"."hedgehog_config",- "posthog_user"."allow_sidebar_suggestions",- "posthog_user"."shortcut_position",- "posthog_user"."passkeys_enabled_for_2fa",- "posthog_user"."hide_mcp_hints",- "posthog_user"."ui_configuration",- "posthog_user"."onboarding_skipped_at",- "posthog_user"."onboarding_skipped_reason",- "posthog_user"."onboarding_skipped_organization_id",- "posthog_user"."onboarding_delegated_to_invite_id",- "posthog_user"."onboarding_delegated_to_organization_id",- "posthog_user"."onboarding_delegation_accepted_at",- "posthog_user"."events_column_config",- "posthog_user"."email_opt_in",- "posthog_datawarehousetable"."created_by_id",- "posthog_datawarehousetable"."created_at",- "posthog_datawarehousetable"."updated_at",- "posthog_datawarehousetable"."deleted",- "posthog_datawarehousetable"."deleted_at",- "posthog_datawarehousetable"."id",- "posthog_datawarehousetable"."name",- "posthog_datawarehousetable"."format",- "posthog_datawarehousetable"."team_id",- "posthog_datawarehousetable"."url_pattern",- "posthog_datawarehousetable"."queryable_folder",- "posthog_datawarehousetable"."credential_id",- "posthog_datawarehousetable"."external_data_source_id",- "posthog_datawarehousetable"."columns",- "posthog_datawarehousetable"."column_order",- "posthog_datawarehousetable"."options",- "posthog_datawarehousetable"."row_count",- "posthog_datawarehousetable"."size_in_s3_mib",- "posthog_datawarehousemanagedviewset"."created_by_id",- "posthog_datawarehousemanagedviewset"."created_at",- "posthog_datawarehousemanagedviewset"."updated_at",- "posthog_datawarehousemanagedviewset"."id",- "posthog_datawarehousemanagedviewset"."team_id",- "posthog_datawarehousemanagedviewset"."kind"- FROM "posthog_datawarehousesavedquery"- LEFT OUTER JOIN "posthog_datawarehousemanagedviewset" ON ("posthog_datawarehousesavedquery"."managed_viewset_id" = "posthog_datawarehousemanagedviewset"."id")- LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousesavedquery"."created_by_id" = "posthog_user"."id")- LEFT OUTER JOIN "posthog_datawarehousetable" ON ("posthog_datawarehousesavedquery"."table_id" = "posthog_datawarehousetable"."id")- WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999- AND NOT ("posthog_datawarehousesavedquery"."deleted"- AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)- AND "posthog_datawarehousesavedquery"."managed_viewset_id" IS NULL)- ORDER BY "posthog_datawarehousesavedquery"."name" ASC+ SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id",+ "posthog_user"."email" AS "user__email"+ FROM "posthog_sessionrecordingviewed"+ INNER JOIN "posthog_user" ON ("posthog_sessionrecordingviewed"."user_id" = "posthog_user"."id")+ WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('8',+ '7',+ '6',+ '5',+ '4',+ '3',+ '2',+ '1')+ AND "posthog_sessionrecordingviewed"."team_id" = 99999+ AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.139+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.141'''- SELECT "posthog_datawarehousesavedquery"."created_by_id",- "posthog_datawarehousesavedquery"."created_at",- "posthog_datawarehousesavedquery"."updated_at",- "posthog_datawarehousesavedquery"."deleted",- "posthog_datawarehousesavedquery"."deleted_at",- "posthog_datawarehousesavedquery"."id",- "posthog_datawarehousesavedquery"."name",- "posthog_datawarehousesavedquery"."team_id",- "posthog_datawarehousesavedquery"."latest_error",- "posthog_datawarehousesavedquery"."columns",- "posthog_datawarehousesavedquery"."column_order",- "posthog_datawarehousesavedquery"."external_tables",- "posthog_datawarehousesavedquery"."query",- "posthog_datawarehousesavedquery"."status",- "posthog_datawarehousesavedquery"."last_run_at",- "posthog_datawarehousesavedquery"."sync_frequency_interval",- "posthog_datawarehousesavedquery"."table_id",- "posthog_datawarehousesavedquery"."is_materialized",- "posthog_datawarehousesavedquery"."deleted_name",- "posthog_datawarehousesavedquery"."managed_viewset_id",- "posthog_datawarehousesavedquery"."folder_id",- "posthog_datawarehousesavedquery"."origin",- "posthog_datawarehousesavedquery"."is_test",- "posthog_datawarehousesavedquery"."expires_at",- "posthog_datawarehousesavedquery"."semantic_enrichment_hash",- "posthog_user"."id",+ SELECT "posthog_user"."id","posthog_user"."password","posthog_user"."last_login","posthog_user"."first_name",@@ -7693,7 +8137,6 @@"posthog_user"."distinct_id","posthog_user"."is_email_verified","posthog_user"."credentials_reviewed_at",- "posthog_user"."requested_password_reset_at","posthog_user"."requested_2fa_reset_at","posthog_user"."has_seen_product_intro_for","posthog_user"."strapi_id",@@ -7717,35 +8160,57 @@"posthog_user"."onboarding_delegated_to_organization_id","posthog_user"."onboarding_delegation_accepted_at","posthog_user"."events_column_config",- "posthog_user"."email_opt_in",- "posthog_datawarehousetable"."created_by_id",- "posthog_datawarehousetable"."created_at",- "posthog_datawarehousetable"."updated_at",- "posthog_datawarehousetable"."deleted",- "posthog_datawarehousetable"."deleted_at",- "posthog_datawarehousetable"."id",- "posthog_datawarehousetable"."name",- "posthog_datawarehousetable"."format",- "posthog_datawarehousetable"."team_id",- "posthog_datawarehousetable"."url_pattern",- "posthog_datawarehousetable"."queryable_folder",- "posthog_datawarehousetable"."credential_id",- "posthog_datawarehousetable"."external_data_source_id",- "posthog_datawarehousetable"."columns",- "posthog_datawarehousetable"."column_order",- "posthog_datawarehousetable"."options",- "posthog_datawarehousetable"."row_count",- "posthog_datawarehousetable"."size_in_s3_mib"- FROM "posthog_datawarehousesavedquery"- LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousesavedquery"."created_by_id" = "posthog_user"."id")- LEFT OUTER JOIN "posthog_datawarehousetable" ON ("posthog_datawarehousesavedquery"."table_id" = "posthog_datawarehousetable"."id")- WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999- AND "posthog_datawarehousesavedquery"."origin" = 'endpoint'- AND NOT ("posthog_datawarehousesavedquery"."deleted"- AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))+ "posthog_user"."email_opt_in"+ FROM "posthog_user"+ WHERE ("posthog_user"."is_active"+ AND "posthog_user"."id" = 99999)'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.14+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.142+ '''+ SELECT "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organization"+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid+ LIMIT 21+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.143'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -7885,64 +8350,215 @@LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.140+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.144'''- SELECT "posthog_externaldatasource"."created_by_id",- "posthog_externaldatasource"."created_at",- "posthog_externaldatasource"."updated_at",- "posthog_externaldatasource"."deleted",- "posthog_externaldatasource"."deleted_at",- "posthog_externaldatasource"."id",- "posthog_externaldatasource"."source_id",- "posthog_externaldatasource"."connection_id",- "posthog_externaldatasource"."destination_id",- "posthog_externaldatasource"."team_id",- "posthog_externaldatasource"."sync_frequency",- "posthog_externaldatasource"."status",- "posthog_externaldatasource"."source_type",- "posthog_externaldatasource"."api_version",- "posthog_externaldatasource"."job_inputs",- "posthog_externaldatasource"."connection_metadata",- "posthog_externaldatasource"."are_tables_created",- "posthog_externaldatasource"."prefix",- "posthog_externaldatasource"."description",- "posthog_externaldatasource"."created_via",- "posthog_externaldatasource"."access_method",- "posthog_externaldatasource"."direct_query_enabled",- "posthog_externaldatasource"."auto_sync_new_schemas",- "posthog_externaldatasource"."auto_sync_schema_patterns",- "posthog_externaldatasource"."revenue_analytics_enabled",- "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",- "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",- "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"- FROM "posthog_externaldatasource"- LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")- WHERE ("posthog_externaldatasource"."source_type" IN ('Stripe')- AND "posthog_externaldatasource"."team_id" = 99999- AND NOT ("posthog_externaldatasource"."deleted"- AND "posthog_externaldatasource"."deleted" IS NOT NULL))+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.141+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.145'''- SELECT "posthog_datawarehousetable"."created_by_id",- "posthog_datawarehousetable"."created_at",- "posthog_datawarehousetable"."updated_at",- "posthog_datawarehousetable"."deleted",- "posthog_datawarehousetable"."deleted_at",- "posthog_datawarehousetable"."id",- "posthog_datawarehousetable"."name",- "posthog_datawarehousetable"."format",- "posthog_datawarehousetable"."team_id",- "posthog_datawarehousetable"."url_pattern",- "posthog_datawarehousetable"."queryable_folder",- "posthog_datawarehousetable"."credential_id",- "posthog_datawarehousetable"."external_data_source_id",- "posthog_datawarehousetable"."columns",- "posthog_datawarehousetable"."column_order",- "posthog_datawarehousetable"."options",- "posthog_datawarehousetable"."row_count",- "posthog_datawarehousetable"."size_in_s3_mib",+ 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",+ "posthog_team"."organization_id" AS "_team_organization_id"+ FROM "ee_accesscontrol"+ INNER JOIN "posthog_team" ON ("ee_accesscontrol"."team_id" = "posthog_team"."id")+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")+ WHERE (("ee_accesscontrol"."organization_member_id" IS NULL+ AND "ee_accesscontrol"."role_id" IS NULL+ AND "ee_accesscontrol"."team_id" = 99999)+ OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999+ AND "ee_accesscontrol"."role_id" IS NULL+ AND "ee_accesscontrol"."team_id" = 99999))+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.146+ '''+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE "posthog_organizationmembership"."user_id" = 99999+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.147+ '''+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.148+ '''+ SELECT "posthog_datawarehousesavedquery"."created_by_id",+ "posthog_datawarehousesavedquery"."created_at",+ "posthog_datawarehousesavedquery"."updated_at",+ "posthog_datawarehousesavedquery"."deleted",+ "posthog_datawarehousesavedquery"."deleted_at",+ "posthog_datawarehousesavedquery"."id",+ "posthog_datawarehousesavedquery"."name",+ "posthog_datawarehousesavedquery"."team_id",+ "posthog_datawarehousesavedquery"."latest_error",+ "posthog_datawarehousesavedquery"."columns",+ "posthog_datawarehousesavedquery"."column_order",+ "posthog_datawarehousesavedquery"."external_tables",+ "posthog_datawarehousesavedquery"."query",+ "posthog_datawarehousesavedquery"."status",+ "posthog_datawarehousesavedquery"."last_run_at",+ "posthog_datawarehousesavedquery"."sync_frequency_interval",+ "posthog_datawarehousesavedquery"."table_id",+ "posthog_datawarehousesavedquery"."is_materialized",+ "posthog_datawarehousesavedquery"."deleted_name",+ "posthog_datawarehousesavedquery"."managed_viewset_id",+ "posthog_datawarehousesavedquery"."folder_id",+ "posthog_datawarehousesavedquery"."origin",+ "posthog_datawarehousesavedquery"."is_test",+ "posthog_datawarehousesavedquery"."expires_at",+ "posthog_datawarehousesavedquery"."semantic_enrichment_hash","posthog_user"."id","posthog_user"."password","posthog_user"."last_login",@@ -7982,135 +8598,70 @@"posthog_user"."onboarding_delegated_to_organization_id","posthog_user"."onboarding_delegation_accepted_at","posthog_user"."events_column_config",- "posthog_user"."email_opt_in"- FROM "posthog_datawarehousetable"- LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")- LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousetable"."created_by_id" = "posthog_user"."id")- WHERE ("posthog_datawarehousetable"."team_id" = 99999- AND NOT ("posthog_datawarehousetable"."deleted"- AND "posthog_datawarehousetable"."deleted" IS NOT NULL)- AND NOT ("posthog_externaldatasource"."deleted"- AND "posthog_externaldatasource"."deleted" IS NOT NULL)- AND NOT ("posthog_externaldatasource"."access_method" = 'direct'- AND "posthog_externaldatasource"."access_method" IS NOT NULL))- ORDER BY "posthog_datawarehousetable"."created_at" DESC- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.142- '''- 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.143- '''- SELECT "data_tools_datawarehouseexpression"."deleted",- "data_tools_datawarehouseexpression"."deleted_at",- "data_tools_datawarehouseexpression"."id",- "data_tools_datawarehouseexpression"."team_id",- "data_tools_datawarehouseexpression"."created_at",- "data_tools_datawarehouseexpression"."created_by_id",- "data_tools_datawarehouseexpression"."table_name",- "data_tools_datawarehouseexpression"."field_name",- "data_tools_datawarehouseexpression"."expression",- "data_tools_datawarehouseexpression"."connection_id"- FROM "data_tools_datawarehouseexpression"- WHERE ("data_tools_datawarehouseexpression"."team_id" = 99999- AND NOT ("data_tools_datawarehouseexpression"."deleted"- AND "data_tools_datawarehouseexpression"."deleted" IS NOT NULL)- AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.144- '''- 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"."full_recording_v2_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",- "posthog_sessionrecording"."retention_period_days"- 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.145- '''- SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"- FROM "posthog_sessionrecordingviewed"- WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999- AND "posthog_sessionrecordingviewed"."user_id" = 99999- AND "posthog_sessionrecordingviewed"."session_id" IN ('9',- '8',- '7',- '6',- '5',- '4',- '3',- '2',- '1'))- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.146- '''- SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id",- "posthog_user"."email" AS "user__email"- FROM "posthog_sessionrecordingviewed"- INNER JOIN "posthog_user" ON ("posthog_sessionrecordingviewed"."user_id" = "posthog_user"."id")- WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('9',- '8',- '7',- '6',- '5',- '4',- '3',- '2',- '1')- AND "posthog_sessionrecordingviewed"."team_id" = 99999- AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))+ "posthog_user"."email_opt_in",+ "posthog_datawarehousetable"."created_by_id",+ "posthog_datawarehousetable"."created_at",+ "posthog_datawarehousetable"."updated_at",+ "posthog_datawarehousetable"."deleted",+ "posthog_datawarehousetable"."deleted_at",+ "posthog_datawarehousetable"."id",+ "posthog_datawarehousetable"."name",+ "posthog_datawarehousetable"."format",+ "posthog_datawarehousetable"."team_id",+ "posthog_datawarehousetable"."url_pattern",+ "posthog_datawarehousetable"."queryable_folder",+ "posthog_datawarehousetable"."credential_id",+ "posthog_datawarehousetable"."external_data_source_id",+ "posthog_datawarehousetable"."columns",+ "posthog_datawarehousetable"."column_order",+ "posthog_datawarehousetable"."options",+ "posthog_datawarehousetable"."row_count",+ "posthog_datawarehousetable"."size_in_s3_mib",+ "posthog_datawarehousemanagedviewset"."created_by_id",+ "posthog_datawarehousemanagedviewset"."created_at",+ "posthog_datawarehousemanagedviewset"."updated_at",+ "posthog_datawarehousemanagedviewset"."id",+ "posthog_datawarehousemanagedviewset"."team_id",+ "posthog_datawarehousemanagedviewset"."kind"+ FROM "posthog_datawarehousesavedquery"+ LEFT OUTER JOIN "posthog_datawarehousemanagedviewset" ON ("posthog_datawarehousesavedquery"."managed_viewset_id" = "posthog_datawarehousemanagedviewset"."id")+ LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousesavedquery"."created_by_id" = "posthog_user"."id")+ LEFT OUTER JOIN "posthog_datawarehousetable" ON ("posthog_datawarehousesavedquery"."table_id" = "posthog_datawarehousetable"."id")+ WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999+ AND NOT ("posthog_datawarehousesavedquery"."deleted"+ AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)+ AND "posthog_datawarehousesavedquery"."managed_viewset_id" IS NULL)+ ORDER BY "posthog_datawarehousesavedquery"."name" ASC'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.147+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.149'''- SELECT "posthog_user"."id",+ SELECT "posthog_datawarehousesavedquery"."created_by_id",+ "posthog_datawarehousesavedquery"."created_at",+ "posthog_datawarehousesavedquery"."updated_at",+ "posthog_datawarehousesavedquery"."deleted",+ "posthog_datawarehousesavedquery"."deleted_at",+ "posthog_datawarehousesavedquery"."id",+ "posthog_datawarehousesavedquery"."name",+ "posthog_datawarehousesavedquery"."team_id",+ "posthog_datawarehousesavedquery"."latest_error",+ "posthog_datawarehousesavedquery"."columns",+ "posthog_datawarehousesavedquery"."column_order",+ "posthog_datawarehousesavedquery"."external_tables",+ "posthog_datawarehousesavedquery"."query",+ "posthog_datawarehousesavedquery"."status",+ "posthog_datawarehousesavedquery"."last_run_at",+ "posthog_datawarehousesavedquery"."sync_frequency_interval",+ "posthog_datawarehousesavedquery"."table_id",+ "posthog_datawarehousesavedquery"."is_materialized",+ "posthog_datawarehousesavedquery"."deleted_name",+ "posthog_datawarehousesavedquery"."managed_viewset_id",+ "posthog_datawarehousesavedquery"."folder_id",+ "posthog_datawarehousesavedquery"."origin",+ "posthog_datawarehousesavedquery"."is_test",+ "posthog_datawarehousesavedquery"."expires_at",+ "posthog_datawarehousesavedquery"."semantic_enrichment_hash",+ "posthog_user"."id","posthog_user"."password","posthog_user"."last_login","posthog_user"."first_name",@@ -8125,80 +8676,59 @@"posthog_user"."distinct_id","posthog_user"."is_email_verified","posthog_user"."credentials_reviewed_at",+ "posthog_user"."requested_password_reset_at","posthog_user"."requested_2fa_reset_at","posthog_user"."has_seen_product_intro_for","posthog_user"."strapi_id","posthog_user"."is_active","posthog_user"."role_at_organization","posthog_user"."theme_mode",- "posthog_user"."partial_notification_settings",- "posthog_user"."anonymize_data",- "posthog_user"."allow_impersonation",- "posthog_user"."toolbar_mode",- "posthog_user"."hedgehog_config",- "posthog_user"."allow_sidebar_suggestions",- "posthog_user"."shortcut_position",- "posthog_user"."passkeys_enabled_for_2fa",- "posthog_user"."hide_mcp_hints",- "posthog_user"."ui_configuration",- "posthog_user"."onboarding_skipped_at",- "posthog_user"."onboarding_skipped_reason",- "posthog_user"."onboarding_skipped_organization_id",- "posthog_user"."onboarding_delegated_to_invite_id",- "posthog_user"."onboarding_delegated_to_organization_id",- "posthog_user"."onboarding_delegation_accepted_at",- "posthog_user"."events_column_config",- "posthog_user"."email_opt_in"- FROM "posthog_user"- WHERE ("posthog_user"."is_active"- AND "posthog_user"."id" = 99999)- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.148- '''- SELECT "posthog_organization"."id",- "posthog_organization"."name",- "posthog_organization"."slug",- "posthog_organization"."logo_media_id",- "posthog_organization"."created_at",- "posthog_organization"."updated_at",- "posthog_organization"."is_active",- "posthog_organization"."is_not_active_reason",- "posthog_organization"."session_cookie_age",- "posthog_organization"."is_member_join_email_enabled",- "posthog_organization"."is_ai_data_processing_approved",- "posthog_organization"."is_ai_training_opted_in",- "posthog_organization"."is_ai_training_locked",- "posthog_organization"."is_ai_training_cta_shown",- "posthog_organization"."enforce_2fa",- "posthog_organization"."enforce_verified_domains",- "posthog_organization"."members_can_invite",- "posthog_organization"."members_can_create_projects",- "posthog_organization"."members_can_use_personal_api_keys",- "posthog_organization"."members_can_see_org_members",- "posthog_organization"."allow_publicly_shared_resources",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "posthog_organization"."is_pending_deletion",- "posthog_organization"."customer_id",- "posthog_organization"."available_product_features",- "posthog_organization"."usage",- "posthog_organization"."never_drop_data",- "posthog_organization"."customer_trust_scores",- "posthog_organization"."setup_section_2_completed",- "posthog_organization"."personalization",- "posthog_organization"."domain_whitelist",- "posthog_organization"."is_platform"- FROM "posthog_organization"- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid- LIMIT 21+ "posthog_user"."partial_notification_settings",+ "posthog_user"."anonymize_data",+ "posthog_user"."allow_impersonation",+ "posthog_user"."toolbar_mode",+ "posthog_user"."hedgehog_config",+ "posthog_user"."allow_sidebar_suggestions",+ "posthog_user"."shortcut_position",+ "posthog_user"."passkeys_enabled_for_2fa",+ "posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration",+ "posthog_user"."onboarding_skipped_at",+ "posthog_user"."onboarding_skipped_reason",+ "posthog_user"."onboarding_skipped_organization_id",+ "posthog_user"."onboarding_delegated_to_invite_id",+ "posthog_user"."onboarding_delegated_to_organization_id",+ "posthog_user"."onboarding_delegation_accepted_at",+ "posthog_user"."events_column_config",+ "posthog_user"."email_opt_in",+ "posthog_datawarehousetable"."created_by_id",+ "posthog_datawarehousetable"."created_at",+ "posthog_datawarehousetable"."updated_at",+ "posthog_datawarehousetable"."deleted",+ "posthog_datawarehousetable"."deleted_at",+ "posthog_datawarehousetable"."id",+ "posthog_datawarehousetable"."name",+ "posthog_datawarehousetable"."format",+ "posthog_datawarehousetable"."team_id",+ "posthog_datawarehousetable"."url_pattern",+ "posthog_datawarehousetable"."queryable_folder",+ "posthog_datawarehousetable"."credential_id",+ "posthog_datawarehousetable"."external_data_source_id",+ "posthog_datawarehousetable"."columns",+ "posthog_datawarehousetable"."column_order",+ "posthog_datawarehousetable"."options",+ "posthog_datawarehousetable"."row_count",+ "posthog_datawarehousetable"."size_in_s3_mib"+ FROM "posthog_datawarehousesavedquery"+ LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousesavedquery"."created_by_id" = "posthog_user"."id")+ LEFT OUTER JOIN "posthog_datawarehousetable" ON ("posthog_datawarehousesavedquery"."table_id" = "posthog_datawarehousetable"."id")+ WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999+ AND "posthog_datawarehousesavedquery"."origin" = 'endpoint'+ AND NOT ("posthog_datawarehousesavedquery"."deleted"+ AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.149+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.15'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -8338,256 +8868,47 @@LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.15- '''- SELECT "posthog_organizationmembership"."id",- "posthog_organizationmembership"."organization_id",- "posthog_organizationmembership"."user_id",- "posthog_organizationmembership"."level",- "posthog_organizationmembership"."joined_at",- "posthog_organizationmembership"."updated_at",- "posthog_organizationmembership"."invited_by_id",- "posthog_organization"."id",- "posthog_organization"."name",- "posthog_organization"."slug",- "posthog_organization"."logo_media_id",- "posthog_organization"."created_at",- "posthog_organization"."updated_at",- "posthog_organization"."is_active",- "posthog_organization"."is_not_active_reason",- "posthog_organization"."session_cookie_age",- "posthog_organization"."is_member_join_email_enabled",- "posthog_organization"."is_ai_data_processing_approved",- "posthog_organization"."is_ai_training_opted_in",- "posthog_organization"."is_ai_training_locked",- "posthog_organization"."is_ai_training_cta_shown",- "posthog_organization"."enforce_2fa",- "posthog_organization"."enforce_verified_domains",- "posthog_organization"."members_can_invite",- "posthog_organization"."members_can_create_projects",- "posthog_organization"."members_can_use_personal_api_keys",- "posthog_organization"."members_can_see_org_members",- "posthog_organization"."allow_publicly_shared_resources",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "posthog_organization"."is_pending_deletion",- "posthog_organization"."customer_id",- "posthog_organization"."available_product_features",- "posthog_organization"."usage",- "posthog_organization"."never_drop_data",- "posthog_organization"."customer_trust_scores",- "posthog_organization"."setup_section_2_completed",- "posthog_organization"."personalization",- "posthog_organization"."domain_whitelist",- "posthog_organization"."is_platform"- FROM "posthog_organizationmembership"- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999)- LIMIT 21- '''-# ---# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.150'''- SELECT "posthog_organizationmembership"."id",- "posthog_organizationmembership"."organization_id",- "posthog_organizationmembership"."user_id",- "posthog_organizationmembership"."level",- "posthog_organizationmembership"."joined_at",- "posthog_organizationmembership"."updated_at",- "posthog_organizationmembership"."invited_by_id",- "posthog_organization"."id",- "posthog_organization"."name",- "posthog_organization"."slug",- "posthog_organization"."logo_media_id",- "posthog_organization"."created_at",- "posthog_organization"."updated_at",- "posthog_organization"."is_active",- "posthog_organization"."is_not_active_reason",- "posthog_organization"."session_cookie_age",- "posthog_organization"."is_member_join_email_enabled",- "posthog_organization"."is_ai_data_processing_approved",- "posthog_organization"."is_ai_training_opted_in",- "posthog_organization"."is_ai_training_locked",- "posthog_organization"."is_ai_training_cta_shown",- "posthog_organization"."enforce_2fa",- "posthog_organization"."enforce_verified_domains",- "posthog_organization"."members_can_invite",- "posthog_organization"."members_can_create_projects",- "posthog_organization"."members_can_use_personal_api_keys",- "posthog_organization"."members_can_see_org_members",- "posthog_organization"."allow_publicly_shared_resources",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "posthog_organization"."is_pending_deletion",- "posthog_organization"."customer_id",- "posthog_organization"."available_product_features",- "posthog_organization"."usage",- "posthog_organization"."never_drop_data",- "posthog_organization"."customer_trust_scores",- "posthog_organization"."setup_section_2_completed",- "posthog_organization"."personalization",- "posthog_organization"."domain_whitelist",- "posthog_organization"."is_platform"- FROM "posthog_organizationmembership"- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999)- LIMIT 21- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.151- '''- 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",- "posthog_team"."organization_id" AS "_team_organization_id"- FROM "ee_accesscontrol"- INNER JOIN "posthog_team" ON ("ee_accesscontrol"."team_id" = "posthog_team"."id")- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")- WHERE (("ee_accesscontrol"."organization_member_id" IS NULL- AND "ee_accesscontrol"."role_id" IS NULL- AND "ee_accesscontrol"."team_id" = 99999)- OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999- AND "ee_accesscontrol"."role_id" IS NULL- AND "ee_accesscontrol"."team_id" = 99999))- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.152- '''- SELECT "posthog_organizationmembership"."id",- "posthog_organizationmembership"."organization_id",- "posthog_organizationmembership"."user_id",- "posthog_organizationmembership"."level",- "posthog_organizationmembership"."joined_at",- "posthog_organizationmembership"."updated_at",- "posthog_organizationmembership"."invited_by_id",- "posthog_organization"."id",- "posthog_organization"."name",- "posthog_organization"."slug",- "posthog_organization"."logo_media_id",- "posthog_organization"."created_at",- "posthog_organization"."updated_at",- "posthog_organization"."is_active",- "posthog_organization"."is_not_active_reason",- "posthog_organization"."session_cookie_age",- "posthog_organization"."is_member_join_email_enabled",- "posthog_organization"."is_ai_data_processing_approved",- "posthog_organization"."is_ai_training_opted_in",- "posthog_organization"."is_ai_training_locked",- "posthog_organization"."is_ai_training_cta_shown",- "posthog_organization"."enforce_2fa",- "posthog_organization"."enforce_verified_domains",- "posthog_organization"."members_can_invite",- "posthog_organization"."members_can_create_projects",- "posthog_organization"."members_can_use_personal_api_keys",- "posthog_organization"."members_can_see_org_members",- "posthog_organization"."allow_publicly_shared_resources",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "posthog_organization"."is_pending_deletion",- "posthog_organization"."customer_id",- "posthog_organization"."available_product_features",- "posthog_organization"."usage",- "posthog_organization"."never_drop_data",- "posthog_organization"."customer_trust_scores",- "posthog_organization"."setup_section_2_completed",- "posthog_organization"."personalization",- "posthog_organization"."domain_whitelist",- "posthog_organization"."is_platform"- FROM "posthog_organizationmembership"- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE "posthog_organizationmembership"."user_id" = 99999+ SELECT "posthog_externaldatasource"."created_by_id",+ "posthog_externaldatasource"."created_at",+ "posthog_externaldatasource"."updated_at",+ "posthog_externaldatasource"."deleted",+ "posthog_externaldatasource"."deleted_at",+ "posthog_externaldatasource"."id",+ "posthog_externaldatasource"."source_id",+ "posthog_externaldatasource"."connection_id",+ "posthog_externaldatasource"."destination_id",+ "posthog_externaldatasource"."team_id",+ "posthog_externaldatasource"."sync_frequency",+ "posthog_externaldatasource"."status",+ "posthog_externaldatasource"."source_type",+ "posthog_externaldatasource"."api_version",+ "posthog_externaldatasource"."job_inputs",+ "posthog_externaldatasource"."connection_metadata",+ "posthog_externaldatasource"."are_tables_created",+ "posthog_externaldatasource"."prefix",+ "posthog_externaldatasource"."description",+ "posthog_externaldatasource"."created_via",+ "posthog_externaldatasource"."access_method",+ "posthog_externaldatasource"."direct_query_enabled",+ "posthog_externaldatasource"."auto_sync_new_schemas",+ "posthog_externaldatasource"."auto_sync_schema_patterns",+ "posthog_externaldatasource"."revenue_analytics_enabled",+ "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",+ "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",+ "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"+ FROM "posthog_externaldatasource"+ LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")+ WHERE ("posthog_externaldatasource"."source_type" IN ('Stripe')+ AND "posthog_externaldatasource"."team_id" = 99999+ AND NOT ("posthog_externaldatasource"."deleted"+ AND "posthog_externaldatasource"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.153+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.151'''- SELECT "posthog_datawarehousesavedquery"."created_by_id",- "posthog_datawarehousesavedquery"."created_at",- "posthog_datawarehousesavedquery"."updated_at",- "posthog_datawarehousesavedquery"."deleted",- "posthog_datawarehousesavedquery"."deleted_at",- "posthog_datawarehousesavedquery"."id",- "posthog_datawarehousesavedquery"."name",- "posthog_datawarehousesavedquery"."team_id",- "posthog_datawarehousesavedquery"."latest_error",- "posthog_datawarehousesavedquery"."columns",- "posthog_datawarehousesavedquery"."column_order",- "posthog_datawarehousesavedquery"."external_tables",- "posthog_datawarehousesavedquery"."query",- "posthog_datawarehousesavedquery"."status",- "posthog_datawarehousesavedquery"."last_run_at",- "posthog_datawarehousesavedquery"."sync_frequency_interval",- "posthog_datawarehousesavedquery"."table_id",- "posthog_datawarehousesavedquery"."is_materialized",- "posthog_datawarehousesavedquery"."deleted_name",- "posthog_datawarehousesavedquery"."managed_viewset_id",- "posthog_datawarehousesavedquery"."folder_id",- "posthog_datawarehousesavedquery"."origin",- "posthog_datawarehousesavedquery"."is_test",- "posthog_datawarehousesavedquery"."expires_at",- "posthog_datawarehousesavedquery"."semantic_enrichment_hash",- "posthog_user"."id",- "posthog_user"."password",- "posthog_user"."last_login",- "posthog_user"."first_name",- "posthog_user"."last_name",- "posthog_user"."is_staff",- "posthog_user"."date_joined",- "posthog_user"."uuid",- "posthog_user"."current_organization_id",- "posthog_user"."current_team_id",- "posthog_user"."email",- "posthog_user"."pending_email",- "posthog_user"."distinct_id",- "posthog_user"."is_email_verified",- "posthog_user"."credentials_reviewed_at",- "posthog_user"."requested_password_reset_at",- "posthog_user"."requested_2fa_reset_at",- "posthog_user"."has_seen_product_intro_for",- "posthog_user"."strapi_id",- "posthog_user"."is_active",- "posthog_user"."role_at_organization",- "posthog_user"."theme_mode",- "posthog_user"."partial_notification_settings",- "posthog_user"."anonymize_data",- "posthog_user"."allow_impersonation",- "posthog_user"."toolbar_mode",- "posthog_user"."hedgehog_config",- "posthog_user"."allow_sidebar_suggestions",- "posthog_user"."shortcut_position",- "posthog_user"."passkeys_enabled_for_2fa",- "posthog_user"."hide_mcp_hints",- "posthog_user"."ui_configuration",- "posthog_user"."onboarding_skipped_at",- "posthog_user"."onboarding_skipped_reason",- "posthog_user"."onboarding_skipped_organization_id",- "posthog_user"."onboarding_delegated_to_invite_id",- "posthog_user"."onboarding_delegated_to_organization_id",- "posthog_user"."onboarding_delegation_accepted_at",- "posthog_user"."events_column_config",- "posthog_user"."email_opt_in",- "posthog_datawarehousetable"."created_by_id",+ SELECT "posthog_datawarehousetable"."created_by_id","posthog_datawarehousetable"."created_at","posthog_datawarehousetable"."updated_at","posthog_datawarehousetable"."deleted",@@ -8605,50 +8926,6 @@"posthog_datawarehousetable"."options","posthog_datawarehousetable"."row_count","posthog_datawarehousetable"."size_in_s3_mib",- "posthog_datawarehousemanagedviewset"."created_by_id",- "posthog_datawarehousemanagedviewset"."created_at",- "posthog_datawarehousemanagedviewset"."updated_at",- "posthog_datawarehousemanagedviewset"."id",- "posthog_datawarehousemanagedviewset"."team_id",- "posthog_datawarehousemanagedviewset"."kind"- FROM "posthog_datawarehousesavedquery"- LEFT OUTER JOIN "posthog_datawarehousemanagedviewset" ON ("posthog_datawarehousesavedquery"."managed_viewset_id" = "posthog_datawarehousemanagedviewset"."id")- LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousesavedquery"."created_by_id" = "posthog_user"."id")- LEFT OUTER JOIN "posthog_datawarehousetable" ON ("posthog_datawarehousesavedquery"."table_id" = "posthog_datawarehousetable"."id")- WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999- AND NOT ("posthog_datawarehousesavedquery"."deleted"- AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)- AND "posthog_datawarehousesavedquery"."managed_viewset_id" IS NULL)- ORDER BY "posthog_datawarehousesavedquery"."name" ASC- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.154- '''- SELECT "posthog_datawarehousesavedquery"."created_by_id",- "posthog_datawarehousesavedquery"."created_at",- "posthog_datawarehousesavedquery"."updated_at",- "posthog_datawarehousesavedquery"."deleted",- "posthog_datawarehousesavedquery"."deleted_at",- "posthog_datawarehousesavedquery"."id",- "posthog_datawarehousesavedquery"."name",- "posthog_datawarehousesavedquery"."team_id",- "posthog_datawarehousesavedquery"."latest_error",- "posthog_datawarehousesavedquery"."columns",- "posthog_datawarehousesavedquery"."column_order",- "posthog_datawarehousesavedquery"."external_tables",- "posthog_datawarehousesavedquery"."query",- "posthog_datawarehousesavedquery"."status",- "posthog_datawarehousesavedquery"."last_run_at",- "posthog_datawarehousesavedquery"."sync_frequency_interval",- "posthog_datawarehousesavedquery"."table_id",- "posthog_datawarehousesavedquery"."is_materialized",- "posthog_datawarehousesavedquery"."deleted_name",- "posthog_datawarehousesavedquery"."managed_viewset_id",- "posthog_datawarehousesavedquery"."folder_id",- "posthog_datawarehousesavedquery"."origin",- "posthog_datawarehousesavedquery"."is_test",- "posthog_datawarehousesavedquery"."expires_at",- "posthog_datawarehousesavedquery"."semantic_enrichment_hash","posthog_user"."id","posthog_user"."password","posthog_user"."last_login",@@ -8688,93 +8965,135 @@"posthog_user"."onboarding_delegated_to_organization_id","posthog_user"."onboarding_delegation_accepted_at","posthog_user"."events_column_config",- "posthog_user"."email_opt_in",- "posthog_datawarehousetable"."created_by_id",- "posthog_datawarehousetable"."created_at",- "posthog_datawarehousetable"."updated_at",- "posthog_datawarehousetable"."deleted",- "posthog_datawarehousetable"."deleted_at",- "posthog_datawarehousetable"."id",- "posthog_datawarehousetable"."name",- "posthog_datawarehousetable"."format",- "posthog_datawarehousetable"."team_id",- "posthog_datawarehousetable"."url_pattern",- "posthog_datawarehousetable"."queryable_folder",- "posthog_datawarehousetable"."credential_id",- "posthog_datawarehousetable"."external_data_source_id",- "posthog_datawarehousetable"."columns",- "posthog_datawarehousetable"."column_order",- "posthog_datawarehousetable"."options",- "posthog_datawarehousetable"."row_count",- "posthog_datawarehousetable"."size_in_s3_mib"- FROM "posthog_datawarehousesavedquery"- LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousesavedquery"."created_by_id" = "posthog_user"."id")- LEFT OUTER JOIN "posthog_datawarehousetable" ON ("posthog_datawarehousesavedquery"."table_id" = "posthog_datawarehousetable"."id")- WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999- AND "posthog_datawarehousesavedquery"."origin" = 'endpoint'- AND NOT ("posthog_datawarehousesavedquery"."deleted"- AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))+ "posthog_user"."email_opt_in"+ FROM "posthog_datawarehousetable"+ LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")+ LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousetable"."created_by_id" = "posthog_user"."id")+ WHERE ("posthog_datawarehousetable"."team_id" = 99999+ AND NOT ("posthog_datawarehousetable"."deleted"+ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)+ AND NOT ("posthog_externaldatasource"."deleted"+ AND "posthog_externaldatasource"."deleted" IS NOT NULL)+ AND NOT ("posthog_externaldatasource"."access_method" = 'direct'+ AND "posthog_externaldatasource"."access_method" IS NOT NULL))+ ORDER BY "posthog_datawarehousetable"."created_at" DESC'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.155+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.152'''- SELECT "posthog_externaldatasource"."created_by_id",- "posthog_externaldatasource"."created_at",- "posthog_externaldatasource"."updated_at",- "posthog_externaldatasource"."deleted",- "posthog_externaldatasource"."deleted_at",- "posthog_externaldatasource"."id",- "posthog_externaldatasource"."source_id",- "posthog_externaldatasource"."connection_id",- "posthog_externaldatasource"."destination_id",- "posthog_externaldatasource"."team_id",- "posthog_externaldatasource"."sync_frequency",- "posthog_externaldatasource"."status",- "posthog_externaldatasource"."source_type",- "posthog_externaldatasource"."api_version",- "posthog_externaldatasource"."job_inputs",- "posthog_externaldatasource"."connection_metadata",- "posthog_externaldatasource"."are_tables_created",- "posthog_externaldatasource"."prefix",- "posthog_externaldatasource"."description",- "posthog_externaldatasource"."created_via",- "posthog_externaldatasource"."access_method",- "posthog_externaldatasource"."direct_query_enabled",- "posthog_externaldatasource"."auto_sync_new_schemas",- "posthog_externaldatasource"."auto_sync_schema_patterns",- "posthog_externaldatasource"."revenue_analytics_enabled",- "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",- "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",- "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"- FROM "posthog_externaldatasource"- LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")- WHERE ("posthog_externaldatasource"."source_type" IN ('Stripe')- AND "posthog_externaldatasource"."team_id" = 99999- AND NOT ("posthog_externaldatasource"."deleted"- AND "posthog_externaldatasource"."deleted" IS NOT NULL))+ 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.153+ '''+ SELECT "data_tools_datawarehouseexpression"."deleted",+ "data_tools_datawarehouseexpression"."deleted_at",+ "data_tools_datawarehouseexpression"."id",+ "data_tools_datawarehouseexpression"."team_id",+ "data_tools_datawarehouseexpression"."created_at",+ "data_tools_datawarehouseexpression"."created_by_id",+ "data_tools_datawarehouseexpression"."table_name",+ "data_tools_datawarehouseexpression"."field_name",+ "data_tools_datawarehouseexpression"."expression",+ "data_tools_datawarehouseexpression"."connection_id"+ FROM "data_tools_datawarehouseexpression"+ WHERE ("data_tools_datawarehouseexpression"."team_id" = 99999+ AND NOT ("data_tools_datawarehouseexpression"."deleted"+ AND "data_tools_datawarehouseexpression"."deleted" IS NOT NULL)+ AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.154+ '''+ 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"."full_recording_v2_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",+ "posthog_sessionrecording"."retention_period_days"+ 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.155+ '''+ SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"+ FROM "posthog_sessionrecordingviewed"+ WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999+ AND "posthog_sessionrecordingviewed"."user_id" = 99999+ AND "posthog_sessionrecordingviewed"."session_id" IN ('9',+ '8',+ '7',+ '6',+ '5',+ '4',+ '3',+ '2',+ '1'))'''# ---# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.156'''- SELECT "posthog_datawarehousetable"."created_by_id",- "posthog_datawarehousetable"."created_at",- "posthog_datawarehousetable"."updated_at",- "posthog_datawarehousetable"."deleted",- "posthog_datawarehousetable"."deleted_at",- "posthog_datawarehousetable"."id",- "posthog_datawarehousetable"."name",- "posthog_datawarehousetable"."format",- "posthog_datawarehousetable"."team_id",- "posthog_datawarehousetable"."url_pattern",- "posthog_datawarehousetable"."queryable_folder",- "posthog_datawarehousetable"."credential_id",- "posthog_datawarehousetable"."external_data_source_id",- "posthog_datawarehousetable"."columns",- "posthog_datawarehousetable"."column_order",- "posthog_datawarehousetable"."options",- "posthog_datawarehousetable"."row_count",- "posthog_datawarehousetable"."size_in_s3_mib",- "posthog_user"."id",+ SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id",+ "posthog_user"."email" AS "user__email"+ FROM "posthog_sessionrecordingviewed"+ INNER JOIN "posthog_user" ON ("posthog_sessionrecordingviewed"."user_id" = "posthog_user"."id")+ WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('9',+ '8',+ '7',+ '6',+ '5',+ '4',+ '3',+ '2',+ '1')+ AND "posthog_sessionrecordingviewed"."team_id" = 99999+ AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.157+ '''+ SELECT "posthog_user"."id","posthog_user"."password","posthog_user"."last_login","posthog_user"."first_name",@@ -8789,7 +9108,6 @@"posthog_user"."distinct_id","posthog_user"."is_email_verified","posthog_user"."credentials_reviewed_at",- "posthog_user"."requested_password_reset_at","posthog_user"."requested_2fa_reset_at","posthog_user"."has_seen_product_intro_for","posthog_user"."strapi_id",@@ -8814,97 +9132,302 @@"posthog_user"."onboarding_delegation_accepted_at","posthog_user"."events_column_config","posthog_user"."email_opt_in"- FROM "posthog_datawarehousetable"- LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")- LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousetable"."created_by_id" = "posthog_user"."id")- WHERE ("posthog_datawarehousetable"."team_id" = 99999- AND NOT ("posthog_datawarehousetable"."deleted"- AND "posthog_datawarehousetable"."deleted" IS NOT NULL)- AND NOT ("posthog_externaldatasource"."deleted"- AND "posthog_externaldatasource"."deleted" IS NOT NULL)- AND NOT ("posthog_externaldatasource"."access_method" = 'direct'- AND "posthog_externaldatasource"."access_method" IS NOT NULL))- ORDER BY "posthog_datawarehousetable"."created_at" DESC+ FROM "posthog_user"+ WHERE ("posthog_user"."is_active"+ AND "posthog_user"."id" = 99999)'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.157+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.158'''- SELECT "posthog_datawarehousejoin"."created_by_id",- "posthog_datawarehousejoin"."created_at",- "posthog_datawarehousejoin"."deleted",- "posthog_datawarehousejoin"."deleted_at",- "posthog_datawarehousejoin"."id",- "posthog_datawarehousejoin"."team_id",- "posthog_datawarehousejoin"."source_table_name",- "posthog_datawarehousejoin"."source_table_key",- "posthog_datawarehousejoin"."joining_table_name",- "posthog_datawarehousejoin"."joining_table_key",- "posthog_datawarehousejoin"."field_name",- "posthog_datawarehousejoin"."configuration"- FROM "posthog_datawarehousejoin"- WHERE ("posthog_datawarehousejoin"."team_id" = 99999- AND NOT ("posthog_datawarehousejoin"."deleted"- AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))+ SELECT "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organization"+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid+ LIMIT 21+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.159+ '''+ SELECT "posthog_team"."id",+ "posthog_team"."uuid",+ "posthog_team"."organization_id",+ "posthog_team"."parent_team_id",+ "posthog_team"."project_id",+ "posthog_team"."api_token",+ "posthog_team"."app_urls",+ "posthog_team"."name",+ "posthog_team"."slack_incoming_webhook",+ "posthog_team"."created_at",+ "posthog_team"."updated_at",+ "posthog_team"."anonymize_ips",+ "posthog_team"."completed_snippet_onboarding",+ "posthog_team"."has_completed_onboarding_for",+ "posthog_team"."onboarding_tasks",+ "posthog_team"."ingested_event",+ "posthog_team"."ingested_production_event",+ "posthog_team"."ingested_production_event_last_checked_at",+ "posthog_team"."person_processing_opt_out",+ "posthog_team"."secret_api_token",+ "posthog_team"."secret_api_token_backup",+ "posthog_team"."session_recording_opt_in",+ "posthog_team"."session_recording_sample_rate",+ "posthog_team"."session_recording_minimum_duration_milliseconds",+ "posthog_team"."session_recording_linked_flag",+ "posthog_team"."session_recording_network_payload_capture_config",+ "posthog_team"."session_recording_masking_config",+ "posthog_team"."session_recording_url_trigger_config",+ "posthog_team"."session_recording_url_blocklist_config",+ "posthog_team"."session_recording_event_trigger_config",+ "posthog_team"."session_recording_trigger_match_type_config",+ "posthog_team"."session_recording_trigger_groups",+ "posthog_team"."session_replay_config",+ "posthog_team"."session_recording_retention_period",+ "posthog_team"."event_retention_months",+ "posthog_team"."conversations_enabled",+ "posthog_team"."conversations_settings",+ "posthog_team"."proactive_tasks_enabled",+ "posthog_team"."survey_config",+ "posthog_team"."surveys_opt_in",+ "posthog_team"."product_tours_opt_in",+ "posthog_team"."capture_console_log_opt_in",+ "posthog_team"."capture_performance_opt_in",+ "posthog_team"."capture_dead_clicks",+ "posthog_team"."autocapture_opt_out",+ "posthog_team"."autocapture_web_vitals_opt_in",+ "posthog_team"."autocapture_web_vitals_allowed_metrics",+ "posthog_team"."autocapture_exceptions_opt_in",+ "posthog_team"."autocapture_exceptions_errors_to_ignore",+ "posthog_team"."logs_settings",+ "posthog_team"."llm_gateway_enabled_at",+ "posthog_team"."llm_gateway_revoked_at",+ "posthog_team"."llm_gateway_overspend_allowance_usd",+ "posthog_team"."heatmaps_opt_in",+ "posthog_team"."receive_org_level_activity_logs",+ "posthog_team"."web_analytics_pre_aggregated_tables_enabled",+ "posthog_team"."web_analytics_pre_aggregated_tables_version",+ "posthog_team"."flags_persistence_default",+ "posthog_team"."feature_flag_confirmation_enabled",+ "posthog_team"."feature_flag_confirmation_message",+ "posthog_team"."default_evaluation_environments_enabled",+ "posthog_team"."require_evaluation_environment_tags",+ "posthog_team"."default_evaluation_contexts_enabled",+ "posthog_team"."require_evaluation_contexts",+ "posthog_team"."session_recording_version",+ "posthog_team"."signup_token",+ "posthog_team"."is_demo",+ "posthog_team"."access_control",+ "posthog_team"."week_start_day",+ "posthog_team"."inject_web_apps",+ "posthog_team"."test_account_filters",+ "posthog_team"."test_account_filters_default_checked",+ "posthog_team"."path_cleaning_filters",+ "posthog_team"."timezone",+ "posthog_team"."data_attributes",+ "posthog_team"."person_display_name_properties",+ "posthog_team"."live_events_columns",+ "posthog_team"."recording_domains",+ "posthog_team"."human_friendly_comparison_periods",+ "posthog_team"."cookieless_server_hash_mode",+ "posthog_team"."primary_dashboard_id",+ "posthog_team"."default_data_theme",+ "posthog_team"."extra_settings",+ "posthog_team"."modifiers",+ "posthog_team"."correlation_config",+ "posthog_team"."session_recording_retention_period_days",+ "posthog_team"."external_data_workspace_id",+ "posthog_team"."external_data_workspace_last_synced_at",+ "posthog_team"."api_query_rate_limit",+ "posthog_team"."drop_events_older_than",+ "posthog_team"."base_currency",+ "posthog_team"."experiment_recalculation_time",+ "posthog_team"."default_experiment_confidence_level",+ "posthog_team"."default_experiment_stats_method",+ "posthog_team"."business_model",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_team"+ INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")+ WHERE "posthog_team"."id" = 99999+ LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.158+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.16'''- SELECT "data_tools_datawarehouseexpression"."deleted",- "data_tools_datawarehouseexpression"."deleted_at",- "data_tools_datawarehouseexpression"."id",- "data_tools_datawarehouseexpression"."team_id",- "data_tools_datawarehouseexpression"."created_at",- "data_tools_datawarehouseexpression"."created_by_id",- "data_tools_datawarehouseexpression"."table_name",- "data_tools_datawarehouseexpression"."field_name",- "data_tools_datawarehouseexpression"."expression",- "data_tools_datawarehouseexpression"."connection_id"- FROM "data_tools_datawarehouseexpression"- WHERE ("data_tools_datawarehouseexpression"."team_id" = 99999- AND NOT ("data_tools_datawarehouseexpression"."deleted"- AND "data_tools_datawarehouseexpression"."deleted" IS NOT NULL)- AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.159+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.160'''- 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"."full_recording_v2_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",- "posthog_sessionrecording"."retention_period_days"- 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)+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.16+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.161'''SELECT "ee_accesscontrol"."id","ee_accesscontrol"."team_id",@@ -8929,45 +9452,58 @@AND "ee_accesscontrol"."team_id" = 99999))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.160- '''- SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"- FROM "posthog_sessionrecordingviewed"- WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999- AND "posthog_sessionrecordingviewed"."user_id" = 99999- AND "posthog_sessionrecordingviewed"."session_id" IN ('9',- '8',- '7',- '6',- '5',- '4',- '3',- '2',- '10',- '1'))- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.161+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.162'''- SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id",- "posthog_user"."email" AS "user__email"- FROM "posthog_sessionrecordingviewed"- INNER JOIN "posthog_user" ON ("posthog_sessionrecordingviewed"."user_id" = "posthog_user"."id")- WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('9',- '8',- '7',- '6',- '5',- '4',- '3',- '2',- '10',- '1')- AND "posthog_sessionrecordingviewed"."team_id" = 99999- AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE "posthog_organizationmembership"."user_id" = 99999'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.17+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.163'''SELECT "posthog_organizationmembership"."id","posthog_organizationmembership"."organization_id",@@ -9015,10 +9551,12 @@"posthog_organization"."is_platform"FROM "posthog_organizationmembership"INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE "posthog_organizationmembership"."user_id" = 99999+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.18+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.164'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -9120,7 +9658,7 @@ORDER BY "posthog_datawarehousesavedquery"."name" ASC'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.19+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.165'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -9214,147 +9752,7 @@AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.2- '''- SELECT "posthog_team"."id",- "posthog_team"."uuid",- "posthog_team"."organization_id",- "posthog_team"."parent_team_id",- "posthog_team"."project_id",- "posthog_team"."api_token",- "posthog_team"."app_urls",- "posthog_team"."name",- "posthog_team"."slack_incoming_webhook",- "posthog_team"."created_at",- "posthog_team"."updated_at",- "posthog_team"."anonymize_ips",- "posthog_team"."completed_snippet_onboarding",- "posthog_team"."has_completed_onboarding_for",- "posthog_team"."onboarding_tasks",- "posthog_team"."ingested_event",- "posthog_team"."ingested_production_event",- "posthog_team"."ingested_production_event_last_checked_at",- "posthog_team"."person_processing_opt_out",- "posthog_team"."secret_api_token",- "posthog_team"."secret_api_token_backup",- "posthog_team"."session_recording_opt_in",- "posthog_team"."session_recording_sample_rate",- "posthog_team"."session_recording_minimum_duration_milliseconds",- "posthog_team"."session_recording_linked_flag",- "posthog_team"."session_recording_network_payload_capture_config",- "posthog_team"."session_recording_masking_config",- "posthog_team"."session_recording_url_trigger_config",- "posthog_team"."session_recording_url_blocklist_config",- "posthog_team"."session_recording_event_trigger_config",- "posthog_team"."session_recording_trigger_match_type_config",- "posthog_team"."session_recording_trigger_groups",- "posthog_team"."session_replay_config",- "posthog_team"."session_recording_retention_period",- "posthog_team"."event_retention_months",- "posthog_team"."conversations_enabled",- "posthog_team"."conversations_settings",- "posthog_team"."proactive_tasks_enabled",- "posthog_team"."survey_config",- "posthog_team"."surveys_opt_in",- "posthog_team"."product_tours_opt_in",- "posthog_team"."capture_console_log_opt_in",- "posthog_team"."capture_performance_opt_in",- "posthog_team"."capture_dead_clicks",- "posthog_team"."autocapture_opt_out",- "posthog_team"."autocapture_web_vitals_opt_in",- "posthog_team"."autocapture_web_vitals_allowed_metrics",- "posthog_team"."autocapture_exceptions_opt_in",- "posthog_team"."autocapture_exceptions_errors_to_ignore",- "posthog_team"."logs_settings",- "posthog_team"."llm_gateway_enabled_at",- "posthog_team"."llm_gateway_revoked_at",- "posthog_team"."llm_gateway_overspend_allowance_usd",- "posthog_team"."heatmaps_opt_in",- "posthog_team"."receive_org_level_activity_logs",- "posthog_team"."web_analytics_pre_aggregated_tables_enabled",- "posthog_team"."web_analytics_pre_aggregated_tables_version",- "posthog_team"."flags_persistence_default",- "posthog_team"."feature_flag_confirmation_enabled",- "posthog_team"."feature_flag_confirmation_message",- "posthog_team"."default_evaluation_environments_enabled",- "posthog_team"."require_evaluation_environment_tags",- "posthog_team"."default_evaluation_contexts_enabled",- "posthog_team"."require_evaluation_contexts",- "posthog_team"."session_recording_version",- "posthog_team"."signup_token",- "posthog_team"."is_demo",- "posthog_team"."access_control",- "posthog_team"."week_start_day",- "posthog_team"."inject_web_apps",- "posthog_team"."test_account_filters",- "posthog_team"."test_account_filters_default_checked",- "posthog_team"."path_cleaning_filters",- "posthog_team"."timezone",- "posthog_team"."data_attributes",- "posthog_team"."person_display_name_properties",- "posthog_team"."live_events_columns",- "posthog_team"."recording_domains",- "posthog_team"."human_friendly_comparison_periods",- "posthog_team"."cookieless_server_hash_mode",- "posthog_team"."primary_dashboard_id",- "posthog_team"."default_data_theme",- "posthog_team"."extra_settings",- "posthog_team"."modifiers",- "posthog_team"."correlation_config",- "posthog_team"."session_recording_retention_period_days",- "posthog_team"."external_data_workspace_id",- "posthog_team"."external_data_workspace_last_synced_at",- "posthog_team"."api_query_rate_limit",- "posthog_team"."drop_events_older_than",- "posthog_team"."base_currency",- "posthog_team"."experiment_recalculation_time",- "posthog_team"."default_experiment_confidence_level",- "posthog_team"."default_experiment_stats_method",- "posthog_team"."business_model",- "posthog_organization"."id",- "posthog_organization"."name",- "posthog_organization"."slug",- "posthog_organization"."logo_media_id",- "posthog_organization"."created_at",- "posthog_organization"."updated_at",- "posthog_organization"."is_active",- "posthog_organization"."is_not_active_reason",- "posthog_organization"."session_cookie_age",- "posthog_organization"."is_member_join_email_enabled",- "posthog_organization"."is_ai_data_processing_approved",- "posthog_organization"."is_ai_training_opted_in",- "posthog_organization"."is_ai_training_locked",- "posthog_organization"."is_ai_training_cta_shown",- "posthog_organization"."enforce_2fa",- "posthog_organization"."enforce_verified_domains",- "posthog_organization"."members_can_invite",- "posthog_organization"."members_can_create_projects",- "posthog_organization"."members_can_use_personal_api_keys",- "posthog_organization"."members_can_see_org_members",- "posthog_organization"."allow_publicly_shared_resources",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "posthog_organization"."is_pending_deletion",- "posthog_organization"."customer_id",- "posthog_organization"."available_product_features",- "posthog_organization"."usage",- "posthog_organization"."never_drop_data",- "posthog_organization"."customer_trust_scores",- "posthog_organization"."setup_section_2_completed",- "posthog_organization"."personalization",- "posthog_organization"."domain_whitelist",- "posthog_organization"."is_platform"- FROM "posthog_team"- INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")- WHERE "posthog_team"."id" = 99999- LIMIT 21- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.20+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.166'''SELECT "posthog_externaldatasource"."created_by_id","posthog_externaldatasource"."created_at",@@ -9392,7 +9790,7 @@AND "posthog_externaldatasource"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.21+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.167'''SELECT "posthog_datawarehousetable"."created_by_id","posthog_datawarehousetable"."created_at",@@ -9465,7 +9863,7 @@ORDER BY "posthog_datawarehousetable"."created_at" DESC'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.22+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.168'''SELECT "posthog_datawarehousejoin"."created_by_id","posthog_datawarehousejoin"."created_at",@@ -9485,7 +9883,7 @@AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.23+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.169'''SELECT "data_tools_datawarehouseexpression"."deleted","data_tools_datawarehouseexpression"."deleted_at",@@ -9504,7 +9902,32 @@AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.24+# 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",+ "posthog_team"."organization_id" AS "_team_organization_id"+ FROM "ee_accesscontrol"+ INNER JOIN "posthog_team" ON ("ee_accesscontrol"."team_id" = "posthog_team"."id")+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")+ WHERE (("ee_accesscontrol"."organization_member_id" IS NULL+ AND "ee_accesscontrol"."role_id" IS NULL+ AND "ee_accesscontrol"."team_id" = 99999)+ OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999+ AND "ee_accesscontrol"."role_id" IS NULL+ AND "ee_accesscontrol"."team_id" = 99999))+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.170'''SELECT "posthog_sessionrecording"."id","posthog_sessionrecording"."session_id",@@ -9529,79 +9952,67 @@"posthog_sessionrecording"."storage_version","posthog_sessionrecording"."retention_period_days"FROM "posthog_sessionrecording"- WHERE ("posthog_sessionrecording"."session_id" IN ('1')+ WHERE ("posthog_sessionrecording"."session_id" IN ('1',+ '10',+ '2',+ '3',+ '4',+ '5',+ '6',+ '7',+ '8',+ '9')AND "posthog_sessionrecording"."team_id" = 99999)'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.25+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.171'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"FROM "posthog_sessionrecordingviewed"WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999AND "posthog_sessionrecordingviewed"."user_id" = 99999- AND "posthog_sessionrecordingviewed"."session_id" IN ('1'))+ AND "posthog_sessionrecordingviewed"."session_id" IN ('9',+ '8',+ '7',+ '6',+ '5',+ '4',+ '3',+ '2',+ '10',+ '1'))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.26+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.172'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id","posthog_user"."email" AS "user__email"FROM "posthog_sessionrecordingviewed"INNER JOIN "posthog_user" ON ("posthog_sessionrecordingviewed"."user_id" = "posthog_user"."id")- WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('1')- AND "posthog_sessionrecordingviewed"."team_id" = 99999- AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.27- '''- SELECT "posthog_user"."id",- "posthog_user"."password",- "posthog_user"."last_login",- "posthog_user"."first_name",- "posthog_user"."last_name",- "posthog_user"."is_staff",- "posthog_user"."date_joined",- "posthog_user"."uuid",- "posthog_user"."current_organization_id",- "posthog_user"."current_team_id",- "posthog_user"."email",- "posthog_user"."pending_email",- "posthog_user"."distinct_id",- "posthog_user"."is_email_verified",- "posthog_user"."credentials_reviewed_at",- "posthog_user"."requested_2fa_reset_at",- "posthog_user"."has_seen_product_intro_for",- "posthog_user"."strapi_id",- "posthog_user"."is_active",- "posthog_user"."role_at_organization",- "posthog_user"."theme_mode",- "posthog_user"."partial_notification_settings",- "posthog_user"."anonymize_data",- "posthog_user"."allow_impersonation",- "posthog_user"."toolbar_mode",- "posthog_user"."hedgehog_config",- "posthog_user"."allow_sidebar_suggestions",- "posthog_user"."shortcut_position",- "posthog_user"."passkeys_enabled_for_2fa",- "posthog_user"."hide_mcp_hints",- "posthog_user"."ui_configuration",- "posthog_user"."onboarding_skipped_at",- "posthog_user"."onboarding_skipped_reason",- "posthog_user"."onboarding_skipped_organization_id",- "posthog_user"."onboarding_delegated_to_invite_id",- "posthog_user"."onboarding_delegated_to_organization_id",- "posthog_user"."onboarding_delegation_accepted_at",- "posthog_user"."events_column_config",- "posthog_user"."email_opt_in"- FROM "posthog_user"- WHERE ("posthog_user"."is_active"- AND "posthog_user"."id" = 99999)+ WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('9',+ '8',+ '7',+ '6',+ '5',+ '4',+ '3',+ '2',+ '10',+ '1')+ AND "posthog_sessionrecordingviewed"."team_id" = 99999+ AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.28+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.18'''- SELECT "posthog_organization"."id",+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id","posthog_organization"."name","posthog_organization"."slug","posthog_organization"."logo_media_id",@@ -9638,12 +10049,65 @@"posthog_organization"."personalization","posthog_organization"."domain_whitelist","posthog_organization"."is_platform"- FROM "posthog_organization"- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE "posthog_organizationmembership"."user_id" = 99999+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.19+ '''+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.29+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.2'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -9779,193 +10243,11 @@"posthog_organization"."is_platform"FROM "posthog_team"INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")- WHERE "posthog_team"."id" = 99999- LIMIT 21- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.3- '''- SELECT "posthog_organizationmembership"."id",- "posthog_organizationmembership"."organization_id",- "posthog_organizationmembership"."user_id",- "posthog_organizationmembership"."level",- "posthog_organizationmembership"."joined_at",- "posthog_organizationmembership"."updated_at",- "posthog_organizationmembership"."invited_by_id",- "posthog_organization"."id",- "posthog_organization"."name",- "posthog_organization"."slug",- "posthog_organization"."logo_media_id",- "posthog_organization"."created_at",- "posthog_organization"."updated_at",- "posthog_organization"."is_active",- "posthog_organization"."is_not_active_reason",- "posthog_organization"."session_cookie_age",- "posthog_organization"."is_member_join_email_enabled",- "posthog_organization"."is_ai_data_processing_approved",- "posthog_organization"."is_ai_training_opted_in",- "posthog_organization"."is_ai_training_locked",- "posthog_organization"."is_ai_training_cta_shown",- "posthog_organization"."enforce_2fa",- "posthog_organization"."enforce_verified_domains",- "posthog_organization"."members_can_invite",- "posthog_organization"."members_can_create_projects",- "posthog_organization"."members_can_use_personal_api_keys",- "posthog_organization"."members_can_see_org_members",- "posthog_organization"."allow_publicly_shared_resources",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "posthog_organization"."is_pending_deletion",- "posthog_organization"."customer_id",- "posthog_organization"."available_product_features",- "posthog_organization"."usage",- "posthog_organization"."never_drop_data",- "posthog_organization"."customer_trust_scores",- "posthog_organization"."setup_section_2_completed",- "posthog_organization"."personalization",- "posthog_organization"."domain_whitelist",- "posthog_organization"."is_platform"- FROM "posthog_organizationmembership"- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999)- LIMIT 21- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.30- '''- SELECT "posthog_organizationmembership"."id",- "posthog_organizationmembership"."organization_id",- "posthog_organizationmembership"."user_id",- "posthog_organizationmembership"."level",- "posthog_organizationmembership"."joined_at",- "posthog_organizationmembership"."updated_at",- "posthog_organizationmembership"."invited_by_id",- "posthog_organization"."id",- "posthog_organization"."name",- "posthog_organization"."slug",- "posthog_organization"."logo_media_id",- "posthog_organization"."created_at",- "posthog_organization"."updated_at",- "posthog_organization"."is_active",- "posthog_organization"."is_not_active_reason",- "posthog_organization"."session_cookie_age",- "posthog_organization"."is_member_join_email_enabled",- "posthog_organization"."is_ai_data_processing_approved",- "posthog_organization"."is_ai_training_opted_in",- "posthog_organization"."is_ai_training_locked",- "posthog_organization"."is_ai_training_cta_shown",- "posthog_organization"."enforce_2fa",- "posthog_organization"."enforce_verified_domains",- "posthog_organization"."members_can_invite",- "posthog_organization"."members_can_create_projects",- "posthog_organization"."members_can_use_personal_api_keys",- "posthog_organization"."members_can_see_org_members",- "posthog_organization"."allow_publicly_shared_resources",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "posthog_organization"."is_pending_deletion",- "posthog_organization"."customer_id",- "posthog_organization"."available_product_features",- "posthog_organization"."usage",- "posthog_organization"."never_drop_data",- "posthog_organization"."customer_trust_scores",- "posthog_organization"."setup_section_2_completed",- "posthog_organization"."personalization",- "posthog_organization"."domain_whitelist",- "posthog_organization"."is_platform"- FROM "posthog_organizationmembership"- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999)- LIMIT 21- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.31- '''- SELECT "ee_accesscontrol"."id",- "ee_accesscontrol"."team_id",- "ee_accesscontrol"."access_level",- "ee_accesscontrol"."resource",- "ee_accesscontrol"."resource_id",- "ee_accesscontrol"."organization_member_id",- "ee_accesscontrol"."role_id",- "ee_accesscontrol"."created_by_id",- "ee_accesscontrol"."created_at",- "ee_accesscontrol"."updated_at",- "posthog_team"."organization_id" AS "_team_organization_id"- FROM "ee_accesscontrol"- INNER JOIN "posthog_team" ON ("ee_accesscontrol"."team_id" = "posthog_team"."id")- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")- WHERE (("ee_accesscontrol"."organization_member_id" IS NULL- AND "ee_accesscontrol"."role_id" IS NULL- AND "ee_accesscontrol"."team_id" = 99999)- OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999- AND "ee_accesscontrol"."role_id" IS NULL- AND "ee_accesscontrol"."team_id" = 99999))- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.32- '''- SELECT "posthog_organizationmembership"."id",- "posthog_organizationmembership"."organization_id",- "posthog_organizationmembership"."user_id",- "posthog_organizationmembership"."level",- "posthog_organizationmembership"."joined_at",- "posthog_organizationmembership"."updated_at",- "posthog_organizationmembership"."invited_by_id",- "posthog_organization"."id",- "posthog_organization"."name",- "posthog_organization"."slug",- "posthog_organization"."logo_media_id",- "posthog_organization"."created_at",- "posthog_organization"."updated_at",- "posthog_organization"."is_active",- "posthog_organization"."is_not_active_reason",- "posthog_organization"."session_cookie_age",- "posthog_organization"."is_member_join_email_enabled",- "posthog_organization"."is_ai_data_processing_approved",- "posthog_organization"."is_ai_training_opted_in",- "posthog_organization"."is_ai_training_locked",- "posthog_organization"."is_ai_training_cta_shown",- "posthog_organization"."enforce_2fa",- "posthog_organization"."enforce_verified_domains",- "posthog_organization"."members_can_invite",- "posthog_organization"."members_can_create_projects",- "posthog_organization"."members_can_use_personal_api_keys",- "posthog_organization"."members_can_see_org_members",- "posthog_organization"."allow_publicly_shared_resources",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "posthog_organization"."is_pending_deletion",- "posthog_organization"."customer_id",- "posthog_organization"."available_product_features",- "posthog_organization"."usage",- "posthog_organization"."never_drop_data",- "posthog_organization"."customer_trust_scores",- "posthog_organization"."setup_section_2_completed",- "posthog_organization"."personalization",- "posthog_organization"."domain_whitelist",- "posthog_organization"."is_platform"- FROM "posthog_organizationmembership"- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE "posthog_organizationmembership"."user_id" = 99999+ WHERE "posthog_team"."id" = 99999+ LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.33+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.20'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -10067,7 +10349,7 @@ORDER BY "posthog_datawarehousesavedquery"."name" ASC'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.34+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.21'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -10161,7 +10443,7 @@AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.35+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.22'''SELECT "posthog_externaldatasource"."created_by_id","posthog_externaldatasource"."created_at",@@ -10199,7 +10481,7 @@AND "posthog_externaldatasource"."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.23'''SELECT "posthog_datawarehousetable"."created_by_id","posthog_datawarehousetable"."created_at",@@ -10272,7 +10554,7 @@ORDER BY "posthog_datawarehousetable"."created_at" DESC'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.37+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.24'''SELECT "posthog_datawarehousejoin"."created_by_id","posthog_datawarehousejoin"."created_at",@@ -10292,7 +10574,7 @@AND "posthog_datawarehousejoin"."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.25'''SELECT "data_tools_datawarehouseexpression"."deleted","data_tools_datawarehouseexpression"."deleted_at",@@ -10311,7 +10593,7 @@AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.39+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.26'''SELECT "posthog_sessionrecording"."id","posthog_sessionrecording"."session_id",@@ -10336,59 +10618,31 @@"posthog_sessionrecording"."storage_version","posthog_sessionrecording"."retention_period_days"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.4- '''- SELECT "ee_accesscontrol"."id",- "ee_accesscontrol"."team_id",- "ee_accesscontrol"."access_level",- "ee_accesscontrol"."resource",- "ee_accesscontrol"."resource_id",- "ee_accesscontrol"."organization_member_id",- "ee_accesscontrol"."role_id",- "ee_accesscontrol"."created_by_id",- "ee_accesscontrol"."created_at",- "ee_accesscontrol"."updated_at",- "posthog_team"."organization_id" AS "_team_organization_id"- FROM "ee_accesscontrol"- INNER JOIN "posthog_team" ON ("ee_accesscontrol"."team_id" = "posthog_team"."id")- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")- WHERE (("ee_accesscontrol"."organization_member_id" IS NULL- AND "ee_accesscontrol"."role_id" IS NULL- AND "ee_accesscontrol"."team_id" = 99999)- OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999- AND "ee_accesscontrol"."role_id" IS NULL- AND "ee_accesscontrol"."team_id" = 99999))- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.40+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.27'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"FROM "posthog_sessionrecordingviewed"WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999AND "posthog_sessionrecordingviewed"."user_id" = 99999- AND "posthog_sessionrecordingviewed"."session_id" IN ('2',- '1'))+ AND "posthog_sessionrecordingviewed"."session_id" IN ('1'))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.41+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.28'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id","posthog_user"."email" AS "user__email"FROM "posthog_sessionrecordingviewed"INNER JOIN "posthog_user" ON ("posthog_sessionrecordingviewed"."user_id" = "posthog_user"."id")- WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('2',- '1')+ WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('1')AND "posthog_sessionrecordingviewed"."team_id" = 99999AND NOT ("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.29'''SELECT "posthog_user"."id","posthog_user"."password",@@ -10434,7 +10688,60 @@AND "posthog_user"."id" = 99999)'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.43+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.3+ '''+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.30'''SELECT "posthog_organization"."id","posthog_organization"."name",@@ -10478,7 +10785,7 @@LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.44+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.31'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -10618,7 +10925,7 @@LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.45+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.32'''SELECT "posthog_organizationmembership"."id","posthog_organizationmembership"."organization_id",@@ -10671,7 +10978,7 @@LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.46+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.33'''SELECT "ee_accesscontrol"."id","ee_accesscontrol"."team_id",@@ -10696,7 +11003,7 @@AND "ee_accesscontrol"."team_id" = 99999))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.47+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.34'''SELECT "posthog_organizationmembership"."id","posthog_organizationmembership"."organization_id",@@ -10747,7 +11054,60 @@WHERE "posthog_organizationmembership"."user_id" = 99999'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.48+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.35+ '''+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.36'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -10849,7 +11209,7 @@ORDER BY "posthog_datawarehousesavedquery"."name" ASC'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.49+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.37'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -10912,89 +11272,38 @@"posthog_user"."onboarding_skipped_reason","posthog_user"."onboarding_skipped_organization_id","posthog_user"."onboarding_delegated_to_invite_id",- "posthog_user"."onboarding_delegated_to_organization_id",- "posthog_user"."onboarding_delegation_accepted_at",- "posthog_user"."events_column_config",- "posthog_user"."email_opt_in",- "posthog_datawarehousetable"."created_by_id",- "posthog_datawarehousetable"."created_at",- "posthog_datawarehousetable"."updated_at",- "posthog_datawarehousetable"."deleted",- "posthog_datawarehousetable"."deleted_at",- "posthog_datawarehousetable"."id",- "posthog_datawarehousetable"."name",- "posthog_datawarehousetable"."format",- "posthog_datawarehousetable"."team_id",- "posthog_datawarehousetable"."url_pattern",- "posthog_datawarehousetable"."queryable_folder",- "posthog_datawarehousetable"."credential_id",- "posthog_datawarehousetable"."external_data_source_id",- "posthog_datawarehousetable"."columns",- "posthog_datawarehousetable"."column_order",- "posthog_datawarehousetable"."options",- "posthog_datawarehousetable"."row_count",- "posthog_datawarehousetable"."size_in_s3_mib"- FROM "posthog_datawarehousesavedquery"- LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousesavedquery"."created_by_id" = "posthog_user"."id")- LEFT OUTER JOIN "posthog_datawarehousetable" ON ("posthog_datawarehousesavedquery"."table_id" = "posthog_datawarehousetable"."id")- WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999- AND "posthog_datawarehousesavedquery"."origin" = 'endpoint'- AND NOT ("posthog_datawarehousesavedquery"."deleted"- AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.5- '''- SELECT "posthog_organizationmembership"."id",- "posthog_organizationmembership"."organization_id",- "posthog_organizationmembership"."user_id",- "posthog_organizationmembership"."level",- "posthog_organizationmembership"."joined_at",- "posthog_organizationmembership"."updated_at",- "posthog_organizationmembership"."invited_by_id",- "posthog_organization"."id",- "posthog_organization"."name",- "posthog_organization"."slug",- "posthog_organization"."logo_media_id",- "posthog_organization"."created_at",- "posthog_organization"."updated_at",- "posthog_organization"."is_active",- "posthog_organization"."is_not_active_reason",- "posthog_organization"."session_cookie_age",- "posthog_organization"."is_member_join_email_enabled",- "posthog_organization"."is_ai_data_processing_approved",- "posthog_organization"."is_ai_training_opted_in",- "posthog_organization"."is_ai_training_locked",- "posthog_organization"."is_ai_training_cta_shown",- "posthog_organization"."enforce_2fa",- "posthog_organization"."enforce_verified_domains",- "posthog_organization"."members_can_invite",- "posthog_organization"."members_can_create_projects",- "posthog_organization"."members_can_use_personal_api_keys",- "posthog_organization"."members_can_see_org_members",- "posthog_organization"."allow_publicly_shared_resources",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "posthog_organization"."is_pending_deletion",- "posthog_organization"."customer_id",- "posthog_organization"."available_product_features",- "posthog_organization"."usage",- "posthog_organization"."never_drop_data",- "posthog_organization"."customer_trust_scores",- "posthog_organization"."setup_section_2_completed",- "posthog_organization"."personalization",- "posthog_organization"."domain_whitelist",- "posthog_organization"."is_platform"- FROM "posthog_organizationmembership"- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE "posthog_organizationmembership"."user_id" = 99999+ "posthog_user"."onboarding_delegated_to_organization_id",+ "posthog_user"."onboarding_delegation_accepted_at",+ "posthog_user"."events_column_config",+ "posthog_user"."email_opt_in",+ "posthog_datawarehousetable"."created_by_id",+ "posthog_datawarehousetable"."created_at",+ "posthog_datawarehousetable"."updated_at",+ "posthog_datawarehousetable"."deleted",+ "posthog_datawarehousetable"."deleted_at",+ "posthog_datawarehousetable"."id",+ "posthog_datawarehousetable"."name",+ "posthog_datawarehousetable"."format",+ "posthog_datawarehousetable"."team_id",+ "posthog_datawarehousetable"."url_pattern",+ "posthog_datawarehousetable"."queryable_folder",+ "posthog_datawarehousetable"."credential_id",+ "posthog_datawarehousetable"."external_data_source_id",+ "posthog_datawarehousetable"."columns",+ "posthog_datawarehousetable"."column_order",+ "posthog_datawarehousetable"."options",+ "posthog_datawarehousetable"."row_count",+ "posthog_datawarehousetable"."size_in_s3_mib"+ FROM "posthog_datawarehousesavedquery"+ LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousesavedquery"."created_by_id" = "posthog_user"."id")+ LEFT OUTER JOIN "posthog_datawarehousetable" ON ("posthog_datawarehousesavedquery"."table_id" = "posthog_datawarehousetable"."id")+ WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999+ AND "posthog_datawarehousesavedquery"."origin" = 'endpoint'+ AND NOT ("posthog_datawarehousesavedquery"."deleted"+ AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.50+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.38'''SELECT "posthog_externaldatasource"."created_by_id","posthog_externaldatasource"."created_at",@@ -11032,7 +11341,7 @@AND "posthog_externaldatasource"."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.39'''SELECT "posthog_datawarehousetable"."created_by_id","posthog_datawarehousetable"."created_at",@@ -11105,7 +11414,32 @@ORDER BY "posthog_datawarehousetable"."created_at" DESC'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.52+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.4+ '''+ SELECT "ee_accesscontrol"."id",+ "ee_accesscontrol"."team_id",+ "ee_accesscontrol"."access_level",+ "ee_accesscontrol"."resource",+ "ee_accesscontrol"."resource_id",+ "ee_accesscontrol"."organization_member_id",+ "ee_accesscontrol"."role_id",+ "ee_accesscontrol"."created_by_id",+ "ee_accesscontrol"."created_at",+ "ee_accesscontrol"."updated_at",+ "posthog_team"."organization_id" AS "_team_organization_id"+ FROM "ee_accesscontrol"+ INNER JOIN "posthog_team" ON ("ee_accesscontrol"."team_id" = "posthog_team"."id")+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")+ WHERE (("ee_accesscontrol"."organization_member_id" IS NULL+ AND "ee_accesscontrol"."role_id" IS NULL+ AND "ee_accesscontrol"."team_id" = 99999)+ OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999+ AND "ee_accesscontrol"."role_id" IS NULL+ AND "ee_accesscontrol"."team_id" = 99999))+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.40'''SELECT "posthog_datawarehousejoin"."created_by_id","posthog_datawarehousejoin"."created_at",@@ -11125,7 +11459,7 @@AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.53+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.41'''SELECT "data_tools_datawarehouseexpression"."deleted","data_tools_datawarehouseexpression"."deleted_at",@@ -11144,7 +11478,7 @@AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.54+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.42'''SELECT "posthog_sessionrecording"."id","posthog_sessionrecording"."session_id",@@ -11170,36 +11504,33 @@"posthog_sessionrecording"."retention_period_days"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.55+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.43'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"FROM "posthog_sessionrecordingviewed"WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999AND "posthog_sessionrecordingviewed"."user_id" = 99999- AND "posthog_sessionrecordingviewed"."session_id" IN ('3',- '2',+ AND "posthog_sessionrecordingviewed"."session_id" IN ('2','1'))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.56+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.44'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id","posthog_user"."email" AS "user__email"FROM "posthog_sessionrecordingviewed"INNER JOIN "posthog_user" ON ("posthog_sessionrecordingviewed"."user_id" = "posthog_user"."id")- WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('3',- '2',+ WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('2','1')AND "posthog_sessionrecordingviewed"."team_id" = 99999AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.57+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.45'''SELECT "posthog_user"."id","posthog_user"."password",@@ -11245,7 +11576,7 @@AND "posthog_user"."id" = 99999)'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.58+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.46'''SELECT "posthog_organization"."id","posthog_organization"."name",@@ -11289,7 +11620,7 @@LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.59+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.47'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -11429,109 +11760,85 @@LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.6+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.48'''- SELECT "posthog_datawarehousesavedquery"."created_by_id",- "posthog_datawarehousesavedquery"."created_at",- "posthog_datawarehousesavedquery"."updated_at",- "posthog_datawarehousesavedquery"."deleted",- "posthog_datawarehousesavedquery"."deleted_at",- "posthog_datawarehousesavedquery"."id",- "posthog_datawarehousesavedquery"."name",- "posthog_datawarehousesavedquery"."team_id",- "posthog_datawarehousesavedquery"."latest_error",- "posthog_datawarehousesavedquery"."columns",- "posthog_datawarehousesavedquery"."column_order",- "posthog_datawarehousesavedquery"."external_tables",- "posthog_datawarehousesavedquery"."query",- "posthog_datawarehousesavedquery"."status",- "posthog_datawarehousesavedquery"."last_run_at",- "posthog_datawarehousesavedquery"."sync_frequency_interval",- "posthog_datawarehousesavedquery"."table_id",- "posthog_datawarehousesavedquery"."is_materialized",- "posthog_datawarehousesavedquery"."deleted_name",- "posthog_datawarehousesavedquery"."managed_viewset_id",- "posthog_datawarehousesavedquery"."folder_id",- "posthog_datawarehousesavedquery"."origin",- "posthog_datawarehousesavedquery"."is_test",- "posthog_datawarehousesavedquery"."expires_at",- "posthog_datawarehousesavedquery"."semantic_enrichment_hash",- "posthog_user"."id",- "posthog_user"."password",- "posthog_user"."last_login",- "posthog_user"."first_name",- "posthog_user"."last_name",- "posthog_user"."is_staff",- "posthog_user"."date_joined",- "posthog_user"."uuid",- "posthog_user"."current_organization_id",- "posthog_user"."current_team_id",- "posthog_user"."email",- "posthog_user"."pending_email",- "posthog_user"."distinct_id",- "posthog_user"."is_email_verified",- "posthog_user"."credentials_reviewed_at",- "posthog_user"."requested_password_reset_at",- "posthog_user"."requested_2fa_reset_at",- "posthog_user"."has_seen_product_intro_for",- "posthog_user"."strapi_id",- "posthog_user"."is_active",- "posthog_user"."role_at_organization",- "posthog_user"."theme_mode",- "posthog_user"."partial_notification_settings",- "posthog_user"."anonymize_data",- "posthog_user"."allow_impersonation",- "posthog_user"."toolbar_mode",- "posthog_user"."hedgehog_config",- "posthog_user"."allow_sidebar_suggestions",- "posthog_user"."shortcut_position",- "posthog_user"."passkeys_enabled_for_2fa",- "posthog_user"."hide_mcp_hints",- "posthog_user"."ui_configuration",- "posthog_user"."onboarding_skipped_at",- "posthog_user"."onboarding_skipped_reason",- "posthog_user"."onboarding_skipped_organization_id",- "posthog_user"."onboarding_delegated_to_invite_id",- "posthog_user"."onboarding_delegated_to_organization_id",- "posthog_user"."onboarding_delegation_accepted_at",- "posthog_user"."events_column_config",- "posthog_user"."email_opt_in",- "posthog_datawarehousetable"."created_by_id",- "posthog_datawarehousetable"."created_at",- "posthog_datawarehousetable"."updated_at",- "posthog_datawarehousetable"."deleted",- "posthog_datawarehousetable"."deleted_at",- "posthog_datawarehousetable"."id",- "posthog_datawarehousetable"."name",- "posthog_datawarehousetable"."format",- "posthog_datawarehousetable"."team_id",- "posthog_datawarehousetable"."url_pattern",- "posthog_datawarehousetable"."queryable_folder",- "posthog_datawarehousetable"."credential_id",- "posthog_datawarehousetable"."external_data_source_id",- "posthog_datawarehousetable"."columns",- "posthog_datawarehousetable"."column_order",- "posthog_datawarehousetable"."options",- "posthog_datawarehousetable"."row_count",- "posthog_datawarehousetable"."size_in_s3_mib",- "posthog_datawarehousemanagedviewset"."created_by_id",- "posthog_datawarehousemanagedviewset"."created_at",- "posthog_datawarehousemanagedviewset"."updated_at",- "posthog_datawarehousemanagedviewset"."id",- "posthog_datawarehousemanagedviewset"."team_id",- "posthog_datawarehousemanagedviewset"."kind"- FROM "posthog_datawarehousesavedquery"- LEFT OUTER JOIN "posthog_datawarehousemanagedviewset" ON ("posthog_datawarehousesavedquery"."managed_viewset_id" = "posthog_datawarehousemanagedviewset"."id")- LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousesavedquery"."created_by_id" = "posthog_user"."id")- LEFT OUTER JOIN "posthog_datawarehousetable" ON ("posthog_datawarehousesavedquery"."table_id" = "posthog_datawarehousetable"."id")- WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999- AND NOT ("posthog_datawarehousesavedquery"."deleted"- AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)- AND "posthog_datawarehousesavedquery"."managed_viewset_id" IS NULL)- ORDER BY "posthog_datawarehousesavedquery"."name" ASC+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.49+ '''+ 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",+ "posthog_team"."organization_id" AS "_team_organization_id"+ FROM "ee_accesscontrol"+ INNER JOIN "posthog_team" ON ("ee_accesscontrol"."team_id" = "posthog_team"."id")+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")+ WHERE (("ee_accesscontrol"."organization_member_id" IS NULL+ AND "ee_accesscontrol"."role_id" IS NULL+ AND "ee_accesscontrol"."team_id" = 99999)+ OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999+ AND "ee_accesscontrol"."role_id" IS NULL+ AND "ee_accesscontrol"."team_id" = 99999))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.60+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.5'''SELECT "posthog_organizationmembership"."id","posthog_organizationmembership"."organization_id",@@ -11579,37 +11886,61 @@"posthog_organization"."is_platform"FROM "posthog_organizationmembership"INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999)- LIMIT 21+ WHERE "posthog_organizationmembership"."user_id" = 99999'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.61+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.50'''- 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",- "posthog_team"."organization_id" AS "_team_organization_id"- FROM "ee_accesscontrol"- INNER JOIN "posthog_team" ON ("ee_accesscontrol"."team_id" = "posthog_team"."id")- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")- WHERE (("ee_accesscontrol"."organization_member_id" IS NULL- AND "ee_accesscontrol"."role_id" IS NULL- AND "ee_accesscontrol"."team_id" = 99999)- OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999- AND "ee_accesscontrol"."role_id" IS NULL- AND "ee_accesscontrol"."team_id" = 99999))+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE "posthog_organizationmembership"."user_id" = 99999'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.62+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.51'''SELECT "posthog_organizationmembership"."id","posthog_organizationmembership"."organization_id",@@ -11657,10 +11988,12 @@"posthog_organization"."is_platform"FROM "posthog_organizationmembership"INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE "posthog_organizationmembership"."user_id" = 99999+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.63+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.52'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -11762,7 +12095,7 @@ORDER BY "posthog_datawarehousesavedquery"."name" ASC'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.64+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.53'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -11856,7 +12189,7 @@AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.65+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.54'''SELECT "posthog_externaldatasource"."created_by_id","posthog_externaldatasource"."created_at",@@ -11894,7 +12227,7 @@AND "posthog_externaldatasource"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.66+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.55'''SELECT "posthog_datawarehousetable"."created_by_id","posthog_datawarehousetable"."created_at",@@ -11967,198 +12300,154 @@ORDER BY "posthog_datawarehousetable"."created_at" DESC'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.67- '''- 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- '''- SELECT "data_tools_datawarehouseexpression"."deleted",- "data_tools_datawarehouseexpression"."deleted_at",- "data_tools_datawarehouseexpression"."id",- "data_tools_datawarehouseexpression"."team_id",- "data_tools_datawarehouseexpression"."created_at",- "data_tools_datawarehouseexpression"."created_by_id",- "data_tools_datawarehouseexpression"."table_name",- "data_tools_datawarehouseexpression"."field_name",- "data_tools_datawarehouseexpression"."expression",- "data_tools_datawarehouseexpression"."connection_id"- FROM "data_tools_datawarehouseexpression"- WHERE ("data_tools_datawarehouseexpression"."team_id" = 99999- AND NOT ("data_tools_datawarehouseexpression"."deleted"- AND "data_tools_datawarehouseexpression"."deleted" IS NOT NULL)- AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.69- '''- 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"."full_recording_v2_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",- "posthog_sessionrecording"."retention_period_days"- FROM "posthog_sessionrecording"- WHERE ("posthog_sessionrecording"."session_id" IN ('1',- '2',- '3',- '4')- AND "posthog_sessionrecording"."team_id" = 99999)- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.7- '''- SELECT "posthog_datawarehousesavedquery"."created_by_id",- "posthog_datawarehousesavedquery"."created_at",- "posthog_datawarehousesavedquery"."updated_at",- "posthog_datawarehousesavedquery"."deleted",- "posthog_datawarehousesavedquery"."deleted_at",- "posthog_datawarehousesavedquery"."id",- "posthog_datawarehousesavedquery"."name",- "posthog_datawarehousesavedquery"."team_id",- "posthog_datawarehousesavedquery"."latest_error",- "posthog_datawarehousesavedquery"."columns",- "posthog_datawarehousesavedquery"."column_order",- "posthog_datawarehousesavedquery"."external_tables",- "posthog_datawarehousesavedquery"."query",- "posthog_datawarehousesavedquery"."status",- "posthog_datawarehousesavedquery"."last_run_at",- "posthog_datawarehousesavedquery"."sync_frequency_interval",- "posthog_datawarehousesavedquery"."table_id",- "posthog_datawarehousesavedquery"."is_materialized",- "posthog_datawarehousesavedquery"."deleted_name",- "posthog_datawarehousesavedquery"."managed_viewset_id",- "posthog_datawarehousesavedquery"."folder_id",- "posthog_datawarehousesavedquery"."origin",- "posthog_datawarehousesavedquery"."is_test",- "posthog_datawarehousesavedquery"."expires_at",- "posthog_datawarehousesavedquery"."semantic_enrichment_hash",- "posthog_user"."id",- "posthog_user"."password",- "posthog_user"."last_login",- "posthog_user"."first_name",- "posthog_user"."last_name",- "posthog_user"."is_staff",- "posthog_user"."date_joined",- "posthog_user"."uuid",- "posthog_user"."current_organization_id",- "posthog_user"."current_team_id",- "posthog_user"."email",- "posthog_user"."pending_email",- "posthog_user"."distinct_id",- "posthog_user"."is_email_verified",- "posthog_user"."credentials_reviewed_at",- "posthog_user"."requested_password_reset_at",- "posthog_user"."requested_2fa_reset_at",- "posthog_user"."has_seen_product_intro_for",- "posthog_user"."strapi_id",- "posthog_user"."is_active",- "posthog_user"."role_at_organization",- "posthog_user"."theme_mode",- "posthog_user"."partial_notification_settings",- "posthog_user"."anonymize_data",- "posthog_user"."allow_impersonation",- "posthog_user"."toolbar_mode",- "posthog_user"."hedgehog_config",- "posthog_user"."allow_sidebar_suggestions",- "posthog_user"."shortcut_position",- "posthog_user"."passkeys_enabled_for_2fa",- "posthog_user"."hide_mcp_hints",- "posthog_user"."ui_configuration",- "posthog_user"."onboarding_skipped_at",- "posthog_user"."onboarding_skipped_reason",- "posthog_user"."onboarding_skipped_organization_id",- "posthog_user"."onboarding_delegated_to_invite_id",- "posthog_user"."onboarding_delegated_to_organization_id",- "posthog_user"."onboarding_delegation_accepted_at",- "posthog_user"."events_column_config",- "posthog_user"."email_opt_in",- "posthog_datawarehousetable"."created_by_id",- "posthog_datawarehousetable"."created_at",- "posthog_datawarehousetable"."updated_at",- "posthog_datawarehousetable"."deleted",- "posthog_datawarehousetable"."deleted_at",- "posthog_datawarehousetable"."id",- "posthog_datawarehousetable"."name",- "posthog_datawarehousetable"."format",- "posthog_datawarehousetable"."team_id",- "posthog_datawarehousetable"."url_pattern",- "posthog_datawarehousetable"."queryable_folder",- "posthog_datawarehousetable"."credential_id",- "posthog_datawarehousetable"."external_data_source_id",- "posthog_datawarehousetable"."columns",- "posthog_datawarehousetable"."column_order",- "posthog_datawarehousetable"."options",- "posthog_datawarehousetable"."row_count",- "posthog_datawarehousetable"."size_in_s3_mib"- FROM "posthog_datawarehousesavedquery"- LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousesavedquery"."created_by_id" = "posthog_user"."id")- LEFT OUTER JOIN "posthog_datawarehousetable" ON ("posthog_datawarehousesavedquery"."table_id" = "posthog_datawarehousetable"."id")- WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999- AND "posthog_datawarehousesavedquery"."origin" = 'endpoint'- AND NOT ("posthog_datawarehousesavedquery"."deleted"- AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.70+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.56+ '''+ 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.57+ '''+ SELECT "data_tools_datawarehouseexpression"."deleted",+ "data_tools_datawarehouseexpression"."deleted_at",+ "data_tools_datawarehouseexpression"."id",+ "data_tools_datawarehouseexpression"."team_id",+ "data_tools_datawarehouseexpression"."created_at",+ "data_tools_datawarehouseexpression"."created_by_id",+ "data_tools_datawarehouseexpression"."table_name",+ "data_tools_datawarehouseexpression"."field_name",+ "data_tools_datawarehouseexpression"."expression",+ "data_tools_datawarehouseexpression"."connection_id"+ FROM "data_tools_datawarehouseexpression"+ WHERE ("data_tools_datawarehouseexpression"."team_id" = 99999+ AND NOT ("data_tools_datawarehouseexpression"."deleted"+ AND "data_tools_datawarehouseexpression"."deleted" IS NOT NULL)+ AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.58+ '''+ 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"."full_recording_v2_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",+ "posthog_sessionrecording"."retention_period_days"+ FROM "posthog_sessionrecording"+ WHERE ("posthog_sessionrecording"."session_id" IN ('1',+ '2',+ '3')+ AND "posthog_sessionrecording"."team_id" = 99999)+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.59'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"FROM "posthog_sessionrecordingviewed"WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999AND "posthog_sessionrecordingviewed"."user_id" = 99999- AND "posthog_sessionrecordingviewed"."session_id" IN ('4',- '3',+ AND "posthog_sessionrecordingviewed"."session_id" IN ('3','2','1'))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.71+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.6+ '''+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.60'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id","posthog_user"."email" AS "user__email"FROM "posthog_sessionrecordingviewed"INNER JOIN "posthog_user" ON ("posthog_sessionrecordingviewed"."user_id" = "posthog_user"."id")- WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('4',- '3',+ WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('3','2','1')AND "posthog_sessionrecordingviewed"."team_id" = 99999AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.72+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.61'''SELECT "posthog_user"."id","posthog_user"."password",@@ -12204,7 +12493,7 @@AND "posthog_user"."id" = 99999)'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.73+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.62'''SELECT "posthog_organization"."id","posthog_organization"."name",@@ -12248,7 +12537,7 @@LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.74+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.63'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -12388,7 +12677,7 @@LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.75+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.64'''SELECT "posthog_organizationmembership"."id","posthog_organizationmembership"."organization_id",@@ -12441,7 +12730,7 @@LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.76+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.65'''SELECT "ee_accesscontrol"."id","ee_accesscontrol"."team_id",@@ -12466,7 +12755,7 @@AND "ee_accesscontrol"."team_id" = 99999))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.77+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.66'''SELECT "posthog_organizationmembership"."id","posthog_organizationmembership"."organization_id",@@ -12517,7 +12806,162 @@WHERE "posthog_organizationmembership"."user_id" = 99999'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.78+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.67+ '''+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.68+ '''+ SELECT "posthog_datawarehousesavedquery"."created_by_id",+ "posthog_datawarehousesavedquery"."created_at",+ "posthog_datawarehousesavedquery"."updated_at",+ "posthog_datawarehousesavedquery"."deleted",+ "posthog_datawarehousesavedquery"."deleted_at",+ "posthog_datawarehousesavedquery"."id",+ "posthog_datawarehousesavedquery"."name",+ "posthog_datawarehousesavedquery"."team_id",+ "posthog_datawarehousesavedquery"."latest_error",+ "posthog_datawarehousesavedquery"."columns",+ "posthog_datawarehousesavedquery"."column_order",+ "posthog_datawarehousesavedquery"."external_tables",+ "posthog_datawarehousesavedquery"."query",+ "posthog_datawarehousesavedquery"."status",+ "posthog_datawarehousesavedquery"."last_run_at",+ "posthog_datawarehousesavedquery"."sync_frequency_interval",+ "posthog_datawarehousesavedquery"."table_id",+ "posthog_datawarehousesavedquery"."is_materialized",+ "posthog_datawarehousesavedquery"."deleted_name",+ "posthog_datawarehousesavedquery"."managed_viewset_id",+ "posthog_datawarehousesavedquery"."folder_id",+ "posthog_datawarehousesavedquery"."origin",+ "posthog_datawarehousesavedquery"."is_test",+ "posthog_datawarehousesavedquery"."expires_at",+ "posthog_datawarehousesavedquery"."semantic_enrichment_hash",+ "posthog_user"."id",+ "posthog_user"."password",+ "posthog_user"."last_login",+ "posthog_user"."first_name",+ "posthog_user"."last_name",+ "posthog_user"."is_staff",+ "posthog_user"."date_joined",+ "posthog_user"."uuid",+ "posthog_user"."current_organization_id",+ "posthog_user"."current_team_id",+ "posthog_user"."email",+ "posthog_user"."pending_email",+ "posthog_user"."distinct_id",+ "posthog_user"."is_email_verified",+ "posthog_user"."credentials_reviewed_at",+ "posthog_user"."requested_password_reset_at",+ "posthog_user"."requested_2fa_reset_at",+ "posthog_user"."has_seen_product_intro_for",+ "posthog_user"."strapi_id",+ "posthog_user"."is_active",+ "posthog_user"."role_at_organization",+ "posthog_user"."theme_mode",+ "posthog_user"."partial_notification_settings",+ "posthog_user"."anonymize_data",+ "posthog_user"."allow_impersonation",+ "posthog_user"."toolbar_mode",+ "posthog_user"."hedgehog_config",+ "posthog_user"."allow_sidebar_suggestions",+ "posthog_user"."shortcut_position",+ "posthog_user"."passkeys_enabled_for_2fa",+ "posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration",+ "posthog_user"."onboarding_skipped_at",+ "posthog_user"."onboarding_skipped_reason",+ "posthog_user"."onboarding_skipped_organization_id",+ "posthog_user"."onboarding_delegated_to_invite_id",+ "posthog_user"."onboarding_delegated_to_organization_id",+ "posthog_user"."onboarding_delegation_accepted_at",+ "posthog_user"."events_column_config",+ "posthog_user"."email_opt_in",+ "posthog_datawarehousetable"."created_by_id",+ "posthog_datawarehousetable"."created_at",+ "posthog_datawarehousetable"."updated_at",+ "posthog_datawarehousetable"."deleted",+ "posthog_datawarehousetable"."deleted_at",+ "posthog_datawarehousetable"."id",+ "posthog_datawarehousetable"."name",+ "posthog_datawarehousetable"."format",+ "posthog_datawarehousetable"."team_id",+ "posthog_datawarehousetable"."url_pattern",+ "posthog_datawarehousetable"."queryable_folder",+ "posthog_datawarehousetable"."credential_id",+ "posthog_datawarehousetable"."external_data_source_id",+ "posthog_datawarehousetable"."columns",+ "posthog_datawarehousetable"."column_order",+ "posthog_datawarehousetable"."options",+ "posthog_datawarehousetable"."row_count",+ "posthog_datawarehousetable"."size_in_s3_mib",+ "posthog_datawarehousemanagedviewset"."created_by_id",+ "posthog_datawarehousemanagedviewset"."created_at",+ "posthog_datawarehousemanagedviewset"."updated_at",+ "posthog_datawarehousemanagedviewset"."id",+ "posthog_datawarehousemanagedviewset"."team_id",+ "posthog_datawarehousemanagedviewset"."kind"+ FROM "posthog_datawarehousesavedquery"+ LEFT OUTER JOIN "posthog_datawarehousemanagedviewset" ON ("posthog_datawarehousesavedquery"."managed_viewset_id" = "posthog_datawarehousemanagedviewset"."id")+ LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousesavedquery"."created_by_id" = "posthog_user"."id")+ LEFT OUTER JOIN "posthog_datawarehousetable" ON ("posthog_datawarehousesavedquery"."table_id" = "posthog_datawarehousetable"."id")+ WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999+ AND NOT ("posthog_datawarehousesavedquery"."deleted"+ AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)+ AND "posthog_datawarehousesavedquery"."managed_viewset_id" IS NULL)+ ORDER BY "posthog_datawarehousesavedquery"."name" ASC+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.69'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -12601,25 +13045,17 @@"posthog_datawarehousetable"."column_order","posthog_datawarehousetable"."options","posthog_datawarehousetable"."row_count",- "posthog_datawarehousetable"."size_in_s3_mib",- "posthog_datawarehousemanagedviewset"."created_by_id",- "posthog_datawarehousemanagedviewset"."created_at",- "posthog_datawarehousemanagedviewset"."updated_at",- "posthog_datawarehousemanagedviewset"."id",- "posthog_datawarehousemanagedviewset"."team_id",- "posthog_datawarehousemanagedviewset"."kind"+ "posthog_datawarehousetable"."size_in_s3_mib"FROM "posthog_datawarehousesavedquery"- LEFT OUTER JOIN "posthog_datawarehousemanagedviewset" ON ("posthog_datawarehousesavedquery"."managed_viewset_id" = "posthog_datawarehousemanagedviewset"."id")LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousesavedquery"."created_by_id" = "posthog_user"."id")LEFT OUTER JOIN "posthog_datawarehousetable" ON ("posthog_datawarehousesavedquery"."table_id" = "posthog_datawarehousetable"."id")WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999+ AND "posthog_datawarehousesavedquery"."origin" = 'endpoint'AND NOT ("posthog_datawarehousesavedquery"."deleted"- AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)- AND "posthog_datawarehousesavedquery"."managed_viewset_id" IS NULL)- ORDER BY "posthog_datawarehousesavedquery"."name" ASC+ AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.79+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.7'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -12703,55 +13139,25 @@"posthog_datawarehousetable"."column_order","posthog_datawarehousetable"."options","posthog_datawarehousetable"."row_count",- "posthog_datawarehousetable"."size_in_s3_mib"+ "posthog_datawarehousetable"."size_in_s3_mib",+ "posthog_datawarehousemanagedviewset"."created_by_id",+ "posthog_datawarehousemanagedviewset"."created_at",+ "posthog_datawarehousemanagedviewset"."updated_at",+ "posthog_datawarehousemanagedviewset"."id",+ "posthog_datawarehousemanagedviewset"."team_id",+ "posthog_datawarehousemanagedviewset"."kind"FROM "posthog_datawarehousesavedquery"+ LEFT OUTER JOIN "posthog_datawarehousemanagedviewset" ON ("posthog_datawarehousesavedquery"."managed_viewset_id" = "posthog_datawarehousemanagedviewset"."id")LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousesavedquery"."created_by_id" = "posthog_user"."id")LEFT OUTER JOIN "posthog_datawarehousetable" ON ("posthog_datawarehousesavedquery"."table_id" = "posthog_datawarehousetable"."id")WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999- AND "posthog_datawarehousesavedquery"."origin" = 'endpoint'AND NOT ("posthog_datawarehousesavedquery"."deleted"- AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))- '''-# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.8- '''- SELECT "posthog_externaldatasource"."created_by_id",- "posthog_externaldatasource"."created_at",- "posthog_externaldatasource"."updated_at",- "posthog_externaldatasource"."deleted",- "posthog_externaldatasource"."deleted_at",- "posthog_externaldatasource"."id",- "posthog_externaldatasource"."source_id",- "posthog_externaldatasource"."connection_id",- "posthog_externaldatasource"."destination_id",- "posthog_externaldatasource"."team_id",- "posthog_externaldatasource"."sync_frequency",- "posthog_externaldatasource"."status",- "posthog_externaldatasource"."source_type",- "posthog_externaldatasource"."api_version",- "posthog_externaldatasource"."job_inputs",- "posthog_externaldatasource"."connection_metadata",- "posthog_externaldatasource"."are_tables_created",- "posthog_externaldatasource"."prefix",- "posthog_externaldatasource"."description",- "posthog_externaldatasource"."created_via",- "posthog_externaldatasource"."access_method",- "posthog_externaldatasource"."direct_query_enabled",- "posthog_externaldatasource"."auto_sync_new_schemas",- "posthog_externaldatasource"."auto_sync_schema_patterns",- "posthog_externaldatasource"."revenue_analytics_enabled",- "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",- "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",- "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"- FROM "posthog_externaldatasource"- LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")- WHERE ("posthog_externaldatasource"."source_type" IN ('Stripe')- AND "posthog_externaldatasource"."team_id" = 99999- AND NOT ("posthog_externaldatasource"."deleted"- AND "posthog_externaldatasource"."deleted" IS NOT NULL))+ AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL)+ AND "posthog_datawarehousesavedquery"."managed_viewset_id" IS NULL)+ ORDER BY "posthog_datawarehousesavedquery"."name" ASC'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.80+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.70'''SELECT "posthog_externaldatasource"."created_by_id","posthog_externaldatasource"."created_at",@@ -12789,7 +13195,7 @@AND "posthog_externaldatasource"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.81+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.71'''SELECT "posthog_datawarehousetable"."created_by_id","posthog_datawarehousetable"."created_at",@@ -12862,7 +13268,7 @@ORDER BY "posthog_datawarehousetable"."created_at" DESC'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.82+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.72'''SELECT "posthog_datawarehousejoin"."created_by_id","posthog_datawarehousejoin"."created_at",@@ -12882,7 +13288,7 @@AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.83+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.73'''SELECT "data_tools_datawarehouseexpression"."deleted","data_tools_datawarehouseexpression"."deleted_at",@@ -12901,7 +13307,7 @@AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.84+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.74'''SELECT "posthog_sessionrecording"."id","posthog_sessionrecording"."session_id",@@ -12929,32 +13335,29 @@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.85+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.75'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"FROM "posthog_sessionrecordingviewed"WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999AND "posthog_sessionrecordingviewed"."user_id" = 99999- AND "posthog_sessionrecordingviewed"."session_id" IN ('5',- '4',+ AND "posthog_sessionrecordingviewed"."session_id" IN ('4','3','2','1'))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.86+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.76'''SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id","posthog_user"."email" AS "user__email"FROM "posthog_sessionrecordingviewed"INNER JOIN "posthog_user" ON ("posthog_sessionrecordingviewed"."user_id" = "posthog_user"."id")- WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('5',- '4',+ WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('4','3','2','1')@@ -12962,7 +13365,7 @@AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.87+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.77'''SELECT "posthog_user"."id","posthog_user"."password",@@ -13008,7 +13411,7 @@AND "posthog_user"."id" = 99999)'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.88+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.78'''SELECT "posthog_organization"."id","posthog_organization"."name",@@ -13052,7 +13455,7 @@LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.89+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.79'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -13192,26 +13595,33 @@LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.9+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.8'''- SELECT "posthog_datawarehousetable"."created_by_id",- "posthog_datawarehousetable"."created_at",- "posthog_datawarehousetable"."updated_at",- "posthog_datawarehousetable"."deleted",- "posthog_datawarehousetable"."deleted_at",- "posthog_datawarehousetable"."id",- "posthog_datawarehousetable"."name",- "posthog_datawarehousetable"."format",- "posthog_datawarehousetable"."team_id",- "posthog_datawarehousetable"."url_pattern",- "posthog_datawarehousetable"."queryable_folder",- "posthog_datawarehousetable"."credential_id",- "posthog_datawarehousetable"."external_data_source_id",- "posthog_datawarehousetable"."columns",- "posthog_datawarehousetable"."column_order",- "posthog_datawarehousetable"."options",- "posthog_datawarehousetable"."row_count",- "posthog_datawarehousetable"."size_in_s3_mib",+ SELECT "posthog_datawarehousesavedquery"."created_by_id",+ "posthog_datawarehousesavedquery"."created_at",+ "posthog_datawarehousesavedquery"."updated_at",+ "posthog_datawarehousesavedquery"."deleted",+ "posthog_datawarehousesavedquery"."deleted_at",+ "posthog_datawarehousesavedquery"."id",+ "posthog_datawarehousesavedquery"."name",+ "posthog_datawarehousesavedquery"."team_id",+ "posthog_datawarehousesavedquery"."latest_error",+ "posthog_datawarehousesavedquery"."columns",+ "posthog_datawarehousesavedquery"."column_order",+ "posthog_datawarehousesavedquery"."external_tables",+ "posthog_datawarehousesavedquery"."query",+ "posthog_datawarehousesavedquery"."status",+ "posthog_datawarehousesavedquery"."last_run_at",+ "posthog_datawarehousesavedquery"."sync_frequency_interval",+ "posthog_datawarehousesavedquery"."table_id",+ "posthog_datawarehousesavedquery"."is_materialized",+ "posthog_datawarehousesavedquery"."deleted_name",+ "posthog_datawarehousesavedquery"."managed_viewset_id",+ "posthog_datawarehousesavedquery"."folder_id",+ "posthog_datawarehousesavedquery"."origin",+ "posthog_datawarehousesavedquery"."is_test",+ "posthog_datawarehousesavedquery"."expires_at",+ "posthog_datawarehousesavedquery"."semantic_enrichment_hash","posthog_user"."id","posthog_user"."password","posthog_user"."last_login",@@ -13251,21 +13661,35 @@"posthog_user"."onboarding_delegated_to_organization_id","posthog_user"."onboarding_delegation_accepted_at","posthog_user"."events_column_config",- "posthog_user"."email_opt_in"- FROM "posthog_datawarehousetable"- LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")- LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousetable"."created_by_id" = "posthog_user"."id")- WHERE ("posthog_datawarehousetable"."team_id" = 99999- AND NOT ("posthog_datawarehousetable"."deleted"- AND "posthog_datawarehousetable"."deleted" IS NOT NULL)- AND NOT ("posthog_externaldatasource"."deleted"- AND "posthog_externaldatasource"."deleted" IS NOT NULL)- AND NOT ("posthog_externaldatasource"."access_method" = 'direct'- AND "posthog_externaldatasource"."access_method" IS NOT NULL))- ORDER BY "posthog_datawarehousetable"."created_at" DESC+ "posthog_user"."email_opt_in",+ "posthog_datawarehousetable"."created_by_id",+ "posthog_datawarehousetable"."created_at",+ "posthog_datawarehousetable"."updated_at",+ "posthog_datawarehousetable"."deleted",+ "posthog_datawarehousetable"."deleted_at",+ "posthog_datawarehousetable"."id",+ "posthog_datawarehousetable"."name",+ "posthog_datawarehousetable"."format",+ "posthog_datawarehousetable"."team_id",+ "posthog_datawarehousetable"."url_pattern",+ "posthog_datawarehousetable"."queryable_folder",+ "posthog_datawarehousetable"."credential_id",+ "posthog_datawarehousetable"."external_data_source_id",+ "posthog_datawarehousetable"."columns",+ "posthog_datawarehousetable"."column_order",+ "posthog_datawarehousetable"."options",+ "posthog_datawarehousetable"."row_count",+ "posthog_datawarehousetable"."size_in_s3_mib"+ FROM "posthog_datawarehousesavedquery"+ LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousesavedquery"."created_by_id" = "posthog_user"."id")+ LEFT OUTER JOIN "posthog_datawarehousetable" ON ("posthog_datawarehousesavedquery"."table_id" = "posthog_datawarehousetable"."id")+ WHERE ("posthog_datawarehousesavedquery"."team_id" = 99999+ AND "posthog_datawarehousesavedquery"."origin" = 'endpoint'+ AND NOT ("posthog_datawarehousesavedquery"."deleted"+ AND "posthog_datawarehousesavedquery"."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.80'''SELECT "posthog_organizationmembership"."id","posthog_organizationmembership"."organization_id",@@ -13318,7 +13742,7 @@LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.91+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.81'''SELECT "ee_accesscontrol"."id","ee_accesscontrol"."team_id",@@ -13343,7 +13767,58 @@AND "ee_accesscontrol"."team_id" = 99999))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.92+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.82+ '''+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE "posthog_organizationmembership"."user_id" = 99999+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.83'''SELECT "posthog_organizationmembership"."id","posthog_organizationmembership"."organization_id",@@ -13391,10 +13866,12 @@"posthog_organization"."is_platform"FROM "posthog_organizationmembership"INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE "posthog_organizationmembership"."user_id" = 99999+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.93+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.84'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -13496,7 +13973,7 @@ORDER BY "posthog_datawarehousesavedquery"."name" ASC'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.94+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.85'''SELECT "posthog_datawarehousesavedquery"."created_by_id","posthog_datawarehousesavedquery"."created_at",@@ -13590,65 +14067,258 @@AND "posthog_datawarehousesavedquery"."deleted" IS NOT NULL))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.95+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.86+ '''+ SELECT "posthog_externaldatasource"."created_by_id",+ "posthog_externaldatasource"."created_at",+ "posthog_externaldatasource"."updated_at",+ "posthog_externaldatasource"."deleted",+ "posthog_externaldatasource"."deleted_at",+ "posthog_externaldatasource"."id",+ "posthog_externaldatasource"."source_id",+ "posthog_externaldatasource"."connection_id",+ "posthog_externaldatasource"."destination_id",+ "posthog_externaldatasource"."team_id",+ "posthog_externaldatasource"."sync_frequency",+ "posthog_externaldatasource"."status",+ "posthog_externaldatasource"."source_type",+ "posthog_externaldatasource"."api_version",+ "posthog_externaldatasource"."job_inputs",+ "posthog_externaldatasource"."connection_metadata",+ "posthog_externaldatasource"."are_tables_created",+ "posthog_externaldatasource"."prefix",+ "posthog_externaldatasource"."description",+ "posthog_externaldatasource"."created_via",+ "posthog_externaldatasource"."access_method",+ "posthog_externaldatasource"."direct_query_enabled",+ "posthog_externaldatasource"."auto_sync_new_schemas",+ "posthog_externaldatasource"."auto_sync_schema_patterns",+ "posthog_externaldatasource"."revenue_analytics_enabled",+ "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",+ "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",+ "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"+ FROM "posthog_externaldatasource"+ LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")+ WHERE ("posthog_externaldatasource"."source_type" IN ('Stripe')+ AND "posthog_externaldatasource"."team_id" = 99999+ AND NOT ("posthog_externaldatasource"."deleted"+ AND "posthog_externaldatasource"."deleted" IS NOT NULL))+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.87+ '''+ SELECT "posthog_datawarehousetable"."created_by_id",+ "posthog_datawarehousetable"."created_at",+ "posthog_datawarehousetable"."updated_at",+ "posthog_datawarehousetable"."deleted",+ "posthog_datawarehousetable"."deleted_at",+ "posthog_datawarehousetable"."id",+ "posthog_datawarehousetable"."name",+ "posthog_datawarehousetable"."format",+ "posthog_datawarehousetable"."team_id",+ "posthog_datawarehousetable"."url_pattern",+ "posthog_datawarehousetable"."queryable_folder",+ "posthog_datawarehousetable"."credential_id",+ "posthog_datawarehousetable"."external_data_source_id",+ "posthog_datawarehousetable"."columns",+ "posthog_datawarehousetable"."column_order",+ "posthog_datawarehousetable"."options",+ "posthog_datawarehousetable"."row_count",+ "posthog_datawarehousetable"."size_in_s3_mib",+ "posthog_user"."id",+ "posthog_user"."password",+ "posthog_user"."last_login",+ "posthog_user"."first_name",+ "posthog_user"."last_name",+ "posthog_user"."is_staff",+ "posthog_user"."date_joined",+ "posthog_user"."uuid",+ "posthog_user"."current_organization_id",+ "posthog_user"."current_team_id",+ "posthog_user"."email",+ "posthog_user"."pending_email",+ "posthog_user"."distinct_id",+ "posthog_user"."is_email_verified",+ "posthog_user"."credentials_reviewed_at",+ "posthog_user"."requested_password_reset_at",+ "posthog_user"."requested_2fa_reset_at",+ "posthog_user"."has_seen_product_intro_for",+ "posthog_user"."strapi_id",+ "posthog_user"."is_active",+ "posthog_user"."role_at_organization",+ "posthog_user"."theme_mode",+ "posthog_user"."partial_notification_settings",+ "posthog_user"."anonymize_data",+ "posthog_user"."allow_impersonation",+ "posthog_user"."toolbar_mode",+ "posthog_user"."hedgehog_config",+ "posthog_user"."allow_sidebar_suggestions",+ "posthog_user"."shortcut_position",+ "posthog_user"."passkeys_enabled_for_2fa",+ "posthog_user"."hide_mcp_hints",+ "posthog_user"."ui_configuration",+ "posthog_user"."onboarding_skipped_at",+ "posthog_user"."onboarding_skipped_reason",+ "posthog_user"."onboarding_skipped_organization_id",+ "posthog_user"."onboarding_delegated_to_invite_id",+ "posthog_user"."onboarding_delegated_to_organization_id",+ "posthog_user"."onboarding_delegation_accepted_at",+ "posthog_user"."events_column_config",+ "posthog_user"."email_opt_in"+ FROM "posthog_datawarehousetable"+ LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")+ LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousetable"."created_by_id" = "posthog_user"."id")+ WHERE ("posthog_datawarehousetable"."team_id" = 99999+ AND NOT ("posthog_datawarehousetable"."deleted"+ AND "posthog_datawarehousetable"."deleted" IS NOT NULL)+ AND NOT ("posthog_externaldatasource"."deleted"+ AND "posthog_externaldatasource"."deleted" IS NOT NULL)+ AND NOT ("posthog_externaldatasource"."access_method" = 'direct'+ AND "posthog_externaldatasource"."access_method" IS NOT NULL))+ ORDER BY "posthog_datawarehousetable"."created_at" DESC+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.88+ '''+ 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.89+ '''+ SELECT "data_tools_datawarehouseexpression"."deleted",+ "data_tools_datawarehouseexpression"."deleted_at",+ "data_tools_datawarehouseexpression"."id",+ "data_tools_datawarehouseexpression"."team_id",+ "data_tools_datawarehouseexpression"."created_at",+ "data_tools_datawarehouseexpression"."created_by_id",+ "data_tools_datawarehouseexpression"."table_name",+ "data_tools_datawarehouseexpression"."field_name",+ "data_tools_datawarehouseexpression"."expression",+ "data_tools_datawarehouseexpression"."connection_id"+ FROM "data_tools_datawarehouseexpression"+ WHERE ("data_tools_datawarehouseexpression"."team_id" = 99999+ AND NOT ("data_tools_datawarehouseexpression"."deleted"+ AND "data_tools_datawarehouseexpression"."deleted" IS NOT NULL)+ AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.9+ '''+ SELECT "posthog_externaldatasource"."created_by_id",+ "posthog_externaldatasource"."created_at",+ "posthog_externaldatasource"."updated_at",+ "posthog_externaldatasource"."deleted",+ "posthog_externaldatasource"."deleted_at",+ "posthog_externaldatasource"."id",+ "posthog_externaldatasource"."source_id",+ "posthog_externaldatasource"."connection_id",+ "posthog_externaldatasource"."destination_id",+ "posthog_externaldatasource"."team_id",+ "posthog_externaldatasource"."sync_frequency",+ "posthog_externaldatasource"."status",+ "posthog_externaldatasource"."source_type",+ "posthog_externaldatasource"."api_version",+ "posthog_externaldatasource"."job_inputs",+ "posthog_externaldatasource"."connection_metadata",+ "posthog_externaldatasource"."are_tables_created",+ "posthog_externaldatasource"."prefix",+ "posthog_externaldatasource"."description",+ "posthog_externaldatasource"."created_via",+ "posthog_externaldatasource"."access_method",+ "posthog_externaldatasource"."direct_query_enabled",+ "posthog_externaldatasource"."auto_sync_new_schemas",+ "posthog_externaldatasource"."auto_sync_schema_patterns",+ "posthog_externaldatasource"."revenue_analytics_enabled",+ "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",+ "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",+ "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"+ FROM "posthog_externaldatasource"+ LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")+ WHERE ("posthog_externaldatasource"."source_type" IN ('Stripe')+ AND "posthog_externaldatasource"."team_id" = 99999+ AND NOT ("posthog_externaldatasource"."deleted"+ AND "posthog_externaldatasource"."deleted" IS NOT NULL))+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.90+ '''+ 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"."full_recording_v2_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",+ "posthog_sessionrecording"."retention_period_days"+ FROM "posthog_sessionrecording"+ WHERE ("posthog_sessionrecording"."session_id" IN ('1',+ '2',+ '3',+ '4',+ '5')+ AND "posthog_sessionrecording"."team_id" = 99999)+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.91'''- SELECT "posthog_externaldatasource"."created_by_id",- "posthog_externaldatasource"."created_at",- "posthog_externaldatasource"."updated_at",- "posthog_externaldatasource"."deleted",- "posthog_externaldatasource"."deleted_at",- "posthog_externaldatasource"."id",- "posthog_externaldatasource"."source_id",- "posthog_externaldatasource"."connection_id",- "posthog_externaldatasource"."destination_id",- "posthog_externaldatasource"."team_id",- "posthog_externaldatasource"."sync_frequency",- "posthog_externaldatasource"."status",- "posthog_externaldatasource"."source_type",- "posthog_externaldatasource"."api_version",- "posthog_externaldatasource"."job_inputs",- "posthog_externaldatasource"."connection_metadata",- "posthog_externaldatasource"."are_tables_created",- "posthog_externaldatasource"."prefix",- "posthog_externaldatasource"."description",- "posthog_externaldatasource"."created_via",- "posthog_externaldatasource"."access_method",- "posthog_externaldatasource"."direct_query_enabled",- "posthog_externaldatasource"."auto_sync_new_schemas",- "posthog_externaldatasource"."auto_sync_schema_patterns",- "posthog_externaldatasource"."revenue_analytics_enabled",- "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id",- "posthog_externaldatasourcerevenueanalyticsconfig"."enabled",- "posthog_externaldatasourcerevenueanalyticsconfig"."include_invoiceless_charges"- FROM "posthog_externaldatasource"- LEFT OUTER JOIN "posthog_externaldatasourcerevenueanalyticsconfig" ON ("posthog_externaldatasource"."id" = "posthog_externaldatasourcerevenueanalyticsconfig"."external_data_source_id")- WHERE ("posthog_externaldatasource"."source_type" IN ('Stripe')- AND "posthog_externaldatasource"."team_id" = 99999- AND NOT ("posthog_externaldatasource"."deleted"- AND "posthog_externaldatasource"."deleted" IS NOT NULL))+ SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id"+ FROM "posthog_sessionrecordingviewed"+ WHERE ("posthog_sessionrecordingviewed"."team_id" = 99999+ AND "posthog_sessionrecordingviewed"."user_id" = 99999+ AND "posthog_sessionrecordingviewed"."session_id" IN ('5',+ '4',+ '3',+ '2',+ '1'))'''# ----# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.96+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.92'''- SELECT "posthog_datawarehousetable"."created_by_id",- "posthog_datawarehousetable"."created_at",- "posthog_datawarehousetable"."updated_at",- "posthog_datawarehousetable"."deleted",- "posthog_datawarehousetable"."deleted_at",- "posthog_datawarehousetable"."id",- "posthog_datawarehousetable"."name",- "posthog_datawarehousetable"."format",- "posthog_datawarehousetable"."team_id",- "posthog_datawarehousetable"."url_pattern",- "posthog_datawarehousetable"."queryable_folder",- "posthog_datawarehousetable"."credential_id",- "posthog_datawarehousetable"."external_data_source_id",- "posthog_datawarehousetable"."columns",- "posthog_datawarehousetable"."column_order",- "posthog_datawarehousetable"."options",- "posthog_datawarehousetable"."row_count",- "posthog_datawarehousetable"."size_in_s3_mib",- "posthog_user"."id",+ SELECT "posthog_sessionrecordingviewed"."session_id" AS "session_id",+ "posthog_user"."email" AS "user__email"+ FROM "posthog_sessionrecordingviewed"+ INNER JOIN "posthog_user" ON ("posthog_sessionrecordingviewed"."user_id" = "posthog_user"."id")+ WHERE ("posthog_sessionrecordingviewed"."session_id" IN ('5',+ '4',+ '3',+ '2',+ '1')+ AND "posthog_sessionrecordingviewed"."team_id" = 99999+ AND NOT ("posthog_sessionrecordingviewed"."user_id" = 99999))+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.93+ '''+ SELECT "posthog_user"."id","posthog_user"."password","posthog_user"."last_login","posthog_user"."first_name",@@ -13663,7 +14333,6 @@"posthog_user"."distinct_id","posthog_user"."is_email_verified","posthog_user"."credentials_reviewed_at",- "posthog_user"."requested_password_reset_at","posthog_user"."requested_2fa_reset_at","posthog_user"."has_seen_product_intro_for","posthog_user"."strapi_id",@@ -13688,89 +14357,374 @@"posthog_user"."onboarding_delegation_accepted_at","posthog_user"."events_column_config","posthog_user"."email_opt_in"- FROM "posthog_datawarehousetable"- LEFT OUTER JOIN "posthog_externaldatasource" ON ("posthog_datawarehousetable"."external_data_source_id" = "posthog_externaldatasource"."id")- LEFT OUTER JOIN "posthog_user" ON ("posthog_datawarehousetable"."created_by_id" = "posthog_user"."id")- WHERE ("posthog_datawarehousetable"."team_id" = 99999- AND NOT ("posthog_datawarehousetable"."deleted"- AND "posthog_datawarehousetable"."deleted" IS NOT NULL)- AND NOT ("posthog_externaldatasource"."deleted"- AND "posthog_externaldatasource"."deleted" IS NOT NULL)- AND NOT ("posthog_externaldatasource"."access_method" = 'direct'- AND "posthog_externaldatasource"."access_method" IS NOT NULL))- ORDER BY "posthog_datawarehousetable"."created_at" DESC+ FROM "posthog_user"+ WHERE ("posthog_user"."is_active"+ AND "posthog_user"."id" = 99999)+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.94+ '''+ SELECT "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organization"+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid+ LIMIT 21+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.95+ '''+ SELECT "posthog_team"."id",+ "posthog_team"."uuid",+ "posthog_team"."organization_id",+ "posthog_team"."parent_team_id",+ "posthog_team"."project_id",+ "posthog_team"."api_token",+ "posthog_team"."app_urls",+ "posthog_team"."name",+ "posthog_team"."slack_incoming_webhook",+ "posthog_team"."created_at",+ "posthog_team"."updated_at",+ "posthog_team"."anonymize_ips",+ "posthog_team"."completed_snippet_onboarding",+ "posthog_team"."has_completed_onboarding_for",+ "posthog_team"."onboarding_tasks",+ "posthog_team"."ingested_event",+ "posthog_team"."ingested_production_event",+ "posthog_team"."ingested_production_event_last_checked_at",+ "posthog_team"."person_processing_opt_out",+ "posthog_team"."secret_api_token",+ "posthog_team"."secret_api_token_backup",+ "posthog_team"."session_recording_opt_in",+ "posthog_team"."session_recording_sample_rate",+ "posthog_team"."session_recording_minimum_duration_milliseconds",+ "posthog_team"."session_recording_linked_flag",+ "posthog_team"."session_recording_network_payload_capture_config",+ "posthog_team"."session_recording_masking_config",+ "posthog_team"."session_recording_url_trigger_config",+ "posthog_team"."session_recording_url_blocklist_config",+ "posthog_team"."session_recording_event_trigger_config",+ "posthog_team"."session_recording_trigger_match_type_config",+ "posthog_team"."session_recording_trigger_groups",+ "posthog_team"."session_replay_config",+ "posthog_team"."session_recording_retention_period",+ "posthog_team"."event_retention_months",+ "posthog_team"."conversations_enabled",+ "posthog_team"."conversations_settings",+ "posthog_team"."proactive_tasks_enabled",+ "posthog_team"."survey_config",+ "posthog_team"."surveys_opt_in",+ "posthog_team"."product_tours_opt_in",+ "posthog_team"."capture_console_log_opt_in",+ "posthog_team"."capture_performance_opt_in",+ "posthog_team"."capture_dead_clicks",+ "posthog_team"."autocapture_opt_out",+ "posthog_team"."autocapture_web_vitals_opt_in",+ "posthog_team"."autocapture_web_vitals_allowed_metrics",+ "posthog_team"."autocapture_exceptions_opt_in",+ "posthog_team"."autocapture_exceptions_errors_to_ignore",+ "posthog_team"."logs_settings",+ "posthog_team"."llm_gateway_enabled_at",+ "posthog_team"."llm_gateway_revoked_at",+ "posthog_team"."llm_gateway_overspend_allowance_usd",+ "posthog_team"."heatmaps_opt_in",+ "posthog_team"."receive_org_level_activity_logs",+ "posthog_team"."web_analytics_pre_aggregated_tables_enabled",+ "posthog_team"."web_analytics_pre_aggregated_tables_version",+ "posthog_team"."flags_persistence_default",+ "posthog_team"."feature_flag_confirmation_enabled",+ "posthog_team"."feature_flag_confirmation_message",+ "posthog_team"."default_evaluation_environments_enabled",+ "posthog_team"."require_evaluation_environment_tags",+ "posthog_team"."default_evaluation_contexts_enabled",+ "posthog_team"."require_evaluation_contexts",+ "posthog_team"."session_recording_version",+ "posthog_team"."signup_token",+ "posthog_team"."is_demo",+ "posthog_team"."access_control",+ "posthog_team"."week_start_day",+ "posthog_team"."inject_web_apps",+ "posthog_team"."test_account_filters",+ "posthog_team"."test_account_filters_default_checked",+ "posthog_team"."path_cleaning_filters",+ "posthog_team"."timezone",+ "posthog_team"."data_attributes",+ "posthog_team"."person_display_name_properties",+ "posthog_team"."live_events_columns",+ "posthog_team"."recording_domains",+ "posthog_team"."human_friendly_comparison_periods",+ "posthog_team"."cookieless_server_hash_mode",+ "posthog_team"."primary_dashboard_id",+ "posthog_team"."default_data_theme",+ "posthog_team"."extra_settings",+ "posthog_team"."modifiers",+ "posthog_team"."correlation_config",+ "posthog_team"."session_recording_retention_period_days",+ "posthog_team"."external_data_workspace_id",+ "posthog_team"."external_data_workspace_last_synced_at",+ "posthog_team"."api_query_rate_limit",+ "posthog_team"."drop_events_older_than",+ "posthog_team"."base_currency",+ "posthog_team"."experiment_recalculation_time",+ "posthog_team"."default_experiment_confidence_level",+ "posthog_team"."default_experiment_stats_method",+ "posthog_team"."business_model",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_team"+ INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")+ WHERE "posthog_team"."id" = 99999+ LIMIT 21+ '''+# ---+# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.96+ '''+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21'''# ---# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.97'''- SELECT "posthog_datawarehousejoin"."created_by_id",- "posthog_datawarehousejoin"."created_at",- "posthog_datawarehousejoin"."deleted",- "posthog_datawarehousejoin"."deleted_at",- "posthog_datawarehousejoin"."id",- "posthog_datawarehousejoin"."team_id",- "posthog_datawarehousejoin"."source_table_name",- "posthog_datawarehousejoin"."source_table_key",- "posthog_datawarehousejoin"."joining_table_name",- "posthog_datawarehousejoin"."joining_table_key",- "posthog_datawarehousejoin"."field_name",- "posthog_datawarehousejoin"."configuration"- FROM "posthog_datawarehousejoin"- WHERE ("posthog_datawarehousejoin"."team_id" = 99999- AND NOT ("posthog_datawarehousejoin"."deleted"- AND "posthog_datawarehousejoin"."deleted" IS NOT NULL))+ SELECT "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",+ "posthog_team"."organization_id" AS "_team_organization_id"+ FROM "ee_accesscontrol"+ INNER JOIN "posthog_team" ON ("ee_accesscontrol"."team_id" = "posthog_team"."id")+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")+ WHERE (("ee_accesscontrol"."organization_member_id" IS NULL+ AND "ee_accesscontrol"."role_id" IS NULL+ AND "ee_accesscontrol"."team_id" = 99999)+ OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999+ AND "ee_accesscontrol"."role_id" IS NULL+ AND "ee_accesscontrol"."team_id" = 99999))'''# ---# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.98'''- SELECT "data_tools_datawarehouseexpression"."deleted",- "data_tools_datawarehouseexpression"."deleted_at",- "data_tools_datawarehouseexpression"."id",- "data_tools_datawarehouseexpression"."team_id",- "data_tools_datawarehouseexpression"."created_at",- "data_tools_datawarehouseexpression"."created_by_id",- "data_tools_datawarehouseexpression"."table_name",- "data_tools_datawarehouseexpression"."field_name",- "data_tools_datawarehouseexpression"."expression",- "data_tools_datawarehouseexpression"."connection_id"- FROM "data_tools_datawarehouseexpression"- WHERE ("data_tools_datawarehouseexpression"."team_id" = 99999- AND NOT ("data_tools_datawarehouseexpression"."deleted"- AND "data_tools_datawarehouseexpression"."deleted" IS NOT NULL)- AND "data_tools_datawarehouseexpression"."connection_id" IS NULL)+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE "posthog_organizationmembership"."user_id" = 99999'''# ---# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.99'''- SELECT "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"."full_recording_v2_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",- "posthog_sessionrecording"."retention_period_days"- FROM "posthog_sessionrecording"- WHERE ("posthog_sessionrecording"."session_id" IN ('1',- '2',- '3',- '4',- '5',- '6')- AND "posthog_sessionrecording"."team_id" = 99999)+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."enforce_verified_domains",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_create_projects",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."members_can_see_org_members",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21'''# ---diff --git a/products/experiments/backend/facade/replay.py b/products/experiments/backend/facade/replay.pynew file mode 100644index 000000000000..a6eb217b06a9--- /dev/null+++ b/products/experiments/backend/facade/replay.py@@ -0,0 +1,5 @@+"""Replay linkage capability, re-exported for callers outside the experiments product."""++from products.experiments.backend.replay_linkage import exposed_distinct_ids_select, validate_experiment_exposure_access++__all__ = ["exposed_distinct_ids_select", "validate_experiment_exposure_access"]diff --git a/products/experiments/backend/replay_linkage.py b/products/experiments/backend/replay_linkage.pynew file mode 100644index 000000000000..b465779279d6--- /dev/null+++ b/products/experiments/backend/replay_linkage.py@@ -0,0 +1,167 @@+"""Person-scoped exposure linkage for replay surfaces.++Resolves an experiment's exposed population to one row per distinct id, carrying the person's+first exposure time, so recordings queries can show sessions of exposed persons. Built on the+same ExposureQueryBuilder the analysis queries use, which keeps exposure criteria, activation+events, and multiple-variant handling consistent with what the experiment's results count.++Linking by person and first exposure time, instead of requiring an exposure event inside the+session, is what keeps server-fired exposure events linkable: they carry no usable+``$session_id`` (none at all, or a context-generated one that matches no recording), but the+person's other distinct ids do appear on recordings. Expanding the exposed persons through+``raw_person_distinct_ids`` also covers cross-device sessions and anonymous pre-identify ids.+"""++from datetime import UTC, datetime++from django.contrib.auth.models import AnonymousUser++from rest_framework.exceptions import ValidationError++from posthog.schema import IntervalType++from posthog.hogql import ast+from posthog.hogql.parser import parse_select++from posthog.hogql_queries.utils.query_date_range import QueryDateRange+from posthog.models.team.team import Team+from posthog.models.user import User+from posthog.rbac.user_access_control import UserAccessControl, UserAccessControlError+from posthog.synthetic_user import SyntheticUser++from products.experiments.backend.hogql_queries.base_query_utils import experiment_window+from products.experiments.backend.hogql_queries.cuped_config import CupedQueryConfig+from products.experiments.backend.hogql_queries.experiment_exposure_query_builder import ExposureQueryBuilder+from products.experiments.backend.hogql_queries.experiment_query_builder import get_exposure_config_params_for_builder+from products.experiments.backend.hogql_queries.experiment_query_context import ExperimentQueryContext+from products.experiments.backend.hogql_queries.exposure_query_logic import get_entity_key+from products.experiments.backend.models.experiment import Experiment+++def validate_experiment_exposure_access(+ team: Team, user: User | AnonymousUser | SyntheticUser | None, experiment_id: int+) -> bool:+ """Refuse the ``experiment_exposure`` filter for viewers denied the experiment it names.++ The filter reveals experiment data through replay surfaces (which recordings belong to+ exposed persons, and to which variant), but recordings endpoints only enforce replay-level+ access — so the experiment's own object-level check must run here, matching what the+ experiment surfaces enforce for the same information.++ Refuses userless callers outright: a background job's output can reach viewers this check+ never evaluated (the playlist counting task caches match counts that any playlist viewer+ can read), so running the filter without a viewer can leak experiment data to viewers the+ experiment denies. A background consumer must supply the principal on whose behalf it+ runs, or not use the filter. Service-token principals and anonymous shared-link viewers+ are non-User principals outside object-level RBAC and pass; they are gated by API scope+ plus project membership, and by the sharing publish gate, respectively. An unknown+ experiment also passes, because there is no object to protect and+ :func:`exposed_distinct_ids_select` reports it as a ValidationError.++ Returns True, or raises UserAccessControlError (the query-runner access contract).+ """+ if user is None:+ raise UserAccessControlError("experiment", "viewer", resource_id=str(experiment_id))+ if not isinstance(user, User):+ return True+ experiment = Experiment.objects.filter(id=experiment_id, team=team, deleted=False).first()+ if experiment is None:+ return True+ if not UserAccessControl(user=user, team=team).check_access_level_for_object(experiment, required_level="viewer"):+ raise UserAccessControlError("experiment", "viewer", resource_id=str(experiment_id))+ return True+++def exposed_distinct_ids_select(team: Team, *, experiment_id: int, variant: str | None) -> ast.SelectQuery:+ """One row per exposed distinct id: (distinct_id, first_exposure_time).++ Raises ValidationError for experiments the linkage can't answer for: unknown or draft+ experiments, and group-aggregated ones, whose exposed entities are groups rather than+ persons and so never match a recording's distinct id.+ """+ try:+ experiment = Experiment.objects.get(id=experiment_id, team=team, deleted=False)+ except Experiment.DoesNotExist:+ raise ValidationError(f"Experiment {experiment_id} doesn't exist in this environment.")++ flag = getattr(experiment, "feature_flag", None)+ if flag is None:+ raise ValidationError("This experiment has no feature flag, so exposures can't be resolved.")+ if experiment.start_date is None:+ raise ValidationError("This experiment hasn't launched, so it has no exposed sessions yet.")+ if (flag.filters or {}).get("aggregation_group_type_index") is not None:+ raise ValidationError(+ "This experiment aggregates by group, so its exposures can't be matched to persons' recordings."+ )++ excluded_variants = set(experiment.excluded_variants or [])+ variant_keys = [+ variant_definition["key"]+ for variant_definition in flag.variants or []+ if variant_definition.get("key") and variant_definition["key"] not in excluded_variants+ ]+ if not variant_keys:+ raise ValidationError("This experiment's feature flag defines no variants.")+ if variant is not None:+ if variant not in variant_keys:+ raise ValidationError(f"'{variant}' is not a variant of this experiment.")+ requested_variants = [variant]+ else:+ requested_variants = variant_keys++ exposure_params = get_exposure_config_params_for_builder(experiment.exposure_criteria, team, experiment.start_date)+ date_range_query = QueryDateRange(+ date_range=experiment_window(experiment, team, as_of=experiment.end_date or datetime.now(UTC)),+ team=team,+ interval=IntervalType.DAY,+ now=datetime.now(UTC),+ )+ context = ExperimentQueryContext(+ team=team,+ feature_flag_key=flag.key_without_tombstone(),+ exposure_config=exposure_params.exposure_config,+ filter_test_accounts=exposure_params.filter_test_accounts,+ multiple_variant_handling=exposure_params.multiple_variant_handling,+ # The full variant list, not the requested one: variant attribution and multiple-variant+ # detection must see every variant, or a person exposed to two variants would pass as+ # cleanly exposed to the requested one. Narrowing happens in the WHERE below instead.+ variants=tuple(variant_keys),+ date_range_query=date_range_query,+ entity_key=get_entity_key(None),+ breakdowns=(),+ only_count_matured_users=False,+ cuped_config=CupedQueryConfig(),+ activation_config=exposure_params.activation_config,+ )+ exposure_select = ExposureQueryBuilder(context=context).select_query()++ # The WHERE on variant also drops entities attributed MULTIPLE_VARIANT_KEY under "exclude"+ # handling, matching who the analysis counts. Both join sides are pre-grouped, so each+ # distinct id carries exactly one exposure row and min() merely satisfies the GROUP BY.+ query = parse_select(+ """+ SELECT+ pdi.distinct_id AS distinct_id,+ min(exposures.first_exposure_time) AS first_exposure_time+ FROM (+ SELECT+ distinct_id,+ argMax(person_id, version) AS person_id,+ argMax(is_deleted, version) AS is_deleted+ FROM raw_person_distinct_ids+ WHERE team_id = {team_id}+ GROUP BY distinct_id+ HAVING is_deleted = 0+ ) AS pdi+ INNER JOIN ({exposure_select}) AS exposures ON exposures.entity_id = pdi.person_id+ WHERE exposures.variant IN {requested_variants}+ GROUP BY pdi.distinct_id+ """,+ placeholders={+ "team_id": ast.Constant(value=team.pk),+ "exposure_select": exposure_select,+ "requested_variants": ast.Constant(value=requested_variants),+ },+ )+ assert isinstance(query, ast.SelectQuery)+ return querydiff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex ed75ea0dc95d..eaef3dce369b 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -39490,6 +39490,13 @@ export namespace Schemas {version?: number | null;}+ export interface RecordingsQueryExperimentExposureFilter {+ /** Experiment whose exposed persons' sessions to show. Must belong to the environment the query runs in. */+ experiment_id: number;+ /** Narrow to persons exposed to this variant. Defaults to all of the experiment's variants. */+ variant?: string | null;+ }+export type RecordingOrder = typeof RecordingOrder[keyof typeof RecordingOrder];@@ -39654,6 +39661,8 @@ export namespace Schemas {date_to?: string | null;distinct_ids?: string[] | null;events?: RecordingsQueryEvents;+ /** Only sessions of persons exposed to this experiment, each ending at or after the person's first exposure as the experiment's exposure criteria count it. Resolved server-side from the experiment, so it links sessions even when the exposure events themselves carry no session id (e.g. server-side SDKs). Composes with the query's date range like any other filter, so set date_from to the experiment's start (or earlier) to cover the full run: the default window only reaches back a few days. */+ experiment_exposure?: RecordingsQueryExperimentExposureFilter | null;filter_test_accounts?: boolean | null;having_predicates?: (EventPropertyFilter | PersonPropertyFilter | PersonMetadataPropertyFilter | ElementPropertyFilter | EventMetadataPropertyFilter | SessionPropertyFilter | CohortPropertyFilter | RecordingPropertyFilter | LogEntryPropertyFilter | GroupPropertyFilter | FeaturePropertyFilter | FlagPropertyFilter | HogQLPropertyFilter | EmptyPropertyFilter | DataWarehousePropertyFilter | DataWarehousePersonPropertyFilter | ErrorTrackingIssueFilter | LogPropertyFilter | MetricPropertyFilter | SpanPropertyFilter | RevenueAnalyticsPropertyFilter | AccountCustomPropertyFilter | WorkflowVariablePropertyFilter)[] | null;/** Exclude recordings already viewed by the current user ('current-user'), by any team member ('any-user'), or none (default). Applied server-side so pagination and the result cursor operate on the filtered set. */