Skip to content

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

chore(access-control): remove legacy dashboard collaborator code (#117619)

Reece Jonesc9c27e2d6e2d
diff --git a/.agents/skills/managing-dashboards/SKILL.md b/.agents/skills/managing-dashboards/SKILL.md
index 3f21e8656519..8aa2bf319e8a 100644
--- a/.agents/skills/managing-dashboards/SKILL.md
+++ b/.agents/skills/managing-dashboards/SKILL.md
@@ -122,7 +122,7 @@ Run the focused tests for each edited layer. Then run the relevant checks from [
| ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| Dashboard API, serializers, tile operations, insight and widget runners | `products/dashboards/backend/api/dashboard.py` |
| Dashboard model and tile model | `products/dashboards/backend/models/dashboard.py`, `models/dashboard_tile.py` |
-| Sharing and collaborator routes | `products/dashboards/backend/routes.py` |
+| Sharing routes | `products/dashboards/backend/routes.py` |
| Templates | `products/dashboards/backend/api/dashboard_templates.py`, `models/dashboard_templates.py` |
| Main scene, state, refresh, and layout persistence | `frontend/src/scenes/dashboard/Dashboard.tsx`, `dashboardLogic.tsx`, `DashboardItems.tsx` |
| Layout geometry and tile size constraints | `frontend/src/scenes/dashboard/tileLayouts.ts`, `dashboardUtils.ts` |
diff --git a/.agents/skills/managing-dashboards/references/access-sharing-and-embeds.md b/.agents/skills/managing-dashboards/references/access-sharing-and-embeds.md
index 2880c3056ea8..428676e25300 100644
--- a/.agents/skills/managing-dashboards/references/access-sharing-and-embeds.md
+++ b/.agents/skills/managing-dashboards/references/access-sharing-and-embeds.md
@@ -5,8 +5,7 @@
Check both server and client behavior.
- The server is the authority for view, edit, create, delete, move, copy, and refresh actions.
-- `Dashboard.restriction_level` controls collaboration restrictions.
-- Collaborator access is an EE sub-route under `dashboards/<id>/collaborators`.
+- Dashboard edit access is governed by access controls (`UserAccessControl`).
- Dashboard sharing uses the core `SharingConfigurationViewSet` under `dashboards/<id>/sharing`.
- Public and embedded callers must not gain mutation rights through an endpoint that the UI hides.
- A related insight or widget can have stricter access than its dashboard. Preserve its access checks and safe error response.
@@ -44,11 +43,10 @@ When a dashboard becomes shared, check existing tiles before you publish the sta
## Minimum test matrix
-| Actor or surface | Read | Mutate | Refresh |
-| ---------------------- | ----------------------------------------- | ------------------------------------- | ------------------------------- |
-| Project viewer | Allowed only when resource access permits | Denied | Only if the endpoint permits it |
-| Project editor | Allowed | Allowed within dashboard restrictions | Allowed |
-| Dashboard collaborator | Follow assigned privilege | Follow assigned privilege | Follow assigned privilege |
-| Public shared viewer | Safe read-only payload | Denied | Denied |
-| Embedded viewer | Follow host and resource access | Denied unless explicitly supported | Must stay bounded |
-| Export renderer | Render-safe payload | Denied | Denied |
+| Actor or surface | Read | Mutate | Refresh |
+| -------------------- | ----------------------------------------- | ------------------------------------------- | ------------------------------- |
+| Project viewer | Allowed only when resource access permits | Denied | Only if the endpoint permits it |
+| Project editor | Allowed | Allowed within the dashboard's access rules | Allowed |
+| Public shared viewer | Safe read-only payload | Denied | Denied |
+| Embedded viewer | Follow host and resource access | Denied unless explicitly supported | Must stay bounded |
+| Export renderer | Render-safe payload | Denied | Denied |
diff --git a/.agents/skills/managing-dashboards/references/surfaces-and-ownership.md b/.agents/skills/managing-dashboards/references/surfaces-and-ownership.md
index 233903ab32cb..412636c4d55c 100644
--- a/.agents/skills/managing-dashboards/references/surfaces-and-ownership.md
+++ b/.agents/skills/managing-dashboards/references/surfaces-and-ownership.md
@@ -2,7 +2,7 @@
## Start from the domain model
-- `Dashboard` owns project-scoped metadata, dashboard filters, variables, sharing state, restriction level, and tile relations.
+- `Dashboard` owns project-scoped metadata, dashboard filters, variables, sharing state, and tile relations.
- `DashboardTile` owns one tile relation and per-breakpoint layout JSON.
- A tile is exactly one insight, text card, button, or widget.
- `DashboardTemplate` stores a copyable dashboard definition. It is not a live dashboard.
diff --git a/.github/scripts/check-idor-model-coverage.py b/.github/scripts/check-idor-model-coverage.py
index c156d24ee70b..980a3a5720a3 100644
--- a/.github/scripts/check-idor-model-coverage.py
+++ b/.github/scripts/check-idor-model-coverage.py
@@ -376,7 +376,6 @@ def get_scoped_models() -> tuple[dict[str, set[str]], set[str], set[str], set[st
"ConversationCheckpoint", # via Conversation
"ConversationCheckpointBlob", # via ConversationCheckpoint
"ConversationCheckpointWrite", # via ConversationCheckpoint
- "DashboardPrivilege", # via Dashboard
"Element", # via Event/ElementGroup
"ErrorTrackingExternalReference", # via ErrorTrackingIssue
"ErrorTrackingIssueCohort", # via ErrorTrackingIssue
diff --git a/.semgrep/rules/security/idor-team-scoped-models.yaml b/.semgrep/rules/security/idor-team-scoped-models.yaml
index fc2a66d7562d..4b89785d9fca 100644
--- a/.semgrep/rules/security/idor-team-scoped-models.yaml
+++ b/.semgrep/rules/security/idor-team-scoped-models.yaml
@@ -1496,7 +1496,6 @@ rules:
(?x)(
AccountAuditCredential
|CommunitySkillVote
- |DashboardPrivilege
|GitHubInstallRequest
|PersonalAPIKey
|ScoreDefinitionVersion
@@ -1554,7 +1553,6 @@ rules:
(?x)(
AccountAuditCredential
|CommunitySkillVote
- |DashboardPrivilege
|GitHubInstallRequest
|PersonalAPIKey
|ScoreDefinitionVersion
diff --git a/ee/api/test/test_insight.py b/ee/api/test/test_insight.py
index 662917386daf..c640b143798c 100644
--- a/ee/api/test/test_insight.py
+++ b/ee/api/test/test_insight.py
@@ -3,7 +3,6 @@ from datetime import timedelta
from typing import Optional, cast
import time_machine
-from posthog.test.base import FuzzyInt, snapshot_postgres_queries
from django.test import override_settings
@@ -12,7 +11,6 @@ from rest_framework import status
from posthog.api.test.dashboards import DashboardAPI
from posthog.constants import AvailableFeature
from posthog.models import OrganizationMembership, User
-from posthog.test.db_context_capturing import capture_db_queries
from products.access_control.backend.models.access_control import AccessControl
from products.dashboards.backend.models.dashboard import Dashboard
@@ -20,7 +18,6 @@ from products.dashboards.backend.models.dashboard_tile import DashboardTile
from products.product_analytics.backend.facade.models import Insight
from ee.api.test.base import APILicensedTest
-from ee.models import DashboardPrivilege
class TestInsightEnterpriseAPI(APILicensedTest):
@@ -148,14 +145,6 @@ class TestInsightEnterpriseAPI(APILicensedTest):
self.assertEqual(response_data["name"], "insight new name")
self.assertEqual(sorted(response_data["tags"]), sorted(["add", "these", "tags"]))
self.assertEqual(response_data["created_by"]["distinct_id"], self.user.distinct_id)
- self.assertEqual(
- response_data["effective_restriction_level"],
- Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT,
- )
- self.assertEqual(
- response_data["effective_privilege_level"],
- Dashboard.PrivilegeLevel.CAN_EDIT,
- )
response = self.client.get(f"/api/projects/{self.team.id}/insights/{insight_id}")
@@ -210,96 +199,33 @@ class TestInsightEnterpriseAPI(APILicensedTest):
],
)
- def test_non_admin_user_with_privilege_can_add_an_insight_to_a_restricted_dashboard(
- self,
- ) -> None:
- self._require_access_control()
- # create insight and dashboard separately with default user
- dashboard_restricted: Dashboard = Dashboard.objects.create(
- team=self.team,
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
-
- insight_id, response_data = self.dashboard_api.create_insight(data={"name": "starts un-restricted dashboard"})
-
- user_with_permissions = User.objects.create_and_join(
- organization=self.organization,
- password=None,
- )
-
- DashboardPrivilege.objects.create(
- dashboard=dashboard_restricted,
- user=user_with_permissions,
- level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
-
- self.client.force_login(user_with_permissions)
-
- response = self.client.patch(
- f"/api/projects/{self.team.id}/insights/{insight_id}",
- {"dashboards": [dashboard_restricted.id]},
- )
- assert response.status_code == status.HTTP_200_OK
-
- def test_an_insight_on_both_restricted_dashboard_does_not_restrict_with_explicit_privilege(
- self,
- ) -> None:
- self._require_access_control()
- dashboard_restricted: Dashboard = Dashboard.objects.create(
- team=self.team,
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
-
- DashboardPrivilege.objects.create(
- dashboard=dashboard_restricted,
- user=self.user,
- level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
-
- _, response_data = self.dashboard_api.create_insight(
- data={
- "name": "on a restricted and unrestricted dashboard",
- "dashboards": [dashboard_restricted.pk],
- }
- )
- self.assertEqual(
- response_data["effective_restriction_level"],
- Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
- self.assertEqual(
- response_data["effective_privilege_level"],
- Dashboard.PrivilegeLevel.CAN_EDIT,
- )
-
- def test_cannot_update_restricted_insight_as_other_user_who_is_project_member(self):
+ def test_cannot_update_an_insight_the_caller_can_only_view(self):
self._require_access_control()
self._set_project_default_member_access()
- creator = User.objects.create_and_join(self.organization, "[email protected]", None)
self.organization_membership.level = OrganizationMembership.Level.MEMBER
self.organization_membership.save()
- original_name = "Edit-restricted dashboard"
- dashboard: Dashboard = Dashboard.objects.create(
+
+ # The caller is not the creator, so the creator bypass does not grant edit access.
+ insight: Insight = Insight.objects.create(team=self.team, name="XYZ", created_by=None)
+ AccessControl.objects.create(
team=self.team,
- name=original_name,
- created_by=creator,
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
+ resource="insight",
+ resource_id=str(insight.id),
+ access_level="viewer",
+ organization_member=self.organization_membership,
+ role=None,
)
- insight: Insight = Insight.objects.create(team=self.team, name="XYZ", created_by=self.user)
- DashboardTile.objects.create(dashboard=dashboard, insight=insight)
response = self.client.patch(f"/api/projects/{self.team.id}/insights/{insight.id}", {"name": "ABC"})
response_data = response.json()
- dashboard.refresh_from_db()
+ insight.refresh_from_db()
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
self.assertEqual(
response_data,
- self.permission_denied_response(
- "This insight is on a dashboard that can only be edited by its owner, team members invited to editing the dashboard, and project admins."
- ),
+ self.permission_denied_response("You do not have editor access to this resource."),
)
- self.assertEqual(dashboard.name, original_name)
+ self.assertEqual(insight.name, "XYZ")
def test_event_definition_no_duplicate_tags(self):
from ee.models.license import License, LicenseManager
@@ -348,48 +274,29 @@ class TestInsightEnterpriseAPI(APILicensedTest):
insight_four_id,
]
- def test_cannot_update_an_insight_if_on_restricted_dashboard(self) -> None:
- self._require_access_control()
- self._set_project_default_member_access()
- dashboard_restricted: Dashboard = Dashboard.objects.create(
- team=self.team,
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
-
- # Attach via ORM: the create API now blocks attaching to a dashboard the user can't edit,
- # and this test is about the resulting edit restriction, not the attach permission.
- insight: Insight = Insight.objects.create(
- team=self.team, name="on a restricted and unrestricted dashboard", created_by=self.user
- )
- DashboardTile.objects.create(dashboard=dashboard_restricted, insight=insight)
-
- response = self.client.patch(
- f"/api/projects/{self.team.id}/insights/{insight.id}",
- {"name": "changing when restricted"},
- )
- self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
-
def test_non_admin_user_cannot_add_an_insight_to_a_restricted_dashboard(
self,
) -> None:
self._require_access_control()
self._set_project_default_member_access()
- # create insight and dashboard separately with default user
- dashboard_restricted = Dashboard.objects.create(
- team=self.team,
- created_by=self.user,
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
+ dashboard_restricted = Dashboard.objects.create(team=self.team, created_by=self.user)
dashboard_restricted_id = dashboard_restricted.id
insight_id, response_data = self.dashboard_api.create_insight(data={"name": "starts un-restricted dashboard"})
- # user with no permissions on the dashboard cannot add insight to it
+ # a member explicitly denied dashboard access cannot add an insight to it
user_without_permissions = User.objects.create_and_join(
organization=self.organization,
password=None,
)
+ AccessControl.objects.create(
+ team=self.team,
+ resource="dashboard",
+ resource_id=str(dashboard_restricted_id),
+ access_level="none",
+ organization_member=user_without_permissions.organization_memberships.first(),
+ )
self.client.force_login(user_without_permissions)
response = self.client.patch(
@@ -411,11 +318,7 @@ class TestInsightEnterpriseAPI(APILicensedTest):
) -> None:
self._require_access_control()
self._set_project_default_member_access()
- dashboard_restricted = Dashboard.objects.create(
- team=self.team,
- created_by=self.user,
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
+ dashboard_restricted = Dashboard.objects.create(team=self.team, created_by=self.user)
dashboard_restricted_id = dashboard_restricted.id
user_without_permissions = User.objects.create_and_join(
@@ -423,6 +326,13 @@ class TestInsightEnterpriseAPI(APILicensedTest):
password=None,
)
+ AccessControl.objects.create(
+ team=self.team,
+ resource="dashboard",
+ resource_id=str(dashboard_restricted_id),
+ access_level="none",
+ organization_member=user_without_permissions.organization_memberships.first(),
+ )
self.client.force_login(user_without_permissions)
self.dashboard_api.create_insight(
@@ -433,208 +343,13 @@ class TestInsightEnterpriseAPI(APILicensedTest):
# the rejected request must not leave an orphaned insight behind
assert not Insight.objects.filter(created_by=user_without_permissions).exists()
- def test_admin_user_can_create_an_insight_on_a_restricted_dashboard(self) -> None:
- self._require_access_control()
- self._set_project_default_member_access()
- dashboard_restricted = Dashboard.objects.create(
- team=self.team,
- created_by=self.user,
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
- dashboard_restricted_id = dashboard_restricted.id
-
- self.client.force_login(self.user)
- self.dashboard_api.create_insight(
- data={"name": "allowed on create", "dashboards": [dashboard_restricted_id]},
- )
- assert DashboardTile.objects.filter(dashboard_id=dashboard_restricted_id).exists()
-
- def test_admin_user_can_add_an_insight_to_a_restricted_dashboard(self) -> None:
- self._require_access_control()
- # create insight and dashboard separately with default user
- dashboard_restricted: Dashboard = Dashboard.objects.create(
- team=self.team,
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
-
- insight_id, response_data = self.dashboard_api.create_insight(data={"name": "starts un-restricted dashboard"})
-
- # an admin user has implicit permissions on the dashboard and can add the insight to it
- admin = User.objects.create_and_join(
- organization=self.organization,
- password=None,
- level=OrganizationMembership.Level.ADMIN,
- )
- self.client.force_login(admin)
-
- response = self.client.patch(
- f"/api/projects/{self.team.id}/insights/{insight_id}",
- {"dashboards": [dashboard_restricted.id]},
- )
- assert response.status_code == status.HTTP_200_OK
-
- def test_an_insight_on_no_dashboard_has_no_restrictions(self) -> None:
- _, response_data = self.dashboard_api.create_insight(data={"name": "not on a dashboard"})
- self.assertEqual(
- response_data["effective_restriction_level"],
- Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT,
- )
- self.assertEqual(
- response_data["effective_privilege_level"],
- Dashboard.PrivilegeLevel.CAN_EDIT,
- )
-
- def test_an_insight_on_unrestricted_dashboard_has_no_restrictions(self) -> None:
- dashboard: Dashboard = Dashboard.objects.create(team=self.team)
- _, response_data = self.dashboard_api.create_insight(
- data={"name": "on an unrestricted dashboard", "dashboards": [dashboard.pk]}
- )
- self.assertEqual(
- response_data["effective_restriction_level"],
- Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT,
- )
- self.assertEqual(
- response_data["effective_privilege_level"],
- Dashboard.PrivilegeLevel.CAN_EDIT,
- )
-
- def test_an_insight_on_restricted_dashboard_has_restrictions_cannot_edit_without_explicit_privilege(
- self,
- ) -> None:
- self._require_access_control()
- self._set_project_default_member_access()
- dashboard: Dashboard = Dashboard.objects.create(
- team=self.team,
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
- # Attach via ORM: the create API now blocks attaching to a dashboard the user can't edit,
- # and this test is about the inherited restriction, not the attach permission.
- insight: Insight = Insight.objects.create(
- team=self.team, name="on a restricted dashboard", created_by=self.user
- )
- DashboardTile.objects.create(dashboard=dashboard, insight=insight)
-
- response_data = self.client.get(f"/api/projects/{self.team.id}/insights/{insight.id}").json()
- self.assertEqual(
- response_data["effective_restriction_level"],
- Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
- self.assertEqual(
- response_data["effective_privilege_level"],
- Dashboard.PrivilegeLevel.CAN_VIEW,
- )
-
- def test_an_insight_on_both_restricted_and_unrestricted_dashboard_has_no_restrictions(
- self,
- ) -> None:
- self._require_access_control()
- dashboard_restricted: Dashboard = Dashboard.objects.create(
- team=self.team,
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
- dashboard_unrestricted: Dashboard = Dashboard.objects.create(
- team=self.team,
- restriction_level=Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT,
- )
- _, response_data = self.dashboard_api.create_insight(
- data={
- "name": "on a restricted and unrestricted dashboard",
- "dashboards": [dashboard_restricted.pk, dashboard_unrestricted.pk],
- }
- )
- self.assertEqual(
- response_data["effective_restriction_level"],
- Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
- self.assertEqual(
- response_data["effective_privilege_level"],
- Dashboard.PrivilegeLevel.CAN_EDIT,
- )
-
- def test_an_insight_on_restricted_dashboard_does_not_restrict_admin(self) -> None:
- self._require_access_control()
- dashboard_restricted: Dashboard = Dashboard.objects.create(
- team=self.team,
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
-
- admin = User.objects.create_and_join(
- organization=self.organization,
- password=None,
- level=OrganizationMembership.Level.ADMIN,
- )
- self.client.force_login(admin)
- _, response_data = self.dashboard_api.create_insight(
- data={
- "name": "on a restricted and unrestricted dashboard",
- "dashboards": [dashboard_restricted.pk],
- }
- )
- self.assertEqual(
- response_data["effective_restriction_level"],
- Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
- self.assertEqual(
- response_data["effective_privilege_level"],
- Dashboard.PrivilegeLevel.CAN_EDIT,
- )
-
- # :KLUDGE: avoid making extra queries that are explicitly not cached in tests. Avoids false N+1-s.
- @override_settings(PERSON_ON_EVENTS_OVERRIDE=False, PERSON_ON_EVENTS_V2_OVERRIDE=False)
- @snapshot_postgres_queries
- def test_listing_insights_does_not_nplus1(self) -> None:
- query_counts: list[int] = []
- queries = []
-
- for i in range(5):
- user = User.objects.create(email=f"testuser{i}@posthog.com")
- OrganizationMembership.objects.create(user=user, organization=self.organization)
- dashboard = Dashboard.objects.create(name=f"Dashboard {i}", team=self.team)
-
- self.dashboard_api.create_insight(
- data={
- "short_id": f"insight{i}",
- "dashboards": [dashboard.pk],
- }
- )
-
- self.assertEqual(Insight.objects.count(), i + 1)
-
- with capture_db_queries() as capture_query_context:
- response = self.client.get(f"/api/projects/{self.team.id}/insights?basic=true")
- self.assertEqual(response.status_code, status.HTTP_200_OK)
- self.assertEqual(len(response.json()["results"]), i + 1)
-
- query_count_for_create_and_read = len(capture_query_context.captured_queries)
- queries.append(capture_query_context.captured_queries)
- query_counts.append(query_count_for_create_and_read)
-
- # adding more insights doesn't change the query count
- self.assertEqual(
- [
- FuzzyInt(11, 12),
- FuzzyInt(11, 12),
- FuzzyInt(11, 12),
- FuzzyInt(11, 12),
- FuzzyInt(11, 12),
- ],
- query_counts,
- f"received query counts\n\n{query_counts}",
- )
-
def test_non_admin_user_cannot_remove_an_insight_from_a_restricted_dashboard(
self,
) -> None:
self._require_access_control()
self._set_project_default_member_access()
- # create a restricted dashboard with the default user (who has edit permission)
- dashboard_restricted = Dashboard.objects.create(
- team=self.team,
- created_by=self.user,
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
+ # create a dashboard the default user can edit
+ dashboard_restricted = Dashboard.objects.create(team=self.team, created_by=self.user)
dashboard_restricted_id = dashboard_restricted.id
# create an insight on that dashboard
@@ -642,12 +357,19 @@ class TestInsightEnterpriseAPI(APILicensedTest):
data={"name": "on restricted dashboard", "dashboards": [dashboard_restricted_id]}
)
- # user with no edit permissions on the dashboard cannot remove insight from it
+ # a member explicitly denied dashboard access cannot remove the insight from it
user_without_permissions = User.objects.create_and_join(
organization=self.organization,
password=None,
)
+ AccessControl.objects.create(
+ team=self.team,
+ resource="dashboard",
+ resource_id=str(dashboard_restricted_id),
+ access_level="none",
+ organization_member=user_without_permissions.organization_memberships.first(),
+ )
self.client.force_login(user_without_permissions)
# attempting to remove the insight from the dashboard should fail
diff --git a/ee/api/test/test_migrate_dashboard_collaborators.py b/ee/api/test/test_migrate_dashboard_collaborators.py
new file mode 100644
index 000000000000..3c2586d0ee70
--- /dev/null
+++ b/ee/api/test/test_migrate_dashboard_collaborators.py
@@ -0,0 +1,482 @@
+import uuid
+from collections.abc import Iterator
+from importlib import import_module
+from types import SimpleNamespace
+from typing import Any
+
+from posthog.test.base import APIBaseTest, NonAtomicBaseTestKeepIdentities
+from unittest.mock import patch
+
+from django.db import IntegrityError, connection, router
+from django.db.migrations.executor import MigrationExecutor
+
+from parameterized import parameterized
+
+from posthog.constants import AvailableFeature
+from posthog.models import OrganizationMembership, Team, User
+from posthog.rbac.migrations.rbac_dashboard_migration import rbac_dashboard_access_control_migration
+
+from products.access_control.backend.facade.user_access_control import DASHBOARD_EDIT_LIMIT_RESOURCE, UserAccessControl
+from products.access_control.backend.models.access_control import AccessControl
+from products.access_control.backend.models.role import Role, RoleMembership
+from products.dashboards.backend.models.dashboard import Dashboard
+from products.dashboards.backend.models.dashboard_tile import DashboardTile
+from products.product_analytics.backend.facade.models import Insight
+
+
+def _scalar(sql: str, params: list) -> object:
+ with connection.cursor() as cursor:
+ cursor.execute(sql, params)
+ row = cursor.fetchone()
+ return row[0] if row else None
+
+
+def _conversion_state() -> Any:
+ return MigrationExecutor(connection).loader.project_state([("ee", "0064_split_identity_provider_config_scopes")])
+
+
+class TestMigrateDashboardCollaborators(APIBaseTest):
+ def setUp(self) -> None:
+ super().setUp()
+ self.organization.available_product_features = [
+ {"key": feature, "name": feature}
+ for feature in (AvailableFeature.ACCESS_CONTROL, AvailableFeature.ROLE_BASED_ACCESS)
+ ]
+ self.organization.save()
+ AccessControl.objects.filter(team=self.team, resource="project").delete()
+ AccessControl.objects.create(
+ team=self.team, resource="project", resource_id=str(self.team.id), access_level="member"
+ )
+
+ def _set_legacy_restriction(self, dashboard: Dashboard, user: User, level: int = 37) -> None:
+ with connection.cursor() as cursor:
+ cursor.execute("UPDATE posthog_dashboard SET restriction_level = 37 WHERE id = %s", [dashboard.id])
+ cursor.execute(
+ "INSERT INTO ee_dashboardprivilege (id, dashboard_id, user_id, level, added_at, updated_at)"
+ " VALUES (%s, %s, %s, %s, now(), now())",
+ [str(uuid.uuid4()), dashboard.id, user.id, level],
+ )
+
+ def _run_migration(self) -> None:
+ rbac_dashboard_access_control_migration(_conversion_state().apps, SimpleNamespace(connection=connection))
+
+ @parameterized.expand(
+ [
+ (f"{name}_{mode}", privilege_level, rule_subject, rule_level, most_specific, expected)
+ for mode, most_specific in (("legacy", False), ("most_specific", True))
+ for name, privilege_level, rule_subject, rule_level, expected in (
+ ("viewer", 21, "resource", "editor", "viewer"),
+ ("editor", 37, "resource", "editor", "editor"),
+ ("non_collaborator", None, "resource", "editor", "viewer"),
+ ("member_grant", None, "member", "editor", "viewer"),
+ ("role_grant", None, "role", "editor", "viewer"),
+ ("collaborator_role_grant", 37, "role", "editor", "editor"),
+ ("collaborator_role_denial", 37, "role", "none", "none"),
+ ("resource_denial", 21, "resource", "none", "none"),
+ ("project_member_override", None, "project", "member", "viewer"),
+ ("project_admin_override", None, "project", "admin", "editor"),
+ )
+ ]
+ )
+ def test_preserves_effective_access(
+ self,
+ _name: str,
+ privilege_level: int | None,
+ rule_subject: str,
+ rule_level: str,
+ most_specific: bool,
+ expected: str,
+ ) -> None:
+ self.organization.uses_most_specific_access_resolution = most_specific
+ self.organization.save()
+ member = self._create_user("[email protected]", level=OrganizationMembership.Level.MEMBER)
+ membership = member.organization_memberships.get(organization=self.organization)
+ dashboard = Dashboard.objects.create(team=self.team, name="restricted", created_by=self.user)
+ self._set_legacy_restriction(dashboard, member, privilege_level or 21)
+ if privilege_level is None:
+ with connection.cursor() as cursor:
+ cursor.execute("DELETE FROM ee_dashboardprivilege WHERE dashboard_id = %s", [dashboard.id])
+ role = None
+ if rule_subject == "role":
+ role = Role.objects.create(organization=self.organization, name="Analysts")
+ RoleMembership.objects.create(role=role, user=member, organization_member=membership)
+ if rule_subject == "project":
+ AccessControl.objects.filter(team=self.team, resource="project").update(access_level="admin")
+ original_rule = AccessControl.objects.create(
+ team=self.team,
+ resource="project" if rule_subject == "project" else "dashboard",
+ resource_id=(
+ str(self.team.id)
+ if rule_subject == "project"
+ else None
+ if rule_subject == "resource"
+ else str(dashboard.id)
+ ),
+ organization_member=membership if rule_subject in ("member", "project") else None,
+ role=role,
+ access_level=rule_level,
+ )
+
+ self._run_migration()
+ first_rules = set(AccessControl.objects.filter(team=self.team).values_list("id", flat=True))
+ self._run_migration()
+
+ assert _scalar("SELECT restriction_level FROM posthog_dashboard WHERE id = %s", [dashboard.id]) == 37
+ assert _scalar("SELECT count(*) FROM ee_dashboardprivilege WHERE dashboard_id = %s", [dashboard.id]) == (
+ 0 if privilege_level is None else 1
+ )
+ assert (
+ _scalar("SELECT level FROM ee_dashboardprivilege WHERE dashboard_id = %s", [dashboard.id])
+ == privilege_level
+ )
+ assert AccessControl.objects.filter(id=original_rule.id, access_level=rule_level).exists()
+ assert UserAccessControl(member, team=self.team).get_user_access_level(dashboard) == expected
+ assert first_rules == set(AccessControl.objects.filter(team=self.team).values_list("id", flat=True))
+ newcomer = self._create_user("[email protected]", level=OrganizationMembership.Level.MEMBER)
+ newcomer_level = UserAccessControl(newcomer, team=self.team).get_user_access_level(dashboard)
+ assert newcomer_level == (
+ "editor"
+ if rule_subject == "project"
+ else "none"
+ if rule_subject == "resource" and rule_level == "none"
+ else "viewer"
+ )
+
+ @parameterized.expand([("legacy", False), ("most_specific", True)])
+ def test_private_defaults_still_deny_new_members(self, _name: str, most_specific: bool) -> None:
+ self.organization.uses_most_specific_access_resolution = most_specific
+ self.organization.save()
+ dashboard = Dashboard.objects.create(team=self.team, created_by=self.user)
+ self._set_legacy_restriction(dashboard, self.user)
+ denial = AccessControl.objects.create(
+ team=self.team, resource="dashboard", resource_id=str(dashboard.id), access_level="none"
+ )
+
+ self._run_migration()
+ newcomer = self._create_user("[email protected]", level=OrganizationMembership.Level.MEMBER)
+
+ assert UserAccessControl(newcomer, team=self.team).get_user_access_level(dashboard) == "none"
+ denial.refresh_from_db()
+ assert denial.access_level == "none"
+
+ @parameterized.expand(
+ [
+ (f"{mode}_{scope}", most_specific, scope)
+ for mode, most_specific in (("legacy", False), ("most_specific", True))
+ for scope in ("object", "resource")
+ ]
+ )
+ def test_role_grants_remain_revocable(self, _name: str, most_specific: bool, scope: str) -> None:
+ self.organization.uses_most_specific_access_resolution = most_specific
+ self.organization.save()
+ member = self._create_user("[email protected]", level=OrganizationMembership.Level.MEMBER)
+ membership = member.organization_memberships.get(organization=self.organization)
+ dashboard = Dashboard.objects.create(team=self.team, created_by=self.user)
+ self._set_legacy_restriction(dashboard, member)
+ role = Role.objects.create(organization=self.organization, name="Analysts")
+ role_membership = RoleMembership.objects.create(role=role, user=member, organization_member=membership)
+ resource_id = str(dashboard.id) if scope == "object" else None
+ AccessControl.objects.create(team=self.team, resource="dashboard", resource_id=resource_id, access_level="none")
+ grant = AccessControl.objects.create(
+ team=self.team, resource="dashboard", resource_id=resource_id, access_level="editor", role=role
+ )
+
+ self._run_migration()
+ assert UserAccessControl(member, team=self.team).get_user_access_level(dashboard) == "editor"
+ role_membership.delete()
+
+ assert UserAccessControl(member, team=self.team).get_user_access_level(dashboard) == "none"
+ assert AccessControl.objects.filter(id=grant.id, role=role).exists()
+ assert not AccessControl.objects.filter(
+ team=self.team, resource="dashboard", organization_member=membership
+ ).exists()
+
+ @parameterized.expand(
+ [("dashboard", "invalid", "viewer"), ("dashboard", "", "viewer"), ("project", "invalid", "none")]
+ )
+ def test_repairs_invalid_access_levels(self, resource: str, invalid: str, expected: str) -> None:
+ member = self._create_user("[email protected]", level=OrganizationMembership.Level.MEMBER)
+ dashboard = Dashboard.objects.create(team=self.team, created_by=self.user)
+ self._set_legacy_restriction(dashboard, member)
+ if resource == "project":
+ rule = AccessControl.objects.get(team=self.team, resource="project", resource_id=str(self.team.id))
+ rule.access_level = invalid
+ rule.save(update_fields=["access_level"])
+ else:
+ rule = AccessControl.objects.create(
+ team=self.team, resource="dashboard", resource_id=str(dashboard.id), access_level=invalid
+ )
+
+ self._run_migration()
+
+ rule.refresh_from_db()
+ assert rule.access_level == expected
+ assert UserAccessControl(member, team=self.team).get_user_access_level(dashboard) in ("viewer", "editor")
+
+ @parameterized.expand([("override", "editor", "editor"), ("remove", None, "viewer")])
+ def test_replacing_default_removes_the_migrated_limit(self, _name: str, level: str | None, expected: str) -> None:
+ self.organization.uses_most_specific_access_resolution = True
+ self.organization.save()
+ dashboard = Dashboard.objects.create(team=self.team, created_by=self.user)
+ self._set_legacy_restriction(dashboard, self.user)
+ AccessControl.objects.create(team=self.team, resource="dashboard", access_level="viewer")
+ AccessControl.objects.create(
+ team=self.team, resource="dashboard", resource_id=str(dashboard.id), access_level="viewer"
+ )
+ self._run_migration()
+ member = self._create_user("[email protected]", level=OrganizationMembership.Level.MEMBER)
+ assert UserAccessControl(member, team=self.team).get_user_access_level(dashboard) == "viewer"
+
+ admin = self._create_user("[email protected]", level=OrganizationMembership.Level.ADMIN)
+ self.client.force_login(admin)
+ response = self.client.put(
+ f"/api/projects/{self.team.id}/dashboards/{dashboard.id}/access_controls/",
+ {"access_level": level},
+ format="json",
+ )
+ assert response.status_code == (204 if level is None else 200), response.data
+ self._run_migration()
+ newcomer = self._create_user("[email protected]", level=OrganizationMembership.Level.MEMBER)
+ access = UserAccessControl(newcomer, team=self.team)
+
+ assert access.get_user_access_level(dashboard) == expected
+ assert not access.has_object_access_limit("dashboard", str(dashboard.id))
+
+ @parameterized.expand([("member", False), ("member", True), ("role", False), ("role", True)])
+ def test_explicit_subject_grants_replace_the_migrated_limit(self, subject: str, most_specific: bool) -> None:
+ self.organization.uses_most_specific_access_resolution = most_specific
+ self.organization.save()
+ member = self._create_user("[email protected]", level=OrganizationMembership.Level.MEMBER)
+ membership = member.organization_memberships.get(organization=self.organization)
+ dashboard = Dashboard.objects.create(team=self.team, created_by=self.user)
+ self._set_legacy_restriction(dashboard, member, 21)
+ AccessControl.objects.create(
+ team=self.team, resource="dashboard", resource_id=str(dashboard.id), access_level="none"
+ )
+ self._run_migration()
+ payload: dict[str, str | None] = {"access_level": "editor", "organization_member": str(membership.id)}
+ role_membership = None
+ if subject == "role":
+ role = Role.objects.create(organization=self.organization, name="Editors")
+ role_membership = RoleMembership.objects.create(role=role, user=member, organization_member=membership)
+ payload = {"access_level": "editor", "role": str(role.id)}
+ admin = self._create_user("[email protected]", level=OrganizationMembership.Level.ADMIN)
+ self.client.force_login(admin)
+
+ response = self.client.put(
+ f"/api/projects/{self.team.id}/dashboards/{dashboard.id}/access_controls/", payload, format="json"
+ )
+ assert response.status_code == 200, response.data
+ assert UserAccessControl(member, team=self.team).get_user_access_level(dashboard) == "editor"
+ if role_membership is not None:
+ role_membership.delete()
+ else:
+ payload["access_level"] = None
+ response = self.client.put(
+ f"/api/projects/{self.team.id}/dashboards/{dashboard.id}/access_controls/", payload, format="json"
+ )
+ assert response.status_code == 204, response.data
+ assert UserAccessControl(member, team=self.team).get_user_access_level(dashboard) == "none"
+
+ def test_edit_limit_lookup_indexes_rows_once(self) -> None:
+ member = self._create_user("[email protected]", level=OrganizationMembership.Level.MEMBER)
+ dashboard = Dashboard.objects.create(team=self.team, created_by=self.user)
+ self._set_legacy_restriction(dashboard, member, 21)
+ self._run_migration()
+
+ class CountedRows(list[AccessControl]):
+ iterations = 0
+
+ def __iter__(self) -> Iterator[AccessControl]:
+ self.iterations += 1
+ return super().__iter__()
+
+ rows = CountedRows(AccessControl.objects.filter(team=self.team))
+ access = UserAccessControl(member, team=self.team)
+ access.__dict__["_cached_access_controls"] = rows
+ for _ in range(20):
+ assert access.has_object_access_limit("dashboard", str(dashboard.id))
+ assert not access.has_object_access_limit("dashboard", "unrestricted")
+ assert rows.iterations == 1
+
+ admin_rows = CountedRows(rows)
+ admin = self._create_user("[email protected]", level=OrganizationMembership.Level.ADMIN)
+ admin_access = UserAccessControl(admin, team=self.team)
+ admin_access.__dict__["_cached_access_controls"] = admin_rows
+ assert not admin_access.has_object_access_limit("dashboard", str(dashboard.id))
+ assert admin_rows.iterations == 0
+
+ def test_ignores_restrictions_without_the_entitlement(self) -> None:
+ self.organization.available_product_features = []
+ self.organization.save()
+ member = self._create_user("[email protected]", level=OrganizationMembership.Level.MEMBER)
+ dashboard = Dashboard.objects.create(team=self.team, name="restricted", created_by=self.user)
+ self._set_legacy_restriction(dashboard, member, 21)
+
+ self._run_migration()
+
+ assert UserAccessControl(member, team=self.team).get_user_access_level(dashboard) == "editor"
+
+ def test_skips_collaborators_without_an_organization_membership(self) -> None:
+ outsider = User.objects.create_user(email="[email protected]", first_name="", password=None)
+ dashboard = Dashboard.objects.create(team=self.team, name="restricted")
+ self._set_legacy_restriction(dashboard, outsider)
+
+ self._run_migration()
+
+ assert _scalar("SELECT restriction_level FROM posthog_dashboard WHERE id = %s", [dashboard.id]) == 37
+ assert not AccessControl.objects.filter(
+ resource="dashboard", resource_id=str(dashboard.id), organization_member__user=outsider
+ ).exists()
+ assert _scalar("SELECT count(*) FROM ee_dashboardprivilege WHERE dashboard_id = %s", [dashboard.id]) == 1
+
+ def test_leaves_unrestricted_dashboards_alone(self) -> None:
+ dashboard = Dashboard.objects.create(team=self.team, name="open")
+
+ self._run_migration()
+
+ assert not AccessControl.objects.filter(resource="dashboard", resource_id=str(dashboard.id)).exists()
+
+ def test_all_migration_queries_use_the_schema_editors_connection(self) -> None:
+ dashboard = Dashboard.objects.create(team=self.team, name="restricted")
+ self._set_legacy_restriction(dashboard, self.user)
+
+ with (
+ patch.object(router, "db_for_read", side_effect=AssertionError("Unbound migration read")),
+ patch.object(router, "db_for_write", side_effect=AssertionError("Unbound migration write")),
+ ):
+ self._run_migration()
+
+ assert AccessControl.objects.filter(
+ team=self.team, resource=DASHBOARD_EDIT_LIMIT_RESOURCE, resource_id=str(dashboard.id)
+ ).exists()
+
+ @parameterized.expand([("own_team", False), ("sibling_team", True)])
+ def test_migrated_access_gates_dashboard_sharing_and_insight_edits(self, _name: str, sibling: bool) -> None:
+ member = self._create_user("[email protected]", level=OrganizationMembership.Level.MEMBER)
+ dashboard = Dashboard.objects.create(team=self.team, name="restricted", created_by=self.user)
+ self._set_legacy_restriction(dashboard, member, 21)
+ insight = Insight.objects.create(team=self.team, name="chart", created_by=member)
+ restricted_tile = DashboardTile.objects.create(dashboard=dashboard, insight=insight)
+ open_dashboard = Dashboard.objects.create(team=self.team, name="open", created_by=self.user)
+ removed_tile = DashboardTile.objects.create(dashboard=open_dashboard, insight=insight, deleted=True)
+ self._run_migration()
+ request_team = (
+ Team.objects.create(organization=self.organization, project=self.team.project) if sibling else self.team
+ )
+ self.client.force_login(member)
+
+ assert self.client.get(f"/api/projects/{request_team.id}/dashboards/{dashboard.id}/").status_code == 200
+ assert (
+ self.client.patch(
+ f"/api/projects/{request_team.id}/dashboards/{dashboard.id}/", {"name": "changed"}
+ ).status_code
+ == 403
+ )
+ assert (
+ self.client.patch(
+ f"/api/projects/{request_team.id}/dashboards/{dashboard.id}/sharing/", {"enabled": True}
+ ).status_code
+ == 403
+ )
+ assert (
+ self.client.patch(f"/api/projects/{request_team.id}/insights/{insight.id}/", {"deleted": True}).status_code
+ == 403
+ )
+ response = self.client.post(
+ f"/api/projects/{request_team.id}/insights/bulk_delete/", {"ids": [insight.id]}, format="json"
+ )
+ assert response.status_code == 200
+ assert response.json()["deleted"] == []
+ response = self.client.post(
+ f"/api/projects/{request_team.id}/insights/bulk_update_tags/",
+ {"ids": [insight.id], "action": "add", "tags": ["reviewed"]},
+ format="json",
+ )
+ assert response.status_code == 403
+ insight.refresh_from_db()
+ assert not insight.deleted
+ dashboard.refresh_from_db()
+ assert dashboard.name == "restricted"
+ removed_tile.deleted = False
+ removed_tile.save(update_fields=["deleted"])
+ assert (
+ self.client.patch(
+ f"/api/projects/{request_team.id}/insights/{insight.id}/", {"name": "changed"}
+ ).status_code
+ == 200
+ )
+
+ response = self.client.post(
+ f"/api/projects/{request_team.id}/insights/bulk_delete/", {"ids": [insight.id]}, format="json"
+ )
+ assert response.status_code == 200
+ assert [item["id"] for item in response.json()["deleted"]] == [insight.id]
+ response = self.client.post(
+ f"/api/projects/{request_team.id}/insights/bulk_restore/", {"ids": [insight.id]}, format="json"
+ )
+ assert response.status_code == 200
+ assert [item["id"] for item in response.json()["restored"]] == [insight.id]
+ restricted_tile.refresh_from_db()
+ removed_tile.refresh_from_db()
+ assert restricted_tile.deleted is True
+ assert removed_tile.deleted is False
+
+ response = self.client.patch(
+ f"/api/projects/{request_team.id}/insights/{insight.id}/", {"dashboards": []}, format="json"
+ )
+ assert response.status_code == 200
+ assert not DashboardTile.objects.filter(insight=insight).exists()
+ assert (
+ self.client.patch(
+ f"/api/projects/{request_team.id}/insights/{insight.id}/", {"name": "unauthorized"}
+ ).status_code
+ == 403
+ )
+ response = self.client.post(
+ f"/api/projects/{request_team.id}/insights/bulk_delete/", {"ids": [insight.id]}, format="json"
+ )
+ assert response.status_code == 200
+ assert response.json()["deleted"] == []
+ self.client.force_login(self.user)
+ assert (
+ self.client.patch(
+ f"/api/projects/{request_team.id}/insights/{insight.id}/", {"name": "authorized"}
+ ).status_code
+ == 200
+ )
+
+
+class TestDashboardConversionTransactions(NonAtomicBaseTestKeepIdentities):
+ def test_failed_dashboard_rolls_back_without_undoing_completed_dashboards(self) -> None:
+ self.organization.available_product_features = [{"key": AvailableFeature.ACCESS_CONTROL}]
+ self.organization.save()
+ first = Dashboard.objects.create(team=self.team, name="first")
+ second = Dashboard.objects.create(team=self.team, name="second")
+ with connection.cursor() as cursor:
+ cursor.execute(
+ "UPDATE posthog_dashboard SET restriction_level = 37 WHERE id IN (%s, %s)", [first.id, second.id]
+ )
+
+ def fail_second_dashboard(execute: Any, sql: str, params: Any, many: bool, context: Any) -> Any:
+ if (
+ sql.startswith('INSERT INTO "ee_accesscontrol"')
+ and DASHBOARD_EDIT_LIMIT_RESOURCE in params
+ and str(second.id) in params
+ ):
+ raise IntegrityError("Interrupted dashboard conversion")
+ return execute(sql, params, many, context)
+
+ migration = import_module("ee.migrations.0065_migrate_dashboard_collaborators").Migration("0065", "ee")
+ with self.assertRaisesMessage(IntegrityError, "Interrupted dashboard conversion"):
+ with connection.execute_wrapper(fail_second_dashboard), connection.schema_editor(atomic=False) as editor:
+ migration.apply(_conversion_state(), editor)
+
+ assert _scalar("SELECT restriction_level FROM posthog_dashboard WHERE id = %s", [first.id]) == 37
+ assert _scalar("SELECT restriction_level FROM posthog_dashboard WHERE id = %s", [second.id]) == 37
+ assert AccessControl.objects.filter(
+ team=self.team, resource=DASHBOARD_EDIT_LIMIT_RESOURCE, resource_id=str(first.id)
+ ).exists()
+ assert not AccessControl.objects.filter(
+ team=self.team, resource=DASHBOARD_EDIT_LIMIT_RESOURCE, resource_id=str(second.id)
+ ).exists()
diff --git a/ee/hogai/tools/upsert_dashboard/test/test_tool.py b/ee/hogai/tools/upsert_dashboard/test/test_tool.py
index 95b8a186efa9..8c9723d5af24 100644
--- a/ee/hogai/tools/upsert_dashboard/test/test_tool.py
+++ b/ee/hogai/tools/upsert_dashboard/test/test_tool.py
@@ -347,7 +347,6 @@ class TestUpsertDashboardTool(BaseTest):
team=self.team,
name="Restricted Dashboard",
created_by=self.user,
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
)
new_insight = await self._create_insight("New Insight")
@@ -375,7 +374,6 @@ class TestUpsertDashboardTool(BaseTest):
team=self.team,
name="Unrestricted Dashboard",
created_by=self.user,
- restriction_level=Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT,
)
new_insight = await self._create_insight("New Insight")
diff --git a/ee/migrations/0065_migrate_dashboard_collaborators.py b/ee/migrations/0065_migrate_dashboard_collaborators.py
new file mode 100644
index 000000000000..15609f2be5fc
--- /dev/null
+++ b/ee/migrations/0065_migrate_dashboard_collaborators.py
@@ -0,0 +1,21 @@
+from django.db import migrations
+
+from posthog.rbac.migrations.rbac_dashboard_migration import rbac_dashboard_access_control_migration
+
+
+class Migration(migrations.Migration):
+ atomic = False
+
+ dependencies = [
+ ("ee", "0064_split_identity_provider_config_scopes"),
+ ]
+
+ operations = [
+ # Convert legacy collaborator permissions before the next migration removes
+ # DashboardPrivilege and its checks. Without this, an upgrade lets previously
+ # excluded members edit collaborator-restricted dashboards and enable sharing.
+ migrations.RunPython(
+ rbac_dashboard_access_control_migration,
+ reverse_code=migrations.RunPython.noop,
+ ),
+ ]
diff --git a/ee/migrations/0066_remove_dashboardprivilege.py b/ee/migrations/0066_remove_dashboardprivilege.py
new file mode 100644
index 000000000000..273736b0e2dc
--- /dev/null
+++ b/ee/migrations/0066_remove_dashboardprivilege.py
@@ -0,0 +1,23 @@
+from django.db import migrations
+
+from posthog.migration_helpers import DropForeignKey
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("ee", "0065_migrate_dashboard_collaborators"),
+ ]
+
+ operations = [
+ # The privilege table stays in Postgres so pods on the previous release keep reading it.
+ # Removing the model from state stops Django cascading into it, so its foreign keys must
+ # go in the same migration or a dashboard or user delete fails at COMMIT.
+ migrations.SeparateDatabaseAndState(
+ state_operations=[
+ migrations.DeleteModel(name="DashboardPrivilege"),
+ ],
+ database_operations=[
+ DropForeignKey("ee_dashboardprivilege", column=["dashboard_id", "user_id"]),
+ ],
+ ),
+ ]
diff --git a/ee/migrations/max_migration.txt b/ee/migrations/max_migration.txt
index fdea214cb3ab..0346250b1d43 100644
--- a/ee/migrations/max_migration.txt
+++ b/ee/migrations/max_migration.txt
@@ -1 +1 @@
-0064_split_identity_provider_config_scopes
+0066_remove_dashboardprivilege
diff --git a/ee/models/__init__.py b/ee/models/__init__.py
index 3d563b22d0fc..2ea8b15f1654 100644
--- a/ee/models/__init__.py
+++ b/ee/models/__init__.py
@@ -1,4 +1,3 @@
-from .dashboard_privilege import DashboardPrivilege
from .event_definition import EnterpriseEventDefinition
from .explicit_team_membership import ExplicitTeamMembership
from .license import License
@@ -7,7 +6,6 @@ from .scim_provisioned_user import SCIMProvisionedUser
from .scim_request_log import SCIMRequestLog
__all__ = [
- "DashboardPrivilege",
"EnterpriseEventDefinition",
"EnterprisePropertyDefinition",
"ExplicitTeamMembership",
diff --git a/ee/models/dashboard_privilege.py b/ee/models/dashboard_privilege.py
deleted file mode 100644
index 6be84501532d..000000000000
--- a/ee/models/dashboard_privilege.py
+++ /dev/null
@@ -1,31 +0,0 @@
-from django.db import models
-
-from posthog.models.utils import UUIDTModel, sane_repr
-
-from products.dashboards.backend.models.dashboard import Dashboard
-
-
-# We call models that grant a user access to some resource (which isn't a grouping of users) a "privilege"
-class DashboardPrivilege(UUIDTModel):
- dashboard = models.ForeignKey(
- "dashboards.Dashboard",
- on_delete=models.CASCADE,
- related_name="privileges",
- related_query_name="privilege",
- )
- user = models.ForeignKey(
- "posthog.User",
- on_delete=models.CASCADE,
- related_name="explicit_dashboard_privileges",
- related_query_name="explicit_dashboard_privilege",
- )
- level = models.PositiveSmallIntegerField(choices=Dashboard.RestrictionLevel.choices)
- added_at = models.DateTimeField(auto_now_add=True)
- updated_at = models.DateTimeField(auto_now=True)
-
- class Meta:
- constraints = [
- models.UniqueConstraint(fields=["dashboard", "user"], name="unique_explicit_dashboard_privilege")
- ]
-
- __repr__ = sane_repr("dashboard", "user", "level")
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index 3f8076f4c945..319379bf5c22 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -99,29 +99,6 @@ export enum PluginsAccessLevel {
Root = 9,
}
-/** Collaboration restriction level (which is a dashboard setting). Sync with DashboardPrivilegeLevel. */
-export enum DashboardRestrictionLevel {
- EveryoneInProjectCanEdit = 21,
- OnlyCollaboratorsCanEdit = 37,
-}
-
-/** Collaboration privilege level (which is a user property). Sync with DashboardRestrictionLevel. */
-export enum DashboardPrivilegeLevel {
- CanView = 21,
- CanEdit = 37,
- /** This is not a value that can be set in the DB – it's inferred. */
- _ProjectAdmin = 888,
- /** This is not a value that can be set in the DB – it's inferred. */
- _Owner = 999,
-}
-
-export const privilegeLevelToName: Record<DashboardPrivilegeLevel, string> = {
- [DashboardPrivilegeLevel.CanView]: 'can view',
- [DashboardPrivilegeLevel.CanEdit]: 'can edit',
- [DashboardPrivilegeLevel._Owner]: 'owner',
- [DashboardPrivilegeLevel._ProjectAdmin]: 'can edit',
-}
-
// Persons
export const PERSON_DISTINCT_ID_MAX_SIZE = 3
export const PERSON_DISPLAY_NAME_COLUMN_NAME = 'person_display_name -- Person'
diff --git a/frontend/src/scenes/terminal/posthogFilesystem.test.ts b/frontend/src/scenes/terminal/posthogFilesystem.test.ts
index eda9443f51cf..0d1d1fdf0e21 100644
--- a/frontend/src/scenes/terminal/posthogFilesystem.test.ts
+++ b/frontend/src/scenes/terminal/posthogFilesystem.test.ts
@@ -1008,7 +1008,6 @@ describe('PostHog filesystem projection', () => {
name: 'Original',
nested: { enabled: false },
readonly_field: 'from API',
- restriction_level: 0,
...(['experiment', 'feature_flag'].includes(type) ? { version: 7 } : {}),
}
jest.mocked(apiMutator).mockResolvedValue(original)
diff --git a/posthog/api/sharing.py b/posthog/api/sharing.py
index fe96fa3eab6e..565190b7d278 100644
--- a/posthog/api/sharing.py
+++ b/posthog/api/sharing.py
@@ -203,16 +203,6 @@ def _require_dashboard_access(
required_level: AccessControlLevel,
) -> None:
dashboard = cast(Dashboard, dashboard)
- # Legacy check: remove once all users are on the new access control. It restricts editing only, so
- # it must not gate a read.
- if (
- required_level == "editor"
- and dashboard.restriction_level > Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT
- ):
- if not view.user_permissions.dashboard(dashboard).can_edit:
- raise PermissionDenied("You don't have edit permissions for this dashboard.")
- return
-
access_level = user_access_control.get_user_access_level(dashboard)
if not access_level or not access_level_satisfied_for_resource("dashboard", access_level, required_level):
raise PermissionDenied(_denied_message("dashboard", required_level))
diff --git a/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr b/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr
index 3c0a702cf570..52f882c9dd99 100644
--- a/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr
+++ b/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr
@@ -216,163 +216,6 @@
'''
# ---
# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.101
- '''
- SELECT "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
- LIMIT 21
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.102
- '''
- SELECT 1 AS "a"
- FROM "posthog_sharingconfiguration"
- WHERE ("posthog_sharingconfiguration"."enabled"
- AND ("posthog_sharingconfiguration"."expires_at" IS NULL
- OR "posthog_sharingconfiguration"."expires_at" > 'SHARING-EXPIRY-TIMESTAMP'::timestamptz)
- AND "posthog_sharingconfiguration"."dashboard_id" = 99999
- AND "posthog_sharingconfiguration"."team_id" = 99999)
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.103
- '''
- SELECT "posthog_team"."id",
- "posthog_team"."uuid",
- "posthog_team"."organization_id",
- "posthog_team"."parent_team_id",
- "posthog_team"."project_id",
- "posthog_team"."api_token",
- "posthog_team"."app_urls",
- "posthog_team"."name",
- "posthog_team"."slack_incoming_webhook",
- "posthog_team"."created_at",
- "posthog_team"."updated_at",
- "posthog_team"."anonymize_ips",
- "posthog_team"."completed_snippet_onboarding",
- "posthog_team"."has_completed_onboarding_for",
- "posthog_team"."onboarding_tasks",
- "posthog_team"."ingested_event",
- "posthog_team"."ingested_production_event",
- "posthog_team"."ingested_production_event_last_checked_at",
- "posthog_team"."person_processing_opt_out",
- "posthog_team"."secret_api_token",
- "posthog_team"."secret_api_token_backup",
- "posthog_team"."session_recording_opt_in",
- "posthog_team"."session_recording_sample_rate",
- "posthog_team"."session_recording_minimum_duration_milliseconds",
- "posthog_team"."session_recording_linked_flag",
- "posthog_team"."session_recording_network_payload_capture_config",
- "posthog_team"."session_recording_masking_config",
- "posthog_team"."session_recording_url_trigger_config",
- "posthog_team"."session_recording_url_blocklist_config",
- "posthog_team"."session_recording_event_trigger_config",
- "posthog_team"."session_recording_trigger_match_type_config",
- "posthog_team"."session_recording_trigger_groups",
- "posthog_team"."session_replay_config",
- "posthog_team"."session_recording_retention_period",
- "posthog_team"."event_retention_months",
- "posthog_team"."conversations_enabled",
- "posthog_team"."conversations_settings",
- "posthog_team"."proactive_tasks_enabled",
- "posthog_team"."survey_config",
- "posthog_team"."surveys_opt_in",
- "posthog_team"."product_tours_opt_in",
- "posthog_team"."capture_console_log_opt_in",
- "posthog_team"."capture_performance_opt_in",
- "posthog_team"."capture_dead_clicks",
- "posthog_team"."autocapture_opt_out",
- "posthog_team"."autocapture_web_vitals_opt_in",
- "posthog_team"."autocapture_web_vitals_allowed_metrics",
- "posthog_team"."autocapture_exceptions_opt_in",
- "posthog_team"."autocapture_exceptions_errors_to_ignore",
- "posthog_team"."logs_settings",
- "posthog_team"."llm_gateway_enabled_at",
- "posthog_team"."llm_gateway_revoked_at",
- "posthog_team"."llm_gateway_overspend_allowance_usd",
- "posthog_team"."heatmaps_opt_in",
- "posthog_team"."receive_org_level_activity_logs",
- "posthog_team"."web_analytics_pre_aggregated_tables_enabled",
- "posthog_team"."web_analytics_pre_aggregated_tables_version",
- "posthog_team"."flags_persistence_default",
- "posthog_team"."feature_flag_confirmation_enabled",
- "posthog_team"."feature_flag_confirmation_message",
- "posthog_team"."default_evaluation_environments_enabled",
- "posthog_team"."require_evaluation_environment_tags",
- "posthog_team"."default_evaluation_contexts_enabled",
- "posthog_team"."require_evaluation_contexts",
- "posthog_team"."session_recording_version",
- "posthog_team"."signup_token",
- "posthog_team"."is_demo",
- "posthog_team"."access_control",
- "posthog_team"."week_start_day",
- "posthog_team"."inject_web_apps",
- "posthog_team"."test_account_filters",
- "posthog_team"."test_account_filters_default_checked",
- "posthog_team"."path_cleaning_filters",
- "posthog_team"."timezone",
- "posthog_team"."data_attributes",
- "posthog_team"."person_display_name_properties",
- "posthog_team"."live_events_columns",
- "posthog_team"."recording_domains",
- "posthog_team"."human_friendly_comparison_periods",
- "posthog_team"."cookieless_server_hash_mode",
- "posthog_team"."primary_dashboard_id",
- "posthog_team"."default_data_theme",
- "posthog_team"."extra_settings",
- "posthog_team"."modifiers",
- "posthog_team"."correlation_config",
- "posthog_team"."session_recording_retention_period_days",
- "posthog_team"."external_data_workspace_id",
- "posthog_team"."external_data_workspace_last_synced_at",
- "posthog_team"."api_query_rate_limit",
- "posthog_team"."drop_events_older_than",
- "posthog_team"."base_currency",
- "posthog_team"."business_model"
- FROM "posthog_team"
- WHERE "posthog_team"."id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.104
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -397,7 +240,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.105
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.102
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -415,7 +258,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.106
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.103
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -444,7 +287,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.107
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.104
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -473,7 +316,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.108
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.105
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -493,7 +336,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.109
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.106
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -506,19 +349,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.11
- '''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."dashboard_id" = 99999
- AND NOT ("posthog_dashboardtile"."insight_id" IS NULL))
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.110
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.107
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -534,7 +365,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.111
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.108
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -551,51 +382,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.112
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.113
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.114
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.109
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -604,7 +391,19 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.115
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.11
+ '''
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_dashboardtile"
+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
+ WHERE (NOT ("posthog_dashboardtile"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL)
+ AND NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboardtile"."dashboard_id" = 99999
+ AND NOT ("posthog_dashboardtile"."insight_id" IS NULL))
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.110
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -650,7 +449,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.116
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.111
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -696,7 +495,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.117
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.112
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -835,7 +634,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.118
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.113
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -890,7 +689,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.119
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.114
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -913,26 +712,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.12
- '''
- SELECT "posthog_sharingconfiguration"."id",
- "posthog_sharingconfiguration"."team_id",
- "posthog_sharingconfiguration"."dashboard_id",
- "posthog_sharingconfiguration"."insight_id",
- "posthog_sharingconfiguration"."recording_id",
- "posthog_sharingconfiguration"."notebook_id",
- "posthog_sharingconfiguration"."interviewee_context_id",
- "posthog_sharingconfiguration"."created_at",
- "posthog_sharingconfiguration"."enabled",
- "posthog_sharingconfiguration"."access_token",
- "posthog_sharingconfiguration"."expires_at",
- "posthog_sharingconfiguration"."settings",
- "posthog_sharingconfiguration"."password_required"
- FROM "posthog_sharingconfiguration"
- WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.120
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.115
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -985,7 +765,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.121
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.116
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -997,7 +777,7 @@
OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.122
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.117
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -1019,7 +799,7 @@
AND "ee_accesscontrol"."role_id" IS NULL)))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.123
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.118
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -1036,7 +816,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -1122,7 +901,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.124
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.119
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -1145,7 +924,26 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.125
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.12
+ '''
+ SELECT "posthog_sharingconfiguration"."id",
+ "posthog_sharingconfiguration"."team_id",
+ "posthog_sharingconfiguration"."dashboard_id",
+ "posthog_sharingconfiguration"."insight_id",
+ "posthog_sharingconfiguration"."recording_id",
+ "posthog_sharingconfiguration"."notebook_id",
+ "posthog_sharingconfiguration"."interviewee_context_id",
+ "posthog_sharingconfiguration"."created_at",
+ "posthog_sharingconfiguration"."enabled",
+ "posthog_sharingconfiguration"."access_token",
+ "posthog_sharingconfiguration"."expires_at",
+ "posthog_sharingconfiguration"."settings",
+ "posthog_sharingconfiguration"."password_required"
+ FROM "posthog_sharingconfiguration"
+ WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.120
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -1166,7 +964,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.126
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.121
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1265,7 +1063,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.127
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.122
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -1290,7 +1088,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.128
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.123
'''
SELECT "posthog_filesystemshortcut"."id",
"posthog_filesystemshortcut"."team_id",
@@ -1313,7 +1111,7 @@
AND "posthog_filesystemshortcut"."href" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.129
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.124
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -1333,15 +1131,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.13
- '''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_taggeditem"
- WHERE ("posthog_taggeditem"."content_type_id" = 99999
- AND "posthog_taggeditem"."object_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.130
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.125
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -1699,7 +1489,7 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.131
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.126
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -1717,7 +1507,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.132
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.127
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -1738,7 +1528,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.133
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.128
'''
SELECT "posthog_alertconfiguration"."created_by_id",
"posthog_alertconfiguration"."created_at",
@@ -1821,7 +1611,7 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.134
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.129
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -1834,7 +1624,15 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.135
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.13
+ '''
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_taggeditem"
+ WHERE ("posthog_taggeditem"."content_type_id" = 99999
+ AND "posthog_taggeditem"."object_id" = 99999)
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.130
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -1850,7 +1648,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.136
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.131
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -1867,40 +1665,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.137
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.138
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.132
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -1946,7 +1711,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.139
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.133
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -1992,23 +1757,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.14
- '''
- SELECT "posthog_filesystem"."id" AS "id",
- "posthog_filesystem"."path" AS "path"
- FROM "posthog_filesystem"
- WHERE (("posthog_filesystem"."surface" IS NULL
- OR "posthog_filesystem"."surface" = 'web')
- AND "posthog_filesystem"."ref" = '0001'
- AND "posthog_filesystem"."team_id" = 99999
- AND "posthog_filesystem"."type" = 'dashboard'
- AND NOT ("posthog_filesystem"."shortcut"
- AND "posthog_filesystem"."shortcut" IS NOT NULL))
- ORDER BY 1 ASC
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.140
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.134
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -2147,7 +1896,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.141
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.135
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -2202,7 +1951,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.142
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.136
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -2225,7 +1974,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.143
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.137
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -2278,7 +2027,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.144
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.138
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -2290,7 +2039,7 @@
OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.145
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.139
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -2312,7 +2061,23 @@
AND "ee_accesscontrol"."role_id" IS NULL)))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.146
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.14
+ '''
+ SELECT "posthog_filesystem"."id" AS "id",
+ "posthog_filesystem"."path" AS "path"
+ FROM "posthog_filesystem"
+ WHERE (("posthog_filesystem"."surface" IS NULL
+ OR "posthog_filesystem"."surface" = 'web')
+ AND "posthog_filesystem"."ref" = '0001'
+ AND "posthog_filesystem"."team_id" = 99999
+ AND "posthog_filesystem"."type" = 'dashboard'
+ AND NOT ("posthog_filesystem"."shortcut"
+ AND "posthog_filesystem"."shortcut" IS NOT NULL))
+ ORDER BY 1 ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.140
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -2332,7 +2097,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.147
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.141
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -2345,7 +2110,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.148
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.142
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -2358,7 +2123,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.149
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.143
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -2375,7 +2140,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -2391,23 +2155,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.15
- '''
- SELECT "posthog_filesystem"."id" AS "id",
- "posthog_filesystem"."path" AS "path"
- FROM "posthog_filesystem"
- WHERE (("posthog_filesystem"."surface" IS NULL
- OR "posthog_filesystem"."surface" = 'web')
- AND "posthog_filesystem"."ref" = '0001'
- AND "posthog_filesystem"."team_id" = 99999
- AND "posthog_filesystem"."type" = 'dashboard'
- AND NOT ("posthog_filesystem"."shortcut"
- AND "posthog_filesystem"."shortcut" IS NOT NULL))
- ORDER BY 1 ASC
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.150
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.144
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -2506,7 +2254,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.151
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.145
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -2552,7 +2300,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.152
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.146
'''
SELECT 1 AS "a"
FROM "posthog_sharingconfiguration"
@@ -2564,7 +2312,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.153
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.147
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -2663,7 +2411,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.154
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.148
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -2688,7 +2436,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.155
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.149
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -2706,7 +2454,23 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.156
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.15
+ '''
+ SELECT "posthog_filesystem"."id" AS "id",
+ "posthog_filesystem"."path" AS "path"
+ FROM "posthog_filesystem"
+ WHERE (("posthog_filesystem"."surface" IS NULL
+ OR "posthog_filesystem"."surface" = 'web')
+ AND "posthog_filesystem"."ref" = '0001'
+ AND "posthog_filesystem"."team_id" = 99999
+ AND "posthog_filesystem"."type" = 'dashboard'
+ AND NOT ("posthog_filesystem"."shortcut"
+ AND "posthog_filesystem"."shortcut" IS NOT NULL))
+ ORDER BY 1 ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.150
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -2735,7 +2499,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.157
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.151
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -2764,7 +2528,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.158
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.152
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -2784,7 +2548,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.159
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.153
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -2797,23 +2561,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.16
- '''
- SELECT "posthog_filesystem"."id" AS "id",
- "posthog_filesystem"."path" AS "path"
- FROM "posthog_filesystem"
- WHERE (("posthog_filesystem"."surface" IS NULL
- OR "posthog_filesystem"."surface" = 'web')
- AND "posthog_filesystem"."ref" = '0001'
- AND "posthog_filesystem"."team_id" = 99999
- AND "posthog_filesystem"."type" = 'dashboard'
- AND NOT ("posthog_filesystem"."shortcut"
- AND "posthog_filesystem"."shortcut" IS NOT NULL))
- ORDER BY 1 ASC
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.160
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.154
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -2829,7 +2577,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.161
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.155
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -2846,51 +2594,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.162
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.163
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.164
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.156
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -2899,7 +2603,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.165
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.157
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -2945,7 +2649,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.166
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.158
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -2991,7 +2695,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.167
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.159
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -3130,7 +2834,23 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.168
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.16
+ '''
+ SELECT "posthog_filesystem"."id" AS "id",
+ "posthog_filesystem"."path" AS "path"
+ FROM "posthog_filesystem"
+ WHERE (("posthog_filesystem"."surface" IS NULL
+ OR "posthog_filesystem"."surface" = 'web')
+ AND "posthog_filesystem"."ref" = '0001'
+ AND "posthog_filesystem"."team_id" = 99999
+ AND "posthog_filesystem"."type" = 'dashboard'
+ AND NOT ("posthog_filesystem"."shortcut"
+ AND "posthog_filesystem"."shortcut" IS NOT NULL))
+ ORDER BY 1 ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.160
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -3185,7 +2905,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.169
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.161
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -3208,26 +2928,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.17
- '''
- SELECT "posthog_sharingconfiguration"."id",
- "posthog_sharingconfiguration"."team_id",
- "posthog_sharingconfiguration"."dashboard_id",
- "posthog_sharingconfiguration"."insight_id",
- "posthog_sharingconfiguration"."recording_id",
- "posthog_sharingconfiguration"."notebook_id",
- "posthog_sharingconfiguration"."interviewee_context_id",
- "posthog_sharingconfiguration"."created_at",
- "posthog_sharingconfiguration"."enabled",
- "posthog_sharingconfiguration"."access_token",
- "posthog_sharingconfiguration"."expires_at",
- "posthog_sharingconfiguration"."settings",
- "posthog_sharingconfiguration"."password_required"
- FROM "posthog_sharingconfiguration"
- WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.170
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.162
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -3280,7 +2981,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.171
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.163
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -3292,7 +2993,7 @@
OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.172
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.164
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -3314,7 +3015,7 @@
AND "ee_accesscontrol"."role_id" IS NULL)))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.173
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.165
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -3331,7 +3032,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -3417,7 +3117,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.174
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.166
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -3440,7 +3140,7 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.175
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.167
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -3461,7 +3161,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.176
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.168
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -3560,7 +3260,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.177
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.169
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -3585,7 +3285,26 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.178
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.17
+ '''
+ SELECT "posthog_sharingconfiguration"."id",
+ "posthog_sharingconfiguration"."team_id",
+ "posthog_sharingconfiguration"."dashboard_id",
+ "posthog_sharingconfiguration"."insight_id",
+ "posthog_sharingconfiguration"."recording_id",
+ "posthog_sharingconfiguration"."notebook_id",
+ "posthog_sharingconfiguration"."interviewee_context_id",
+ "posthog_sharingconfiguration"."created_at",
+ "posthog_sharingconfiguration"."enabled",
+ "posthog_sharingconfiguration"."access_token",
+ "posthog_sharingconfiguration"."expires_at",
+ "posthog_sharingconfiguration"."settings",
+ "posthog_sharingconfiguration"."password_required"
+ FROM "posthog_sharingconfiguration"
+ WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.170
'''
SELECT "posthog_filesystemshortcut"."id",
"posthog_filesystemshortcut"."team_id",
@@ -3608,27 +3327,7 @@
AND "posthog_filesystemshortcut"."href" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.179
- '''
- SELECT "posthog_insightvariable"."id",
- "posthog_insightvariable"."name",
- "posthog_insightvariable"."code_name",
- "posthog_insightvariable"."type",
- "posthog_insightvariable"."default_value",
- "posthog_insightvariable"."is_multi"
- FROM "posthog_insightvariable"
- INNER JOIN "posthog_team" ON ("posthog_insightvariable"."team_id" = "posthog_team"."id")
- WHERE ("posthog_insightvariable"."team_id" =
- (SELECT U0."parent_team_id" AS "parent_team_id"
- FROM "posthog_team" U0
- WHERE U0."id" = 99999
- LIMIT 1)
- OR ("posthog_team"."parent_team_id" IS NULL
- AND "posthog_insightvariable"."team_id" = 99999))
- ORDER BY "posthog_insightvariable"."name" ASC
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.18
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.171
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -3648,7 +3347,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.180
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.172
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -4006,7 +3705,7 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.181
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.173
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -4024,7 +3723,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.182
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.174
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -4045,7 +3744,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.183
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.175
'''
SELECT "posthog_alertconfiguration"."created_by_id",
"posthog_alertconfiguration"."created_at",
@@ -4128,7 +3827,7 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.184
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.176
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -4141,7 +3840,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.185
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.177
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -4157,7 +3856,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.186
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.178
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -4174,37 +3873,24 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.187
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.18
'''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
+ SELECT "posthog_insightvariable"."id",
+ "posthog_insightvariable"."name",
+ "posthog_insightvariable"."code_name",
+ "posthog_insightvariable"."type",
+ "posthog_insightvariable"."default_value",
+ "posthog_insightvariable"."is_multi"
+ FROM "posthog_insightvariable"
+ INNER JOIN "posthog_team" ON ("posthog_insightvariable"."team_id" = "posthog_team"."id")
+ WHERE ("posthog_insightvariable"."team_id" =
+ (SELECT U0."parent_team_id" AS "parent_team_id"
+ FROM "posthog_team" U0
+ WHERE U0."id" = 99999
+ LIMIT 1)
+ OR ("posthog_team"."parent_team_id" IS NULL
+ AND "posthog_insightvariable"."team_id" = 99999))
+ ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.19
@@ -5126,7 +4812,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -6318,7 +6003,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -6832,50 +6516,6 @@
'''
# ---
# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.62
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.63
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.64
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -6884,7 +6524,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.65
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.63
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -6930,7 +6570,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.66
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.64
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -6976,7 +6616,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.67
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.65
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -7115,7 +6755,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.68
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.66
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -7170,7 +6810,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.69
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.67
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -7193,29 +6833,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.7
- '''
- SELECT "ee_accesscontrol"."id",
- "ee_accesscontrol"."team_id",
- "ee_accesscontrol"."access_level",
- "ee_accesscontrol"."resource",
- "ee_accesscontrol"."resource_id",
- "ee_accesscontrol"."organization_member_id",
- "ee_accesscontrol"."role_id",
- "ee_accesscontrol"."created_by_id",
- "ee_accesscontrol"."created_at",
- "ee_accesscontrol"."updated_at"
- FROM "ee_accesscontrol"
- INNER JOIN "posthog_team" ON ("ee_accesscontrol"."team_id" = "posthog_team"."id")
- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")
- WHERE ("ee_accesscontrol"."resource" = 'project'
- AND "posthog_team"."organization_id" IN ('00000000-0000-0000-0000-000000000000'::uuid)
- AND ("posthog_organizationmembership"."user_id" = 99999
- OR ("ee_accesscontrol"."organization_member_id" IS NULL
- AND "ee_accesscontrol"."role_id" IS NULL)))
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.70
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.68
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -7268,7 +6886,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.71
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.69
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -7280,7 +6898,7 @@
OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.72
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.7
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -7302,7 +6920,29 @@
AND "ee_accesscontrol"."role_id" IS NULL)))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.73
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.70
+ '''
+ SELECT "ee_accesscontrol"."id",
+ "ee_accesscontrol"."team_id",
+ "ee_accesscontrol"."access_level",
+ "ee_accesscontrol"."resource",
+ "ee_accesscontrol"."resource_id",
+ "ee_accesscontrol"."organization_member_id",
+ "ee_accesscontrol"."role_id",
+ "ee_accesscontrol"."created_by_id",
+ "ee_accesscontrol"."created_at",
+ "ee_accesscontrol"."updated_at"
+ FROM "ee_accesscontrol"
+ INNER JOIN "posthog_team" ON ("ee_accesscontrol"."team_id" = "posthog_team"."id")
+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")
+ WHERE ("ee_accesscontrol"."resource" = 'project'
+ AND "posthog_team"."organization_id" IN ('00000000-0000-0000-0000-000000000000'::uuid)
+ AND ("posthog_organizationmembership"."user_id" = 99999
+ OR ("ee_accesscontrol"."organization_member_id" IS NULL
+ AND "ee_accesscontrol"."role_id" IS NULL)))
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.71
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -7319,7 +6959,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -7405,7 +7044,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.74
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.72
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -7428,7 +7067,7 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.75
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.73
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -7449,7 +7088,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.76
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.74
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -7548,7 +7187,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.77
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.75
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -7573,7 +7212,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.78
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.76
'''
SELECT "posthog_filesystemshortcut"."id",
"posthog_filesystemshortcut"."team_id",
@@ -7596,7 +7235,7 @@
AND "posthog_filesystemshortcut"."href" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.79
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.77
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -7616,23 +7255,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.8
- '''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_dashboard"
- INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND ("posthog_dashboard"."team_id" =
- (SELECT U0."parent_team_id" AS "parent_team_id"
- FROM "posthog_team" U0
- WHERE U0."id" = 99999
- LIMIT 1)
- OR ("posthog_team"."parent_team_id" IS NULL
- AND "posthog_dashboard"."team_id" = 99999))
- AND NOT "posthog_dashboard"."deleted")
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.80
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.78
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -7990,7 +7613,7 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.81
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.79
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -8008,7 +7631,23 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.82
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.8
+ '''
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_dashboard"
+ INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
+ WHERE (NOT ("posthog_dashboard"."deleted")
+ AND ("posthog_dashboard"."team_id" =
+ (SELECT U0."parent_team_id" AS "parent_team_id"
+ FROM "posthog_team" U0
+ WHERE U0."id" = 99999
+ LIMIT 1)
+ OR ("posthog_team"."parent_team_id" IS NULL
+ AND "posthog_dashboard"."team_id" = 99999))
+ AND NOT "posthog_dashboard"."deleted")
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.80
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -8029,7 +7668,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.83
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.81
'''
SELECT "posthog_alertconfiguration"."created_by_id",
"posthog_alertconfiguration"."created_at",
@@ -8112,7 +7751,7 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.84
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.82
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -8125,7 +7764,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.85
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.83
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -8141,7 +7780,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.86
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.84
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -8158,40 +7797,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.87
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.88
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.85
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -8237,7 +7843,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.89
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.86
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -8283,7 +7889,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.9
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.87
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -8376,13 +7982,131 @@
"posthog_team"."api_query_rate_limit",
"posthog_team"."drop_events_older_than",
"posthog_team"."base_currency",
- "posthog_team"."business_model"
+ "posthog_team"."business_model",
+ "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
FROM "posthog_team"
+ INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
WHERE "posthog_team"."id" = 99999
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.90
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.88
+ '''
+ SELECT "posthog_organizationmembership"."id",
+ "posthog_organizationmembership"."organization_id",
+ "posthog_organizationmembership"."user_id",
+ "posthog_organizationmembership"."level",
+ "posthog_organizationmembership"."joined_at",
+ "posthog_organizationmembership"."updated_at",
+ "posthog_organizationmembership"."invited_by_id",
+ "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_organizationmembership"
+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_organizationmembership"."user_id" = 99999)
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.89
+ '''
+ SELECT "ee_accesscontrol"."id",
+ "ee_accesscontrol"."team_id",
+ "ee_accesscontrol"."access_level",
+ "ee_accesscontrol"."resource",
+ "ee_accesscontrol"."resource_id",
+ "ee_accesscontrol"."organization_member_id",
+ "ee_accesscontrol"."role_id",
+ "ee_accesscontrol"."created_by_id",
+ "ee_accesscontrol"."created_at",
+ "ee_accesscontrol"."updated_at"
+ FROM "ee_accesscontrol"
+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")
+ WHERE (("ee_accesscontrol"."organization_member_id" IS NULL
+ AND "ee_accesscontrol"."role_id" IS NULL
+ AND "ee_accesscontrol"."team_id" = 99999)
+ OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_organizationmembership"."user_id" = 99999
+ AND "ee_accesscontrol"."role_id" IS NULL
+ AND "ee_accesscontrol"."team_id" = 99999))
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.9
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -8475,131 +8199,13 @@
"posthog_team"."api_query_rate_limit",
"posthog_team"."drop_events_older_than",
"posthog_team"."base_currency",
- "posthog_team"."business_model",
- "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
+ "posthog_team"."business_model"
FROM "posthog_team"
- INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
WHERE "posthog_team"."id" = 99999
LIMIT 21
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.91
- '''
- SELECT "posthog_organizationmembership"."id",
- "posthog_organizationmembership"."organization_id",
- "posthog_organizationmembership"."user_id",
- "posthog_organizationmembership"."level",
- "posthog_organizationmembership"."joined_at",
- "posthog_organizationmembership"."updated_at",
- "posthog_organizationmembership"."invited_by_id",
- "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organizationmembership"
- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_organizationmembership"."user_id" = 99999)
- LIMIT 21
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.92
- '''
- SELECT "ee_accesscontrol"."id",
- "ee_accesscontrol"."team_id",
- "ee_accesscontrol"."access_level",
- "ee_accesscontrol"."resource",
- "ee_accesscontrol"."resource_id",
- "ee_accesscontrol"."organization_member_id",
- "ee_accesscontrol"."role_id",
- "ee_accesscontrol"."created_by_id",
- "ee_accesscontrol"."created_at",
- "ee_accesscontrol"."updated_at"
- FROM "ee_accesscontrol"
- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")
- WHERE (("ee_accesscontrol"."organization_member_id" IS NULL
- AND "ee_accesscontrol"."role_id" IS NULL
- AND "ee_accesscontrol"."team_id" = 99999)
- OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_organizationmembership"."user_id" = 99999
- AND "ee_accesscontrol"."role_id" IS NULL
- AND "ee_accesscontrol"."team_id" = 99999))
- '''
-# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.93
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.90
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -8652,7 +8258,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.94
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.91
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -8664,7 +8270,7 @@
OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.95
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.92
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -8686,7 +8292,7 @@
AND "ee_accesscontrol"."role_id" IS NULL)))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.96
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.93
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -8706,7 +8312,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.97
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.94
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -8719,7 +8325,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.98
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.95
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -8732,7 +8338,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.99
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.96
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -8749,7 +8355,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -8765,6 +8370,163 @@
5 /* ... */))
'''
# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.97
+ '''
+ SELECT "posthog_team"."id",
+ "posthog_team"."uuid",
+ "posthog_team"."organization_id",
+ "posthog_team"."parent_team_id",
+ "posthog_team"."project_id",
+ "posthog_team"."api_token",
+ "posthog_team"."app_urls",
+ "posthog_team"."name",
+ "posthog_team"."slack_incoming_webhook",
+ "posthog_team"."created_at",
+ "posthog_team"."updated_at",
+ "posthog_team"."anonymize_ips",
+ "posthog_team"."completed_snippet_onboarding",
+ "posthog_team"."has_completed_onboarding_for",
+ "posthog_team"."onboarding_tasks",
+ "posthog_team"."ingested_event",
+ "posthog_team"."ingested_production_event",
+ "posthog_team"."ingested_production_event_last_checked_at",
+ "posthog_team"."person_processing_opt_out",
+ "posthog_team"."secret_api_token",
+ "posthog_team"."secret_api_token_backup",
+ "posthog_team"."session_recording_opt_in",
+ "posthog_team"."session_recording_sample_rate",
+ "posthog_team"."session_recording_minimum_duration_milliseconds",
+ "posthog_team"."session_recording_linked_flag",
+ "posthog_team"."session_recording_network_payload_capture_config",
+ "posthog_team"."session_recording_masking_config",
+ "posthog_team"."session_recording_url_trigger_config",
+ "posthog_team"."session_recording_url_blocklist_config",
+ "posthog_team"."session_recording_event_trigger_config",
+ "posthog_team"."session_recording_trigger_match_type_config",
+ "posthog_team"."session_recording_trigger_groups",
+ "posthog_team"."session_replay_config",
+ "posthog_team"."session_recording_retention_period",
+ "posthog_team"."event_retention_months",
+ "posthog_team"."conversations_enabled",
+ "posthog_team"."conversations_settings",
+ "posthog_team"."proactive_tasks_enabled",
+ "posthog_team"."survey_config",
+ "posthog_team"."surveys_opt_in",
+ "posthog_team"."product_tours_opt_in",
+ "posthog_team"."capture_console_log_opt_in",
+ "posthog_team"."capture_performance_opt_in",
+ "posthog_team"."capture_dead_clicks",
+ "posthog_team"."autocapture_opt_out",
+ "posthog_team"."autocapture_web_vitals_opt_in",
+ "posthog_team"."autocapture_web_vitals_allowed_metrics",
+ "posthog_team"."autocapture_exceptions_opt_in",
+ "posthog_team"."autocapture_exceptions_errors_to_ignore",
+ "posthog_team"."logs_settings",
+ "posthog_team"."llm_gateway_enabled_at",
+ "posthog_team"."llm_gateway_revoked_at",
+ "posthog_team"."llm_gateway_overspend_allowance_usd",
+ "posthog_team"."heatmaps_opt_in",
+ "posthog_team"."receive_org_level_activity_logs",
+ "posthog_team"."web_analytics_pre_aggregated_tables_enabled",
+ "posthog_team"."web_analytics_pre_aggregated_tables_version",
+ "posthog_team"."flags_persistence_default",
+ "posthog_team"."feature_flag_confirmation_enabled",
+ "posthog_team"."feature_flag_confirmation_message",
+ "posthog_team"."default_evaluation_environments_enabled",
+ "posthog_team"."require_evaluation_environment_tags",
+ "posthog_team"."default_evaluation_contexts_enabled",
+ "posthog_team"."require_evaluation_contexts",
+ "posthog_team"."session_recording_version",
+ "posthog_team"."signup_token",
+ "posthog_team"."is_demo",
+ "posthog_team"."access_control",
+ "posthog_team"."week_start_day",
+ "posthog_team"."inject_web_apps",
+ "posthog_team"."test_account_filters",
+ "posthog_team"."test_account_filters_default_checked",
+ "posthog_team"."path_cleaning_filters",
+ "posthog_team"."timezone",
+ "posthog_team"."data_attributes",
+ "posthog_team"."person_display_name_properties",
+ "posthog_team"."live_events_columns",
+ "posthog_team"."recording_domains",
+ "posthog_team"."human_friendly_comparison_periods",
+ "posthog_team"."cookieless_server_hash_mode",
+ "posthog_team"."primary_dashboard_id",
+ "posthog_team"."default_data_theme",
+ "posthog_team"."extra_settings",
+ "posthog_team"."modifiers",
+ "posthog_team"."correlation_config",
+ "posthog_team"."session_recording_retention_period_days",
+ "posthog_team"."external_data_workspace_id",
+ "posthog_team"."external_data_workspace_last_synced_at",
+ "posthog_team"."api_query_rate_limit",
+ "posthog_team"."drop_events_older_than",
+ "posthog_team"."base_currency",
+ "posthog_team"."business_model"
+ FROM "posthog_team"
+ WHERE "posthog_team"."id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.98
+ '''
+ SELECT "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_organization"
+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.99
+ '''
+ SELECT 1 AS "a"
+ FROM "posthog_sharingconfiguration"
+ WHERE ("posthog_sharingconfiguration"."enabled"
+ AND ("posthog_sharingconfiguration"."expires_at" IS NULL
+ OR "posthog_sharingconfiguration"."expires_at" > 'SHARING-EXPIRY-TIMESTAMP'::timestamptz)
+ AND "posthog_sharingconfiguration"."dashboard_id" = 99999
+ AND "posthog_sharingconfiguration"."team_id" = 99999)
+ LIMIT 1
+ '''
+# ---
# name: TestDashboard.test_listing_dashboards_is_not_nplus1
'''
SELECT "posthog_user"."id",
@@ -8846,50 +8608,6 @@
'''
# ---
# name: TestDashboard.test_listing_dashboards_is_not_nplus1.100
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.101
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.102
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -8898,7 +8616,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.103
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.101
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -8944,7 +8662,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.104
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.102
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -8990,7 +8708,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.105
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.103
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -9129,7 +8847,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.106
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.104
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -9184,7 +8902,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.107
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.105
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -9207,7 +8925,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.108
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.106
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -9260,7 +8978,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.109
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.107
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -9280,6 +8998,32 @@
5 /* ... */))
'''
# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.108
+ '''
+ SELECT "posthog_dashboard"."id" AS "id",
+ "posthog_dashboard"."name" AS "name"
+ FROM "posthog_dashboard"
+ WHERE (NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboard"."id" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.109
+ '''
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_dashboardtile"
+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
+ WHERE (NOT ("posthog_dashboardtile"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL)
+ AND NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboardtile"."dashboard_id" = 99999
+ AND NOT ("posthog_dashboardtile"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL))
+ '''
+# ---
# name: TestDashboard.test_listing_dashboards_is_not_nplus1.11
'''
SELECT "posthog_identityproviderconfig"."id",
@@ -9307,32 +9051,6 @@
'''
# ---
# name: TestDashboard.test_listing_dashboards_is_not_nplus1.110
- '''
- SELECT "posthog_dashboard"."id" AS "id",
- "posthog_dashboard"."name" AS "name"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.111
- '''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."dashboard_id" = 99999
- AND NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL))
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.112
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -9349,7 +9067,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -9365,7 +9082,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.113
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.111
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -9464,7 +9181,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.114
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.112
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -9510,7 +9227,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.115
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.113
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -9609,7 +9326,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.116
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.114
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -9634,7 +9351,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.117
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.115
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -9652,7 +9369,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.118
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.116
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -9698,7 +9415,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.119
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.117
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -9797,30 +9514,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.12
- '''
- SELECT "posthog_organizationdomain"."id",
- "posthog_organizationdomain"."organization_id",
- "posthog_organizationdomain"."domain",
- "posthog_organizationdomain"."verification_challenge",
- "posthog_organizationdomain"."verified_at",
- "posthog_organizationdomain"."last_verification_retry",
- "posthog_organizationdomain"."jit_provisioning_enabled",
- "posthog_organizationdomain"."sso_enforcement",
- "posthog_organizationdomain"."saml_entity_id",
- "posthog_organizationdomain"."saml_acs_url",
- "posthog_organizationdomain"."saml_x509_cert",
- "posthog_organizationdomain"."scim_enabled",
- "posthog_organizationdomain"."scim_bearer_token",
- "posthog_organizationdomain"."id_jag_issuer_url",
- "posthog_organizationdomain"."id_jag_jwks_url",
- "posthog_organizationdomain"."id_jag_allowed_clients",
- "posthog_organizationdomain"."identity_provider_config_id"
- FROM "posthog_organizationdomain"
- WHERE "posthog_organizationdomain"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.120
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.118
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -9849,7 +9543,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.121
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.119
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -9878,7 +9572,30 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.122
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.12
+ '''
+ SELECT "posthog_organizationdomain"."id",
+ "posthog_organizationdomain"."organization_id",
+ "posthog_organizationdomain"."domain",
+ "posthog_organizationdomain"."verification_challenge",
+ "posthog_organizationdomain"."verified_at",
+ "posthog_organizationdomain"."last_verification_retry",
+ "posthog_organizationdomain"."jit_provisioning_enabled",
+ "posthog_organizationdomain"."sso_enforcement",
+ "posthog_organizationdomain"."saml_entity_id",
+ "posthog_organizationdomain"."saml_acs_url",
+ "posthog_organizationdomain"."saml_x509_cert",
+ "posthog_organizationdomain"."scim_enabled",
+ "posthog_organizationdomain"."scim_bearer_token",
+ "posthog_organizationdomain"."id_jag_issuer_url",
+ "posthog_organizationdomain"."id_jag_jwks_url",
+ "posthog_organizationdomain"."id_jag_allowed_clients",
+ "posthog_organizationdomain"."identity_provider_config_id"
+ FROM "posthog_organizationdomain"
+ WHERE "posthog_organizationdomain"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.120
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -9898,7 +9615,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.123
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.121
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -9911,7 +9628,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.124
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.122
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -9927,7 +9644,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.125
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.123
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -9944,51 +9661,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.126
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.127
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.128
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.124
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -9997,7 +9670,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.129
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.125
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -10043,30 +9716,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.13
- '''
- SELECT "posthog_organizationdomain"."id",
- "posthog_organizationdomain"."organization_id",
- "posthog_organizationdomain"."domain",
- "posthog_organizationdomain"."verification_challenge",
- "posthog_organizationdomain"."verified_at",
- "posthog_organizationdomain"."last_verification_retry",
- "posthog_organizationdomain"."jit_provisioning_enabled",
- "posthog_organizationdomain"."sso_enforcement",
- "posthog_organizationdomain"."saml_entity_id",
- "posthog_organizationdomain"."saml_acs_url",
- "posthog_organizationdomain"."saml_x509_cert",
- "posthog_organizationdomain"."scim_enabled",
- "posthog_organizationdomain"."scim_bearer_token",
- "posthog_organizationdomain"."id_jag_issuer_url",
- "posthog_organizationdomain"."id_jag_jwks_url",
- "posthog_organizationdomain"."id_jag_allowed_clients",
- "posthog_organizationdomain"."identity_provider_config_id"
- FROM "posthog_organizationdomain"
- WHERE "posthog_organizationdomain"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.130
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.126
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -10112,7 +9762,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.131
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.127
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -10251,7 +9901,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.132
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.128
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -10306,7 +9956,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.133
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.129
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -10329,7 +9979,30 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.134
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.13
+ '''
+ SELECT "posthog_organizationdomain"."id",
+ "posthog_organizationdomain"."organization_id",
+ "posthog_organizationdomain"."domain",
+ "posthog_organizationdomain"."verification_challenge",
+ "posthog_organizationdomain"."verified_at",
+ "posthog_organizationdomain"."last_verification_retry",
+ "posthog_organizationdomain"."jit_provisioning_enabled",
+ "posthog_organizationdomain"."sso_enforcement",
+ "posthog_organizationdomain"."saml_entity_id",
+ "posthog_organizationdomain"."saml_acs_url",
+ "posthog_organizationdomain"."saml_x509_cert",
+ "posthog_organizationdomain"."scim_enabled",
+ "posthog_organizationdomain"."scim_bearer_token",
+ "posthog_organizationdomain"."id_jag_issuer_url",
+ "posthog_organizationdomain"."id_jag_jwks_url",
+ "posthog_organizationdomain"."id_jag_allowed_clients",
+ "posthog_organizationdomain"."identity_provider_config_id"
+ FROM "posthog_organizationdomain"
+ WHERE "posthog_organizationdomain"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.130
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -10382,7 +10055,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.135
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.131
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -10402,7 +10075,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.136
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.132
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -10415,7 +10088,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.137
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.133
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -10428,7 +10101,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.138
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.134
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -10445,7 +10118,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -10461,7 +10133,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.139
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.135
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -10560,24 +10232,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.14
- '''
- SELECT "posthog_roleexternalreference"."id",
- "posthog_roleexternalreference"."organization_id",
- "posthog_roleexternalreference"."role_id",
- "posthog_roleexternalreference"."provider",
- "posthog_roleexternalreference"."provider_organization_id",
- "posthog_roleexternalreference"."provider_role_id",
- "posthog_roleexternalreference"."provider_role_slug",
- "posthog_roleexternalreference"."provider_role_name",
- "posthog_roleexternalreference"."created_at",
- "posthog_roleexternalreference"."updated_at",
- "posthog_roleexternalreference"."created_by_id"
- FROM "posthog_roleexternalreference"
- WHERE "posthog_roleexternalreference"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.140
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.136
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -10623,7 +10278,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.141
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.137
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -10722,7 +10377,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.142
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.138
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -10747,7 +10402,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.143
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.139
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -10765,7 +10420,24 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.144
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.14
+ '''
+ SELECT "posthog_roleexternalreference"."id",
+ "posthog_roleexternalreference"."organization_id",
+ "posthog_roleexternalreference"."role_id",
+ "posthog_roleexternalreference"."provider",
+ "posthog_roleexternalreference"."provider_organization_id",
+ "posthog_roleexternalreference"."provider_role_id",
+ "posthog_roleexternalreference"."provider_role_slug",
+ "posthog_roleexternalreference"."provider_role_name",
+ "posthog_roleexternalreference"."created_at",
+ "posthog_roleexternalreference"."updated_at",
+ "posthog_roleexternalreference"."created_by_id"
+ FROM "posthog_roleexternalreference"
+ WHERE "posthog_roleexternalreference"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.140
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -10811,7 +10483,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.145
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.141
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -10910,7 +10582,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.146
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.142
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -10939,7 +10611,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.147
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.143
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -10968,7 +10640,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.148
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.144
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -10988,7 +10660,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.149
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.145
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -11001,24 +10673,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.15
- '''
- SELECT "posthog_roleexternalreference"."id",
- "posthog_roleexternalreference"."organization_id",
- "posthog_roleexternalreference"."role_id",
- "posthog_roleexternalreference"."provider",
- "posthog_roleexternalreference"."provider_organization_id",
- "posthog_roleexternalreference"."provider_role_id",
- "posthog_roleexternalreference"."provider_role_slug",
- "posthog_roleexternalreference"."provider_role_name",
- "posthog_roleexternalreference"."created_at",
- "posthog_roleexternalreference"."updated_at",
- "posthog_roleexternalreference"."created_by_id"
- FROM "posthog_roleexternalreference"
- WHERE "posthog_roleexternalreference"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.150
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.146
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -11034,7 +10689,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.151
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.147
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -11051,51 +10706,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.152
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.153
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.154
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.148
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -11104,7 +10715,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.155
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.149
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -11150,7 +10761,24 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.156
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.15
+ '''
+ SELECT "posthog_roleexternalreference"."id",
+ "posthog_roleexternalreference"."organization_id",
+ "posthog_roleexternalreference"."role_id",
+ "posthog_roleexternalreference"."provider",
+ "posthog_roleexternalreference"."provider_organization_id",
+ "posthog_roleexternalreference"."provider_role_id",
+ "posthog_roleexternalreference"."provider_role_slug",
+ "posthog_roleexternalreference"."provider_role_name",
+ "posthog_roleexternalreference"."created_at",
+ "posthog_roleexternalreference"."updated_at",
+ "posthog_roleexternalreference"."created_by_id"
+ FROM "posthog_roleexternalreference"
+ WHERE "posthog_roleexternalreference"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.150
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -11196,7 +10824,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.157
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.151
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -11335,7 +10963,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.158
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.152
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -11390,7 +11018,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.159
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.153
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -11413,18 +11041,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.16
- '''
- SELECT "posthog_organizationprovisioning"."organization_id",
- "posthog_organizationprovisioning"."partner",
- "posthog_organizationprovisioning"."application_id",
- "posthog_organizationprovisioning"."created_at"
- FROM "posthog_organizationprovisioning"
- WHERE "posthog_organizationprovisioning"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- LIMIT 21
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.160
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.154
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -11477,7 +11094,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.161
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.155
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboard"
@@ -11491,7 +11108,7 @@
AND NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.162
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.156
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -11508,7 +11125,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -11597,7 +11213,7 @@
LIMIT 300
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.163
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.157
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -11620,7 +11236,7 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.164
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.158
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -11641,7 +11257,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.165
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.159
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -11687,7 +11303,18 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.166
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.16
+ '''
+ SELECT "posthog_organizationprovisioning"."organization_id",
+ "posthog_organizationprovisioning"."partner",
+ "posthog_organizationprovisioning"."application_id",
+ "posthog_organizationprovisioning"."created_at"
+ FROM "posthog_organizationprovisioning"
+ WHERE "posthog_organizationprovisioning"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.160
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -11733,7 +11360,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.167
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.161
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -11872,7 +11499,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.168
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.162
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -11927,7 +11554,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.169
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.163
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -11950,23 +11577,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.17
- '''
- SELECT "posthog_proxyrecord"."id",
- "posthog_proxyrecord"."organization_id",
- "posthog_proxyrecord"."domain",
- "posthog_proxyrecord"."target_cname",
- "posthog_proxyrecord"."root_redirect_url",
- "posthog_proxyrecord"."message",
- "posthog_proxyrecord"."status",
- "posthog_proxyrecord"."created_by_id",
- "posthog_proxyrecord"."created_at",
- "posthog_proxyrecord"."updated_at"
- FROM "posthog_proxyrecord"
- WHERE "posthog_proxyrecord"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.170
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.164
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -12019,7 +11630,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.171
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.165
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboard"
@@ -12035,7 +11646,7 @@
AND NOT "posthog_dashboard"."deleted")
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.172
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.166
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -12134,7 +11745,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.173
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.167
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -12159,7 +11770,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.174
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.168
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -12171,7 +11782,7 @@
AND NOT ("posthog_dashboardtile"."insight_id" IS NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.175
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.169
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -12190,7 +11801,23 @@
WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.176
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.17
+ '''
+ SELECT "posthog_proxyrecord"."id",
+ "posthog_proxyrecord"."organization_id",
+ "posthog_proxyrecord"."domain",
+ "posthog_proxyrecord"."target_cname",
+ "posthog_proxyrecord"."root_redirect_url",
+ "posthog_proxyrecord"."message",
+ "posthog_proxyrecord"."status",
+ "posthog_proxyrecord"."created_by_id",
+ "posthog_proxyrecord"."created_at",
+ "posthog_proxyrecord"."updated_at"
+ FROM "posthog_proxyrecord"
+ WHERE "posthog_proxyrecord"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.170
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_taggeditem"
@@ -12198,7 +11825,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.177
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.171
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -12214,7 +11841,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.178
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.172
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -12230,7 +11857,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.179
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.173
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -12246,23 +11873,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.18
- '''
- SELECT "posthog_proxyrecord"."id",
- "posthog_proxyrecord"."organization_id",
- "posthog_proxyrecord"."domain",
- "posthog_proxyrecord"."target_cname",
- "posthog_proxyrecord"."root_redirect_url",
- "posthog_proxyrecord"."message",
- "posthog_proxyrecord"."status",
- "posthog_proxyrecord"."created_by_id",
- "posthog_proxyrecord"."created_at",
- "posthog_proxyrecord"."updated_at"
- FROM "posthog_proxyrecord"
- WHERE "posthog_proxyrecord"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.180
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.174
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -12281,7 +11892,7 @@
WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.181
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.175
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -12301,7 +11912,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.182
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.176
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -12659,7 +12270,7 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.183
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.177
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -12668,7 +12279,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.184
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.178
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -12714,7 +12325,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.185
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.179
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -12760,7 +12371,23 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.186
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.18
+ '''
+ SELECT "posthog_proxyrecord"."id",
+ "posthog_proxyrecord"."organization_id",
+ "posthog_proxyrecord"."domain",
+ "posthog_proxyrecord"."target_cname",
+ "posthog_proxyrecord"."root_redirect_url",
+ "posthog_proxyrecord"."message",
+ "posthog_proxyrecord"."status",
+ "posthog_proxyrecord"."created_by_id",
+ "posthog_proxyrecord"."created_at",
+ "posthog_proxyrecord"."updated_at"
+ FROM "posthog_proxyrecord"
+ WHERE "posthog_proxyrecord"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.180
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -12899,7 +12526,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.187
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.181
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -12954,7 +12581,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.188
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.182
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -12977,7 +12604,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.189
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.183
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -13030,33 +12657,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.19
- '''
- SELECT "posthog_duckgresserver"."created_by_id",
- "posthog_duckgresserver"."created_at",
- "posthog_duckgresserver"."updated_at",
- "posthog_duckgresserver"."id",
- "posthog_duckgresserver"."organization_id",
- "posthog_duckgresserver"."host",
- "posthog_duckgresserver"."port",
- "posthog_duckgresserver"."flight_port",
- "posthog_duckgresserver"."database",
- "posthog_duckgresserver"."username",
- "posthog_duckgresserver"."password",
- "posthog_duckgresserver"."trino_password",
- "posthog_duckgresserver"."catalog_host",
- "posthog_duckgresserver"."catalog_port",
- "posthog_duckgresserver"."catalog_database",
- "posthog_duckgresserver"."catalog_username",
- "posthog_duckgresserver"."catalog_password",
- "posthog_duckgresserver"."bucket",
- "posthog_duckgresserver"."bucket_region"
- FROM "posthog_duckgresserver"
- WHERE "posthog_duckgresserver"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- LIMIT 21
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.190
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.184
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -13076,7 +12677,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.191
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.185
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -13089,7 +12690,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.192
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.186
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -13102,7 +12703,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.193
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.187
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -13119,7 +12720,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -13135,7 +12735,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.194
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.188
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -13234,7 +12834,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.195
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.189
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -13280,7 +12880,33 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.196
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.19
+ '''
+ SELECT "posthog_duckgresserver"."created_by_id",
+ "posthog_duckgresserver"."created_at",
+ "posthog_duckgresserver"."updated_at",
+ "posthog_duckgresserver"."id",
+ "posthog_duckgresserver"."organization_id",
+ "posthog_duckgresserver"."host",
+ "posthog_duckgresserver"."port",
+ "posthog_duckgresserver"."flight_port",
+ "posthog_duckgresserver"."database",
+ "posthog_duckgresserver"."username",
+ "posthog_duckgresserver"."password",
+ "posthog_duckgresserver"."trino_password",
+ "posthog_duckgresserver"."catalog_host",
+ "posthog_duckgresserver"."catalog_port",
+ "posthog_duckgresserver"."catalog_database",
+ "posthog_duckgresserver"."catalog_username",
+ "posthog_duckgresserver"."catalog_password",
+ "posthog_duckgresserver"."bucket",
+ "posthog_duckgresserver"."bucket_region"
+ FROM "posthog_duckgresserver"
+ WHERE "posthog_duckgresserver"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.190
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -13379,7 +13005,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.197
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.191
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -13404,7 +13030,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.198
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.192
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -13422,53 +13048,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.199
- '''
- SELECT "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
- LIMIT 21
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.2
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.193
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -13511,22 +13091,10 @@
"posthog_organization"."is_platform"
FROM "posthog_organization"
WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
- ORDER BY "posthog_organization"."id" ASC
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.20
- '''
- SELECT "posthog_managedwarehousesourcelifecycle"."organization_id",
- "posthog_managedwarehousesourcelifecycle"."generation",
- "posthog_managedwarehousesourcelifecycle"."desired_active",
- "posthog_managedwarehousesourcelifecycle"."legacy_conversion_generation"
- FROM "posthog_managedwarehousesourcelifecycle"
- WHERE "posthog_managedwarehousesourcelifecycle"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.200
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.194
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -13625,7 +13193,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.201
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.195
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -13654,7 +13222,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.202
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.196
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -13683,7 +13251,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.203
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.197
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -13703,7 +13271,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.204
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.198
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -13716,7 +13284,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.205
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.199
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -13732,7 +13300,65 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.206
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.2
+ '''
+ SELECT "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_organization"
+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ ORDER BY "posthog_organization"."id" ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.20
+ '''
+ SELECT "posthog_managedwarehousesourcelifecycle"."organization_id",
+ "posthog_managedwarehousesourcelifecycle"."generation",
+ "posthog_managedwarehousesourcelifecycle"."desired_active",
+ "posthog_managedwarehousesourcelifecycle"."legacy_conversion_generation"
+ FROM "posthog_managedwarehousesourcelifecycle"
+ WHERE "posthog_managedwarehousesourcelifecycle"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.200
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -13749,51 +13375,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.207
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.208
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.209
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.201
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -13802,26 +13384,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.21
- '''
- SELECT "legal_documents_legaldocument"."created_by_id",
- "legal_documents_legaldocument"."created_at",
- "legal_documents_legaldocument"."updated_at",
- "legal_documents_legaldocument"."id",
- "legal_documents_legaldocument"."organization_id",
- "legal_documents_legaldocument"."document_type",
- "legal_documents_legaldocument"."company_name",
- "legal_documents_legaldocument"."company_address",
- "legal_documents_legaldocument"."representative_email",
- "legal_documents_legaldocument"."status",
- "legal_documents_legaldocument"."pandadoc_document_id",
- "legal_documents_legaldocument"."signed_pdf_stored"
- FROM "legal_documents_legaldocument"
- WHERE "legal_documents_legaldocument"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- ORDER BY "legal_documents_legaldocument"."created_at" DESC
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.210
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.202
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -13867,7 +13430,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.211
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.203
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -13913,7 +13476,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.212
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.204
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -14052,7 +13615,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.213
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.205
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -14107,7 +13670,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.214
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.206
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -14130,7 +13693,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.215
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.207
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -14183,7 +13746,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.216
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.208
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -14203,7 +13766,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.217
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.209
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -14216,7 +13779,26 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.218
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.21
+ '''
+ SELECT "legal_documents_legaldocument"."created_by_id",
+ "legal_documents_legaldocument"."created_at",
+ "legal_documents_legaldocument"."updated_at",
+ "legal_documents_legaldocument"."id",
+ "legal_documents_legaldocument"."organization_id",
+ "legal_documents_legaldocument"."document_type",
+ "legal_documents_legaldocument"."company_name",
+ "legal_documents_legaldocument"."company_address",
+ "legal_documents_legaldocument"."representative_email",
+ "legal_documents_legaldocument"."status",
+ "legal_documents_legaldocument"."pandadoc_document_id",
+ "legal_documents_legaldocument"."signed_pdf_stored"
+ FROM "legal_documents_legaldocument"
+ WHERE "legal_documents_legaldocument"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ ORDER BY "legal_documents_legaldocument"."created_at" DESC
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.210
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -14229,7 +13811,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.219
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.211
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -14246,7 +13828,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -14262,26 +13843,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.22
- '''
- SELECT "legal_documents_legaldocument"."created_by_id",
- "legal_documents_legaldocument"."created_at",
- "legal_documents_legaldocument"."updated_at",
- "legal_documents_legaldocument"."id",
- "legal_documents_legaldocument"."organization_id",
- "legal_documents_legaldocument"."document_type",
- "legal_documents_legaldocument"."company_name",
- "legal_documents_legaldocument"."company_address",
- "legal_documents_legaldocument"."representative_email",
- "legal_documents_legaldocument"."status",
- "legal_documents_legaldocument"."pandadoc_document_id",
- "legal_documents_legaldocument"."signed_pdf_stored"
- FROM "legal_documents_legaldocument"
- WHERE "legal_documents_legaldocument"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- ORDER BY "legal_documents_legaldocument"."created_at" DESC
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.220
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.212
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -14380,7 +13942,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.221
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.213
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -14426,7 +13988,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.222
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.214
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -14525,7 +14087,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.223
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.215
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -14550,7 +14112,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.224
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.216
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -14568,7 +14130,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.225
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.217
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -14614,7 +14176,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.226
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.218
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -14713,7 +14275,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.227
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.219
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -14742,7 +14304,26 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.228
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.22
+ '''
+ SELECT "legal_documents_legaldocument"."created_by_id",
+ "legal_documents_legaldocument"."created_at",
+ "legal_documents_legaldocument"."updated_at",
+ "legal_documents_legaldocument"."id",
+ "legal_documents_legaldocument"."organization_id",
+ "legal_documents_legaldocument"."document_type",
+ "legal_documents_legaldocument"."company_name",
+ "legal_documents_legaldocument"."company_address",
+ "legal_documents_legaldocument"."representative_email",
+ "legal_documents_legaldocument"."status",
+ "legal_documents_legaldocument"."pandadoc_document_id",
+ "legal_documents_legaldocument"."signed_pdf_stored"
+ FROM "legal_documents_legaldocument"
+ WHERE "legal_documents_legaldocument"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ ORDER BY "legal_documents_legaldocument"."created_at" DESC
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.220
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -14771,7 +14352,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.229
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.221
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -14791,28 +14372,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.23
- '''
- SELECT "growth_productpushcampaign"."updated_at",
- "growth_productpushcampaign"."id",
- "growth_productpushcampaign"."organization_id",
- "growth_productpushcampaign"."created_by_id",
- "growth_productpushcampaign"."product_key",
- "growth_productpushcampaign"."status",
- "growth_productpushcampaign"."position",
- "growth_productpushcampaign"."scheduled_for",
- "growth_productpushcampaign"."started_at",
- "growth_productpushcampaign"."ends_at",
- "growth_productpushcampaign"."ended_at",
- "growth_productpushcampaign"."source",
- "growth_productpushcampaign"."reason_text",
- "growth_productpushcampaign"."metadata",
- "growth_productpushcampaign"."created_at"
- FROM "growth_productpushcampaign"
- WHERE "growth_productpushcampaign"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.230
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.222
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -14825,7 +14385,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.231
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.223
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -14841,7 +14401,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.232
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.224
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -14858,51 +14418,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.233
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.234
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.235
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.225
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -14911,7 +14427,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.236
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.226
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -14957,7 +14473,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.237
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.227
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -15003,7 +14519,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.238
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.228
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -15142,7 +14658,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.239
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.229
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -15197,7 +14713,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.24
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.23
'''
SELECT "growth_productpushcampaign"."updated_at",
"growth_productpushcampaign"."id",
@@ -15218,7 +14734,7 @@
WHERE "growth_productpushcampaign"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.240
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.230
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -15241,7 +14757,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.241
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.231
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -15294,7 +14810,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.242
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.232
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -15314,7 +14830,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.243
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.233
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -15327,7 +14843,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.244
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.234
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -15340,7 +14856,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.245
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.235
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -15357,7 +14873,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -15373,7 +14888,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.246
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.236
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -15472,7 +14987,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.247
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.237
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -15518,7 +15033,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.248
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.238
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -15617,7 +15132,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.249
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.239
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -15642,19 +15157,28 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.25
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.24
'''
- SELECT "growth_organizationenrichment"."id",
- "growth_organizationenrichment"."organization_id",
- "growth_organizationenrichment"."data",
- "growth_organizationenrichment"."created_at",
- "growth_organizationenrichment"."updated_at"
- FROM "growth_organizationenrichment"
- WHERE "growth_organizationenrichment"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- LIMIT 21
+ SELECT "growth_productpushcampaign"."updated_at",
+ "growth_productpushcampaign"."id",
+ "growth_productpushcampaign"."organization_id",
+ "growth_productpushcampaign"."created_by_id",
+ "growth_productpushcampaign"."product_key",
+ "growth_productpushcampaign"."status",
+ "growth_productpushcampaign"."position",
+ "growth_productpushcampaign"."scheduled_for",
+ "growth_productpushcampaign"."started_at",
+ "growth_productpushcampaign"."ends_at",
+ "growth_productpushcampaign"."ended_at",
+ "growth_productpushcampaign"."source",
+ "growth_productpushcampaign"."reason_text",
+ "growth_productpushcampaign"."metadata",
+ "growth_productpushcampaign"."created_at"
+ FROM "growth_productpushcampaign"
+ WHERE "growth_productpushcampaign"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.250
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.240
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -15672,7 +15196,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.251
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.241
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -15718,7 +15242,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.252
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.242
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -15817,7 +15341,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.253
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.243
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -15846,7 +15370,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.254
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.244
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -15875,7 +15399,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.255
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.245
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -15895,7 +15419,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.256
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.246
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -15908,7 +15432,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.257
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.247
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -15924,7 +15448,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.258
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.248
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -15941,63 +15465,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.259
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.26
- '''
- SELECT "growth_organizationenrichmentfetch"."id",
- "growth_organizationenrichmentfetch"."organization_id",
- "growth_organizationenrichmentfetch"."provider",
- "growth_organizationenrichmentfetch"."fetched_at",
- "growth_organizationenrichmentfetch"."is_recheck",
- "growth_organizationenrichmentfetch"."payload"
- FROM "growth_organizationenrichmentfetch"
- WHERE "growth_organizationenrichmentfetch"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.260
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.261
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.249
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -16006,7 +15474,19 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.262
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.25
+ '''
+ SELECT "growth_organizationenrichment"."id",
+ "growth_organizationenrichment"."organization_id",
+ "growth_organizationenrichment"."data",
+ "growth_organizationenrichment"."created_at",
+ "growth_organizationenrichment"."updated_at"
+ FROM "growth_organizationenrichment"
+ WHERE "growth_organizationenrichment"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.250
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -16052,7 +15532,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.263
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.251
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -16098,7 +15578,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.264
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.252
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -16237,7 +15717,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.265
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.253
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -16292,7 +15772,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.266
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.254
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -16315,7 +15795,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.267
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.255
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -16368,7 +15848,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.268
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.256
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboard"
@@ -16382,7 +15862,7 @@
AND NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.269
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.257
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -16399,7 +15879,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -16488,19 +15967,7 @@
LIMIT 300
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.27
- '''
- SELECT "growth_organizationenrichmentfetch"."id",
- "growth_organizationenrichmentfetch"."organization_id",
- "growth_organizationenrichmentfetch"."provider",
- "growth_organizationenrichmentfetch"."fetched_at",
- "growth_organizationenrichmentfetch"."is_recheck",
- "growth_organizationenrichmentfetch"."payload"
- FROM "growth_organizationenrichmentfetch"
- WHERE "growth_organizationenrichmentfetch"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.270
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.258
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -16523,7 +15990,7 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.271
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.259
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -16544,7 +16011,19 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.272
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.26
+ '''
+ SELECT "growth_organizationenrichmentfetch"."id",
+ "growth_organizationenrichmentfetch"."organization_id",
+ "growth_organizationenrichmentfetch"."provider",
+ "growth_organizationenrichmentfetch"."fetched_at",
+ "growth_organizationenrichmentfetch"."is_recheck",
+ "growth_organizationenrichmentfetch"."payload"
+ FROM "growth_organizationenrichmentfetch"
+ WHERE "growth_organizationenrichmentfetch"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.260
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -16590,7 +16069,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.273
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.261
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -16636,7 +16115,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.274
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.262
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -16775,7 +16254,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.275
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.263
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -16830,7 +16309,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.276
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.264
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -16853,7 +16332,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.277
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.265
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -16906,7 +16385,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.278
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.266
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboard"
@@ -16922,7 +16401,7 @@
AND NOT "posthog_dashboard"."deleted")
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.279
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.267
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -17021,23 +16500,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.28
- '''
- SELECT "growth_enrichmentlabelresult"."id",
- "growth_enrichmentlabelresult"."organization_id",
- "growth_enrichmentlabelresult"."fetch_id",
- "growth_enrichmentlabelresult"."label_name",
- "growth_enrichmentlabelresult"."prompt_version",
- "growth_enrichmentlabelresult"."prompt_hash",
- "growth_enrichmentlabelresult"."model",
- "growth_enrichmentlabelresult"."output",
- "growth_enrichmentlabelresult"."inputs",
- "growth_enrichmentlabelresult"."created_at"
- FROM "growth_enrichmentlabelresult"
- WHERE "growth_enrichmentlabelresult"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.280
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.268
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -17062,7 +16525,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.281
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.269
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -17074,7 +16537,19 @@
AND NOT ("posthog_dashboardtile"."insight_id" IS NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.282
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.27
+ '''
+ SELECT "growth_organizationenrichmentfetch"."id",
+ "growth_organizationenrichmentfetch"."organization_id",
+ "growth_organizationenrichmentfetch"."provider",
+ "growth_organizationenrichmentfetch"."fetched_at",
+ "growth_organizationenrichmentfetch"."is_recheck",
+ "growth_organizationenrichmentfetch"."payload"
+ FROM "growth_organizationenrichmentfetch"
+ WHERE "growth_organizationenrichmentfetch"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.270
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -17093,7 +16568,7 @@
WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.283
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.271
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_taggeditem"
@@ -17101,7 +16576,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.284
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.272
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -17117,7 +16592,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.285
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.273
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -17133,7 +16608,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.286
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.274
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -17149,7 +16624,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.287
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.275
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -17168,7 +16643,7 @@
WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.288
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.276
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -17188,7 +16663,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.289
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.277
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -17546,23 +17021,7 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.29
- '''
- SELECT "growth_enrichmentlabelresult"."id",
- "growth_enrichmentlabelresult"."organization_id",
- "growth_enrichmentlabelresult"."fetch_id",
- "growth_enrichmentlabelresult"."label_name",
- "growth_enrichmentlabelresult"."prompt_version",
- "growth_enrichmentlabelresult"."prompt_hash",
- "growth_enrichmentlabelresult"."model",
- "growth_enrichmentlabelresult"."output",
- "growth_enrichmentlabelresult"."inputs",
- "growth_enrichmentlabelresult"."created_at"
- FROM "growth_enrichmentlabelresult"
- WHERE "growth_enrichmentlabelresult"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.290
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.278
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -17571,7 +17030,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.291
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.279
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -17617,147 +17076,163 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.292
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.28
'''
- SELECT "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
- LIMIT 21
+ SELECT "growth_enrichmentlabelresult"."id",
+ "growth_enrichmentlabelresult"."organization_id",
+ "growth_enrichmentlabelresult"."fetch_id",
+ "growth_enrichmentlabelresult"."label_name",
+ "growth_enrichmentlabelresult"."prompt_version",
+ "growth_enrichmentlabelresult"."prompt_hash",
+ "growth_enrichmentlabelresult"."model",
+ "growth_enrichmentlabelresult"."output",
+ "growth_enrichmentlabelresult"."inputs",
+ "growth_enrichmentlabelresult"."created_at"
+ FROM "growth_enrichmentlabelresult"
+ WHERE "growth_enrichmentlabelresult"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.293
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.280
'''
- SELECT "posthog_team"."id",
- "posthog_team"."uuid",
- "posthog_team"."organization_id",
- "posthog_team"."parent_team_id",
- "posthog_team"."project_id",
- "posthog_team"."api_token",
- "posthog_team"."app_urls",
- "posthog_team"."name",
- "posthog_team"."slack_incoming_webhook",
- "posthog_team"."created_at",
- "posthog_team"."updated_at",
- "posthog_team"."anonymize_ips",
- "posthog_team"."completed_snippet_onboarding",
- "posthog_team"."has_completed_onboarding_for",
- "posthog_team"."onboarding_tasks",
- "posthog_team"."ingested_event",
- "posthog_team"."ingested_production_event",
- "posthog_team"."ingested_production_event_last_checked_at",
- "posthog_team"."person_processing_opt_out",
- "posthog_team"."secret_api_token",
- "posthog_team"."secret_api_token_backup",
- "posthog_team"."session_recording_opt_in",
- "posthog_team"."session_recording_sample_rate",
- "posthog_team"."session_recording_minimum_duration_milliseconds",
- "posthog_team"."session_recording_linked_flag",
- "posthog_team"."session_recording_network_payload_capture_config",
- "posthog_team"."session_recording_masking_config",
- "posthog_team"."session_recording_url_trigger_config",
- "posthog_team"."session_recording_url_blocklist_config",
- "posthog_team"."session_recording_event_trigger_config",
- "posthog_team"."session_recording_trigger_match_type_config",
- "posthog_team"."session_recording_trigger_groups",
- "posthog_team"."session_replay_config",
- "posthog_team"."session_recording_retention_period",
- "posthog_team"."event_retention_months",
- "posthog_team"."conversations_enabled",
- "posthog_team"."conversations_settings",
- "posthog_team"."proactive_tasks_enabled",
- "posthog_team"."survey_config",
- "posthog_team"."surveys_opt_in",
- "posthog_team"."product_tours_opt_in",
- "posthog_team"."capture_console_log_opt_in",
- "posthog_team"."capture_performance_opt_in",
- "posthog_team"."capture_dead_clicks",
- "posthog_team"."autocapture_opt_out",
- "posthog_team"."autocapture_web_vitals_opt_in",
- "posthog_team"."autocapture_web_vitals_allowed_metrics",
- "posthog_team"."autocapture_exceptions_opt_in",
- "posthog_team"."autocapture_exceptions_errors_to_ignore",
- "posthog_team"."logs_settings",
- "posthog_team"."llm_gateway_enabled_at",
- "posthog_team"."llm_gateway_revoked_at",
- "posthog_team"."llm_gateway_overspend_allowance_usd",
- "posthog_team"."heatmaps_opt_in",
- "posthog_team"."receive_org_level_activity_logs",
- "posthog_team"."web_analytics_pre_aggregated_tables_enabled",
- "posthog_team"."web_analytics_pre_aggregated_tables_version",
- "posthog_team"."flags_persistence_default",
- "posthog_team"."feature_flag_confirmation_enabled",
- "posthog_team"."feature_flag_confirmation_message",
- "posthog_team"."default_evaluation_environments_enabled",
- "posthog_team"."require_evaluation_environment_tags",
- "posthog_team"."default_evaluation_contexts_enabled",
- "posthog_team"."require_evaluation_contexts",
- "posthog_team"."session_recording_version",
- "posthog_team"."signup_token",
- "posthog_team"."is_demo",
- "posthog_team"."access_control",
- "posthog_team"."week_start_day",
- "posthog_team"."inject_web_apps",
- "posthog_team"."test_account_filters",
- "posthog_team"."test_account_filters_default_checked",
- "posthog_team"."path_cleaning_filters",
- "posthog_team"."timezone",
- "posthog_team"."data_attributes",
- "posthog_team"."person_display_name_properties",
- "posthog_team"."live_events_columns",
- "posthog_team"."recording_domains",
- "posthog_team"."human_friendly_comparison_periods",
- "posthog_team"."cookieless_server_hash_mode",
- "posthog_team"."primary_dashboard_id",
- "posthog_team"."default_data_theme",
- "posthog_team"."extra_settings",
- "posthog_team"."modifiers",
- "posthog_team"."correlation_config",
- "posthog_team"."session_recording_retention_period_days",
- "posthog_team"."external_data_workspace_id",
- "posthog_team"."external_data_workspace_last_synced_at",
- "posthog_team"."api_query_rate_limit",
- "posthog_team"."drop_events_older_than",
- "posthog_team"."base_currency",
- "posthog_team"."business_model",
- "posthog_organization"."id",
+ SELECT "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_organization"
+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.281
+ '''
+ SELECT "posthog_team"."id",
+ "posthog_team"."uuid",
+ "posthog_team"."organization_id",
+ "posthog_team"."parent_team_id",
+ "posthog_team"."project_id",
+ "posthog_team"."api_token",
+ "posthog_team"."app_urls",
+ "posthog_team"."name",
+ "posthog_team"."slack_incoming_webhook",
+ "posthog_team"."created_at",
+ "posthog_team"."updated_at",
+ "posthog_team"."anonymize_ips",
+ "posthog_team"."completed_snippet_onboarding",
+ "posthog_team"."has_completed_onboarding_for",
+ "posthog_team"."onboarding_tasks",
+ "posthog_team"."ingested_event",
+ "posthog_team"."ingested_production_event",
+ "posthog_team"."ingested_production_event_last_checked_at",
+ "posthog_team"."person_processing_opt_out",
+ "posthog_team"."secret_api_token",
+ "posthog_team"."secret_api_token_backup",
+ "posthog_team"."session_recording_opt_in",
+ "posthog_team"."session_recording_sample_rate",
+ "posthog_team"."session_recording_minimum_duration_milliseconds",
+ "posthog_team"."session_recording_linked_flag",
+ "posthog_team"."session_recording_network_payload_capture_config",
+ "posthog_team"."session_recording_masking_config",
+ "posthog_team"."session_recording_url_trigger_config",
+ "posthog_team"."session_recording_url_blocklist_config",
+ "posthog_team"."session_recording_event_trigger_config",
+ "posthog_team"."session_recording_trigger_match_type_config",
+ "posthog_team"."session_recording_trigger_groups",
+ "posthog_team"."session_replay_config",
+ "posthog_team"."session_recording_retention_period",
+ "posthog_team"."event_retention_months",
+ "posthog_team"."conversations_enabled",
+ "posthog_team"."conversations_settings",
+ "posthog_team"."proactive_tasks_enabled",
+ "posthog_team"."survey_config",
+ "posthog_team"."surveys_opt_in",
+ "posthog_team"."product_tours_opt_in",
+ "posthog_team"."capture_console_log_opt_in",
+ "posthog_team"."capture_performance_opt_in",
+ "posthog_team"."capture_dead_clicks",
+ "posthog_team"."autocapture_opt_out",
+ "posthog_team"."autocapture_web_vitals_opt_in",
+ "posthog_team"."autocapture_web_vitals_allowed_metrics",
+ "posthog_team"."autocapture_exceptions_opt_in",
+ "posthog_team"."autocapture_exceptions_errors_to_ignore",
+ "posthog_team"."logs_settings",
+ "posthog_team"."llm_gateway_enabled_at",
+ "posthog_team"."llm_gateway_revoked_at",
+ "posthog_team"."llm_gateway_overspend_allowance_usd",
+ "posthog_team"."heatmaps_opt_in",
+ "posthog_team"."receive_org_level_activity_logs",
+ "posthog_team"."web_analytics_pre_aggregated_tables_enabled",
+ "posthog_team"."web_analytics_pre_aggregated_tables_version",
+ "posthog_team"."flags_persistence_default",
+ "posthog_team"."feature_flag_confirmation_enabled",
+ "posthog_team"."feature_flag_confirmation_message",
+ "posthog_team"."default_evaluation_environments_enabled",
+ "posthog_team"."require_evaluation_environment_tags",
+ "posthog_team"."default_evaluation_contexts_enabled",
+ "posthog_team"."require_evaluation_contexts",
+ "posthog_team"."session_recording_version",
+ "posthog_team"."signup_token",
+ "posthog_team"."is_demo",
+ "posthog_team"."access_control",
+ "posthog_team"."week_start_day",
+ "posthog_team"."inject_web_apps",
+ "posthog_team"."test_account_filters",
+ "posthog_team"."test_account_filters_default_checked",
+ "posthog_team"."path_cleaning_filters",
+ "posthog_team"."timezone",
+ "posthog_team"."data_attributes",
+ "posthog_team"."person_display_name_properties",
+ "posthog_team"."live_events_columns",
+ "posthog_team"."recording_domains",
+ "posthog_team"."human_friendly_comparison_periods",
+ "posthog_team"."cookieless_server_hash_mode",
+ "posthog_team"."primary_dashboard_id",
+ "posthog_team"."default_data_theme",
+ "posthog_team"."extra_settings",
+ "posthog_team"."modifiers",
+ "posthog_team"."correlation_config",
+ "posthog_team"."session_recording_retention_period_days",
+ "posthog_team"."external_data_workspace_id",
+ "posthog_team"."external_data_workspace_last_synced_at",
+ "posthog_team"."api_query_rate_limit",
+ "posthog_team"."drop_events_older_than",
+ "posthog_team"."base_currency",
+ "posthog_team"."business_model",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -17802,7 +17277,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.294
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.282
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -17857,7 +17332,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.295
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.283
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -17880,7 +17355,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.296
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.284
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -17933,7 +17408,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.297
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.285
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -17953,7 +17428,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.298
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.286
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -17966,7 +17441,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.299
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.287
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -17979,27 +17454,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.3
- '''
- SELECT "posthog_organization"."is_active" AS "is_active",
- "posthog_organization"."has_active_subscription" AS "has_active_subscription"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
- ORDER BY "posthog_organization"."id" ASC
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.30
- '''
- SELECT "growth_enrichmentsignupsnapshot"."id",
- "growth_enrichmentsignupsnapshot"."organization_id",
- "growth_enrichmentsignupsnapshot"."created_at"
- FROM "growth_enrichmentsignupsnapshot"
- WHERE "growth_enrichmentsignupsnapshot"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- LIMIT 21
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.300
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.288
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -18016,7 +17471,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -18032,7 +17486,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.301
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.289
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -18131,7 +17585,23 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.302
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.29
+ '''
+ SELECT "growth_enrichmentlabelresult"."id",
+ "growth_enrichmentlabelresult"."organization_id",
+ "growth_enrichmentlabelresult"."fetch_id",
+ "growth_enrichmentlabelresult"."label_name",
+ "growth_enrichmentlabelresult"."prompt_version",
+ "growth_enrichmentlabelresult"."prompt_hash",
+ "growth_enrichmentlabelresult"."model",
+ "growth_enrichmentlabelresult"."output",
+ "growth_enrichmentlabelresult"."inputs",
+ "growth_enrichmentlabelresult"."created_at"
+ FROM "growth_enrichmentlabelresult"
+ WHERE "growth_enrichmentlabelresult"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.290
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -18177,7 +17647,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.303
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.291
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -18276,7 +17746,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.304
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.292
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -18301,7 +17771,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.305
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.293
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -18319,7 +17789,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.306
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.294
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -18365,7 +17835,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.307
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.295
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -18464,7 +17934,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.308
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.296
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -18493,7 +17963,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.309
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.297
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -18522,20 +17992,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.31
- '''
- SELECT "ee_organizationresourceaccess"."id",
- "ee_organizationresourceaccess"."resource",
- "ee_organizationresourceaccess"."access_level",
- "ee_organizationresourceaccess"."organization_id",
- "ee_organizationresourceaccess"."created_by_id",
- "ee_organizationresourceaccess"."created_at",
- "ee_organizationresourceaccess"."updated_at"
- FROM "ee_organizationresourceaccess"
- WHERE "ee_organizationresourceaccess"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.310
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.298
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -18555,7 +18012,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.311
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.299
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -18568,7 +18025,27 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.312
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.3
+ '''
+ SELECT "posthog_organization"."is_active" AS "is_active",
+ "posthog_organization"."has_active_subscription" AS "has_active_subscription"
+ FROM "posthog_organization"
+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ ORDER BY "posthog_organization"."id" ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.30
+ '''
+ SELECT "growth_enrichmentsignupsnapshot"."id",
+ "growth_enrichmentsignupsnapshot"."organization_id",
+ "growth_enrichmentsignupsnapshot"."created_at"
+ FROM "growth_enrichmentsignupsnapshot"
+ WHERE "growth_enrichmentsignupsnapshot"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.300
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -18584,7 +18061,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.313
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.301
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -18601,51 +18078,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.314
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.315
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.316
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.302
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -18654,7 +18087,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.317
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.303
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -18700,7 +18133,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.318
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.304
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -18746,7 +18179,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.319
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.305
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -18885,20 +18318,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.32
- '''
- SELECT "ee_organizationresourceaccess"."id",
- "ee_organizationresourceaccess"."resource",
- "ee_organizationresourceaccess"."access_level",
- "ee_organizationresourceaccess"."organization_id",
- "ee_organizationresourceaccess"."created_by_id",
- "ee_organizationresourceaccess"."created_at",
- "ee_organizationresourceaccess"."updated_at"
- FROM "ee_organizationresourceaccess"
- WHERE "ee_organizationresourceaccess"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.320
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.306
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -18953,7 +18373,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.321
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.307
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -18976,7 +18396,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.322
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.308
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -19029,7 +18449,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.323
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.309
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -19049,7 +18469,20 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.324
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.31
+ '''
+ SELECT "ee_organizationresourceaccess"."id",
+ "ee_organizationresourceaccess"."resource",
+ "ee_organizationresourceaccess"."access_level",
+ "ee_organizationresourceaccess"."organization_id",
+ "ee_organizationresourceaccess"."created_by_id",
+ "ee_organizationresourceaccess"."created_at",
+ "ee_organizationresourceaccess"."updated_at"
+ FROM "ee_organizationresourceaccess"
+ WHERE "ee_organizationresourceaccess"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.310
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -19062,7 +18495,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.325
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.311
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -19075,7 +18508,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.326
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.312
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -19092,7 +18525,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -19108,7 +18540,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.327
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.313
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -19207,7 +18639,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.328
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.314
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -19253,7 +18685,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.329
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.315
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -19352,16 +18784,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.33
- '''
- SELECT "posthog_team"."organization_id" AS "organization_id"
- FROM "posthog_team"
- WHERE "posthog_team"."id" = 99999
- ORDER BY "posthog_team"."id" ASC
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.330
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.316
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -19386,7 +18809,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.331
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.317
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -19404,7 +18827,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.332
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.318
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -19450,7 +18873,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.333
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.319
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -19549,7 +18972,20 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.334
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.32
+ '''
+ SELECT "ee_organizationresourceaccess"."id",
+ "ee_organizationresourceaccess"."resource",
+ "ee_organizationresourceaccess"."access_level",
+ "ee_organizationresourceaccess"."organization_id",
+ "ee_organizationresourceaccess"."created_by_id",
+ "ee_organizationresourceaccess"."created_at",
+ "ee_organizationresourceaccess"."updated_at"
+ FROM "ee_organizationresourceaccess"
+ WHERE "ee_organizationresourceaccess"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.320
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -19578,7 +19014,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.335
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.321
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -19607,7 +19043,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.336
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.322
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -19627,7 +19063,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.337
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.323
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -19640,7 +19076,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.338
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.324
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -19656,7 +19092,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.339
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.325
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -19673,64 +19109,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.34
- '''
- SELECT "posthog_organizationmembership"."id",
- "posthog_organizationmembership"."organization_id",
- "posthog_organizationmembership"."user_id",
- "posthog_organizationmembership"."level",
- "posthog_organizationmembership"."joined_at",
- "posthog_organizationmembership"."updated_at",
- "posthog_organizationmembership"."invited_by_id"
- FROM "posthog_organizationmembership"
- WHERE "posthog_organizationmembership"."user_id" = 99999
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.340
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.341
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.342
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.326
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -19739,7 +19118,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.343
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.327
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -19785,7 +19164,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.344
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.328
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -19831,7 +19210,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.345
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.329
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -19970,7 +19349,16 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.346
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.33
+ '''
+ SELECT "posthog_team"."organization_id" AS "organization_id"
+ FROM "posthog_team"
+ WHERE "posthog_team"."id" = 99999
+ ORDER BY "posthog_team"."id" ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.330
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -20025,7 +19413,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.347
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.331
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -20048,7 +19436,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.348
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.332
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -20101,7 +19489,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.349
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.333
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -20121,21 +19509,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.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"
- FROM "posthog_organizationmembership"
- WHERE "posthog_organizationmembership"."id" = '00000000000000000000000000000000'::uuid
- LIMIT 21
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.350
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.334
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -20148,7 +19522,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.351
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.335
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -20161,7 +19535,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.352
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.336
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -20178,7 +19552,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -20194,7 +19567,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.353
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.337
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -20293,7 +19666,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.354
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.338
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -20339,7 +19712,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.355
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.339
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -20438,7 +19811,20 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.356
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.34
+ '''
+ SELECT "posthog_organizationmembership"."id",
+ "posthog_organizationmembership"."organization_id",
+ "posthog_organizationmembership"."user_id",
+ "posthog_organizationmembership"."level",
+ "posthog_organizationmembership"."joined_at",
+ "posthog_organizationmembership"."updated_at",
+ "posthog_organizationmembership"."invited_by_id"
+ FROM "posthog_organizationmembership"
+ WHERE "posthog_organizationmembership"."user_id" = 99999
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.340
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -20463,7 +19849,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.357
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.341
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -20481,7 +19867,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.358
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.342
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -20527,7 +19913,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.359
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.343
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -20626,15 +20012,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.36
- '''
- SELECT "posthog_team"."id" AS "id"
- FROM "posthog_team"
- WHERE ("posthog_team"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_team"."receive_org_level_activity_logs")
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.360
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.344
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -20663,7 +20041,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.361
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.345
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -20692,7 +20070,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.362
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.346
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -20712,7 +20090,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.363
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.347
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -20725,7 +20103,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.364
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.348
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -20741,7 +20119,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.365
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.349
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -20758,51 +20136,21 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.366
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.367
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.35
'''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
+ SELECT "posthog_organizationmembership"."id",
+ "posthog_organizationmembership"."organization_id",
+ "posthog_organizationmembership"."user_id",
+ "posthog_organizationmembership"."level",
+ "posthog_organizationmembership"."joined_at",
+ "posthog_organizationmembership"."updated_at",
+ "posthog_organizationmembership"."invited_by_id"
+ FROM "posthog_organizationmembership"
+ WHERE "posthog_organizationmembership"."id" = '00000000000000000000000000000000'::uuid
+ LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.368
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.350
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -20811,7 +20159,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.369
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.351
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -20857,107 +20205,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.37
- '''
- SELECT "posthog_team"."id",
- "posthog_team"."uuid",
- "posthog_team"."organization_id",
- "posthog_team"."parent_team_id",
- "posthog_team"."project_id",
- "posthog_team"."api_token",
- "posthog_team"."app_urls",
- "posthog_team"."name",
- "posthog_team"."slack_incoming_webhook",
- "posthog_team"."created_at",
- "posthog_team"."updated_at",
- "posthog_team"."anonymize_ips",
- "posthog_team"."completed_snippet_onboarding",
- "posthog_team"."has_completed_onboarding_for",
- "posthog_team"."onboarding_tasks",
- "posthog_team"."ingested_event",
- "posthog_team"."ingested_production_event",
- "posthog_team"."ingested_production_event_last_checked_at",
- "posthog_team"."person_processing_opt_out",
- "posthog_team"."secret_api_token",
- "posthog_team"."secret_api_token_backup",
- "posthog_team"."session_recording_opt_in",
- "posthog_team"."session_recording_sample_rate",
- "posthog_team"."session_recording_minimum_duration_milliseconds",
- "posthog_team"."session_recording_linked_flag",
- "posthog_team"."session_recording_network_payload_capture_config",
- "posthog_team"."session_recording_masking_config",
- "posthog_team"."session_recording_url_trigger_config",
- "posthog_team"."session_recording_url_blocklist_config",
- "posthog_team"."session_recording_event_trigger_config",
- "posthog_team"."session_recording_trigger_match_type_config",
- "posthog_team"."session_recording_trigger_groups",
- "posthog_team"."session_replay_config",
- "posthog_team"."session_recording_retention_period",
- "posthog_team"."event_retention_months",
- "posthog_team"."conversations_enabled",
- "posthog_team"."conversations_settings",
- "posthog_team"."proactive_tasks_enabled",
- "posthog_team"."survey_config",
- "posthog_team"."surveys_opt_in",
- "posthog_team"."product_tours_opt_in",
- "posthog_team"."capture_console_log_opt_in",
- "posthog_team"."capture_performance_opt_in",
- "posthog_team"."capture_dead_clicks",
- "posthog_team"."autocapture_opt_out",
- "posthog_team"."autocapture_web_vitals_opt_in",
- "posthog_team"."autocapture_web_vitals_allowed_metrics",
- "posthog_team"."autocapture_exceptions_opt_in",
- "posthog_team"."autocapture_exceptions_errors_to_ignore",
- "posthog_team"."logs_settings",
- "posthog_team"."llm_gateway_enabled_at",
- "posthog_team"."llm_gateway_revoked_at",
- "posthog_team"."llm_gateway_overspend_allowance_usd",
- "posthog_team"."heatmaps_opt_in",
- "posthog_team"."receive_org_level_activity_logs",
- "posthog_team"."web_analytics_pre_aggregated_tables_enabled",
- "posthog_team"."web_analytics_pre_aggregated_tables_version",
- "posthog_team"."flags_persistence_default",
- "posthog_team"."feature_flag_confirmation_enabled",
- "posthog_team"."feature_flag_confirmation_message",
- "posthog_team"."default_evaluation_environments_enabled",
- "posthog_team"."require_evaluation_environment_tags",
- "posthog_team"."default_evaluation_contexts_enabled",
- "posthog_team"."require_evaluation_contexts",
- "posthog_team"."session_recording_version",
- "posthog_team"."signup_token",
- "posthog_team"."is_demo",
- "posthog_team"."access_control",
- "posthog_team"."week_start_day",
- "posthog_team"."inject_web_apps",
- "posthog_team"."test_account_filters",
- "posthog_team"."test_account_filters_default_checked",
- "posthog_team"."path_cleaning_filters",
- "posthog_team"."timezone",
- "posthog_team"."data_attributes",
- "posthog_team"."person_display_name_properties",
- "posthog_team"."live_events_columns",
- "posthog_team"."recording_domains",
- "posthog_team"."human_friendly_comparison_periods",
- "posthog_team"."cookieless_server_hash_mode",
- "posthog_team"."primary_dashboard_id",
- "posthog_team"."default_data_theme",
- "posthog_team"."extra_settings",
- "posthog_team"."modifiers",
- "posthog_team"."correlation_config",
- "posthog_team"."session_recording_retention_period_days",
- "posthog_team"."external_data_workspace_id",
- "posthog_team"."external_data_workspace_last_synced_at",
- "posthog_team"."api_query_rate_limit",
- "posthog_team"."drop_events_older_than",
- "posthog_team"."base_currency",
- "posthog_team"."business_model"
- FROM "posthog_team"
- WHERE "posthog_team"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- ORDER BY "posthog_team"."id" ASC
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.370
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.352
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -21003,7 +20251,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.371
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.353
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -21142,7 +20390,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.372
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.354
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -21197,7 +20445,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.373
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.355
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -21220,7 +20468,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.374
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.356
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -21273,7 +20521,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.375
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.357
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboard"
@@ -21287,7 +20535,7 @@
AND NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.376
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.358
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -21304,7 +20552,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -21393,7 +20640,7 @@
LIMIT 300
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.377
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.359
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -21416,7 +20663,15 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.378
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.36
+ '''
+ SELECT "posthog_team"."id" AS "id"
+ FROM "posthog_team"
+ WHERE ("posthog_team"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_team"."receive_org_level_activity_logs")
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.360
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -21437,7 +20692,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.379
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.361
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -21483,194 +20738,147 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.38
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.362
'''
- SELECT "posthog_user"."id",
- "posthog_user"."password",
- "posthog_user"."last_login",
- "posthog_user"."first_name",
- "posthog_user"."last_name",
- "posthog_user"."is_staff",
- "posthog_user"."date_joined",
- "posthog_user"."uuid",
- "posthog_user"."current_organization_id",
- "posthog_user"."current_team_id",
- "posthog_user"."email",
- "posthog_user"."pending_email",
- "posthog_user"."distinct_id",
- "posthog_user"."is_email_verified",
- "posthog_user"."credentials_reviewed_at",
- "posthog_user"."requested_2fa_reset_at",
- "posthog_user"."has_seen_product_intro_for",
- "posthog_user"."strapi_id",
- "posthog_user"."is_active",
- "posthog_user"."role_at_organization",
- "posthog_user"."theme_mode",
- "posthog_user"."partial_notification_settings",
- "posthog_user"."anonymize_data",
- "posthog_user"."allow_impersonation",
- "posthog_user"."toolbar_mode",
- "posthog_user"."hedgehog_config",
- "posthog_user"."allow_sidebar_suggestions",
- "posthog_user"."shortcut_position",
- "posthog_user"."passkeys_enabled_for_2fa",
- "posthog_user"."hide_mcp_hints",
- "posthog_user"."ui_configuration",
- "posthog_user"."onboarding_skipped_at",
- "posthog_user"."onboarding_skipped_reason",
- "posthog_user"."onboarding_skipped_organization_id",
- "posthog_user"."onboarding_delegated_to_invite_id",
- "posthog_user"."onboarding_delegated_to_organization_id",
- "posthog_user"."onboarding_delegation_accepted_at",
- "posthog_user"."events_column_config",
- "posthog_user"."email_opt_in"
- FROM "posthog_user"
- WHERE "posthog_user"."id" = 99999
- ORDER BY "posthog_user"."id" ASC
- LIMIT 1
+ SELECT "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_organization"
+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.380
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.363
'''
- SELECT "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
- LIMIT 21
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.381
- '''
- SELECT "posthog_team"."id",
- "posthog_team"."uuid",
- "posthog_team"."organization_id",
- "posthog_team"."parent_team_id",
- "posthog_team"."project_id",
- "posthog_team"."api_token",
- "posthog_team"."app_urls",
- "posthog_team"."name",
- "posthog_team"."slack_incoming_webhook",
- "posthog_team"."created_at",
- "posthog_team"."updated_at",
- "posthog_team"."anonymize_ips",
- "posthog_team"."completed_snippet_onboarding",
- "posthog_team"."has_completed_onboarding_for",
- "posthog_team"."onboarding_tasks",
- "posthog_team"."ingested_event",
- "posthog_team"."ingested_production_event",
- "posthog_team"."ingested_production_event_last_checked_at",
- "posthog_team"."person_processing_opt_out",
- "posthog_team"."secret_api_token",
- "posthog_team"."secret_api_token_backup",
- "posthog_team"."session_recording_opt_in",
- "posthog_team"."session_recording_sample_rate",
- "posthog_team"."session_recording_minimum_duration_milliseconds",
- "posthog_team"."session_recording_linked_flag",
- "posthog_team"."session_recording_network_payload_capture_config",
- "posthog_team"."session_recording_masking_config",
- "posthog_team"."session_recording_url_trigger_config",
- "posthog_team"."session_recording_url_blocklist_config",
- "posthog_team"."session_recording_event_trigger_config",
- "posthog_team"."session_recording_trigger_match_type_config",
- "posthog_team"."session_recording_trigger_groups",
- "posthog_team"."session_replay_config",
- "posthog_team"."session_recording_retention_period",
- "posthog_team"."event_retention_months",
- "posthog_team"."conversations_enabled",
- "posthog_team"."conversations_settings",
- "posthog_team"."proactive_tasks_enabled",
- "posthog_team"."survey_config",
- "posthog_team"."surveys_opt_in",
- "posthog_team"."product_tours_opt_in",
- "posthog_team"."capture_console_log_opt_in",
- "posthog_team"."capture_performance_opt_in",
- "posthog_team"."capture_dead_clicks",
- "posthog_team"."autocapture_opt_out",
- "posthog_team"."autocapture_web_vitals_opt_in",
- "posthog_team"."autocapture_web_vitals_allowed_metrics",
- "posthog_team"."autocapture_exceptions_opt_in",
- "posthog_team"."autocapture_exceptions_errors_to_ignore",
- "posthog_team"."logs_settings",
- "posthog_team"."llm_gateway_enabled_at",
- "posthog_team"."llm_gateway_revoked_at",
- "posthog_team"."llm_gateway_overspend_allowance_usd",
- "posthog_team"."heatmaps_opt_in",
- "posthog_team"."receive_org_level_activity_logs",
- "posthog_team"."web_analytics_pre_aggregated_tables_enabled",
- "posthog_team"."web_analytics_pre_aggregated_tables_version",
- "posthog_team"."flags_persistence_default",
- "posthog_team"."feature_flag_confirmation_enabled",
- "posthog_team"."feature_flag_confirmation_message",
- "posthog_team"."default_evaluation_environments_enabled",
- "posthog_team"."require_evaluation_environment_tags",
- "posthog_team"."default_evaluation_contexts_enabled",
- "posthog_team"."require_evaluation_contexts",
- "posthog_team"."session_recording_version",
- "posthog_team"."signup_token",
- "posthog_team"."is_demo",
- "posthog_team"."access_control",
- "posthog_team"."week_start_day",
- "posthog_team"."inject_web_apps",
- "posthog_team"."test_account_filters",
- "posthog_team"."test_account_filters_default_checked",
- "posthog_team"."path_cleaning_filters",
- "posthog_team"."timezone",
- "posthog_team"."data_attributes",
- "posthog_team"."person_display_name_properties",
- "posthog_team"."live_events_columns",
- "posthog_team"."recording_domains",
- "posthog_team"."human_friendly_comparison_periods",
- "posthog_team"."cookieless_server_hash_mode",
- "posthog_team"."primary_dashboard_id",
- "posthog_team"."default_data_theme",
- "posthog_team"."extra_settings",
- "posthog_team"."modifiers",
- "posthog_team"."correlation_config",
- "posthog_team"."session_recording_retention_period_days",
- "posthog_team"."external_data_workspace_id",
- "posthog_team"."external_data_workspace_last_synced_at",
- "posthog_team"."api_query_rate_limit",
- "posthog_team"."drop_events_older_than",
- "posthog_team"."base_currency",
- "posthog_team"."business_model",
- "posthog_organization"."id",
+ SELECT "posthog_team"."id",
+ "posthog_team"."uuid",
+ "posthog_team"."organization_id",
+ "posthog_team"."parent_team_id",
+ "posthog_team"."project_id",
+ "posthog_team"."api_token",
+ "posthog_team"."app_urls",
+ "posthog_team"."name",
+ "posthog_team"."slack_incoming_webhook",
+ "posthog_team"."created_at",
+ "posthog_team"."updated_at",
+ "posthog_team"."anonymize_ips",
+ "posthog_team"."completed_snippet_onboarding",
+ "posthog_team"."has_completed_onboarding_for",
+ "posthog_team"."onboarding_tasks",
+ "posthog_team"."ingested_event",
+ "posthog_team"."ingested_production_event",
+ "posthog_team"."ingested_production_event_last_checked_at",
+ "posthog_team"."person_processing_opt_out",
+ "posthog_team"."secret_api_token",
+ "posthog_team"."secret_api_token_backup",
+ "posthog_team"."session_recording_opt_in",
+ "posthog_team"."session_recording_sample_rate",
+ "posthog_team"."session_recording_minimum_duration_milliseconds",
+ "posthog_team"."session_recording_linked_flag",
+ "posthog_team"."session_recording_network_payload_capture_config",
+ "posthog_team"."session_recording_masking_config",
+ "posthog_team"."session_recording_url_trigger_config",
+ "posthog_team"."session_recording_url_blocklist_config",
+ "posthog_team"."session_recording_event_trigger_config",
+ "posthog_team"."session_recording_trigger_match_type_config",
+ "posthog_team"."session_recording_trigger_groups",
+ "posthog_team"."session_replay_config",
+ "posthog_team"."session_recording_retention_period",
+ "posthog_team"."event_retention_months",
+ "posthog_team"."conversations_enabled",
+ "posthog_team"."conversations_settings",
+ "posthog_team"."proactive_tasks_enabled",
+ "posthog_team"."survey_config",
+ "posthog_team"."surveys_opt_in",
+ "posthog_team"."product_tours_opt_in",
+ "posthog_team"."capture_console_log_opt_in",
+ "posthog_team"."capture_performance_opt_in",
+ "posthog_team"."capture_dead_clicks",
+ "posthog_team"."autocapture_opt_out",
+ "posthog_team"."autocapture_web_vitals_opt_in",
+ "posthog_team"."autocapture_web_vitals_allowed_metrics",
+ "posthog_team"."autocapture_exceptions_opt_in",
+ "posthog_team"."autocapture_exceptions_errors_to_ignore",
+ "posthog_team"."logs_settings",
+ "posthog_team"."llm_gateway_enabled_at",
+ "posthog_team"."llm_gateway_revoked_at",
+ "posthog_team"."llm_gateway_overspend_allowance_usd",
+ "posthog_team"."heatmaps_opt_in",
+ "posthog_team"."receive_org_level_activity_logs",
+ "posthog_team"."web_analytics_pre_aggregated_tables_enabled",
+ "posthog_team"."web_analytics_pre_aggregated_tables_version",
+ "posthog_team"."flags_persistence_default",
+ "posthog_team"."feature_flag_confirmation_enabled",
+ "posthog_team"."feature_flag_confirmation_message",
+ "posthog_team"."default_evaluation_environments_enabled",
+ "posthog_team"."require_evaluation_environment_tags",
+ "posthog_team"."default_evaluation_contexts_enabled",
+ "posthog_team"."require_evaluation_contexts",
+ "posthog_team"."session_recording_version",
+ "posthog_team"."signup_token",
+ "posthog_team"."is_demo",
+ "posthog_team"."access_control",
+ "posthog_team"."week_start_day",
+ "posthog_team"."inject_web_apps",
+ "posthog_team"."test_account_filters",
+ "posthog_team"."test_account_filters_default_checked",
+ "posthog_team"."path_cleaning_filters",
+ "posthog_team"."timezone",
+ "posthog_team"."data_attributes",
+ "posthog_team"."person_display_name_properties",
+ "posthog_team"."live_events_columns",
+ "posthog_team"."recording_domains",
+ "posthog_team"."human_friendly_comparison_periods",
+ "posthog_team"."cookieless_server_hash_mode",
+ "posthog_team"."primary_dashboard_id",
+ "posthog_team"."default_data_theme",
+ "posthog_team"."extra_settings",
+ "posthog_team"."modifiers",
+ "posthog_team"."correlation_config",
+ "posthog_team"."session_recording_retention_period_days",
+ "posthog_team"."external_data_workspace_id",
+ "posthog_team"."external_data_workspace_last_synced_at",
+ "posthog_team"."api_query_rate_limit",
+ "posthog_team"."drop_events_older_than",
+ "posthog_team"."base_currency",
+ "posthog_team"."business_model",
+ "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -21715,7 +20923,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.382
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.364
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -21770,7 +20978,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.383
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.365
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -21793,7 +21001,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.384
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.366
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -21846,7 +21054,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.385
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.367
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboard"
@@ -21862,7 +21070,7 @@
AND NOT "posthog_dashboard"."deleted")
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.386
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.368
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -21961,7 +21169,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.387
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.369
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -21986,7 +21194,107 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.388
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.37
+ '''
+ SELECT "posthog_team"."id",
+ "posthog_team"."uuid",
+ "posthog_team"."organization_id",
+ "posthog_team"."parent_team_id",
+ "posthog_team"."project_id",
+ "posthog_team"."api_token",
+ "posthog_team"."app_urls",
+ "posthog_team"."name",
+ "posthog_team"."slack_incoming_webhook",
+ "posthog_team"."created_at",
+ "posthog_team"."updated_at",
+ "posthog_team"."anonymize_ips",
+ "posthog_team"."completed_snippet_onboarding",
+ "posthog_team"."has_completed_onboarding_for",
+ "posthog_team"."onboarding_tasks",
+ "posthog_team"."ingested_event",
+ "posthog_team"."ingested_production_event",
+ "posthog_team"."ingested_production_event_last_checked_at",
+ "posthog_team"."person_processing_opt_out",
+ "posthog_team"."secret_api_token",
+ "posthog_team"."secret_api_token_backup",
+ "posthog_team"."session_recording_opt_in",
+ "posthog_team"."session_recording_sample_rate",
+ "posthog_team"."session_recording_minimum_duration_milliseconds",
+ "posthog_team"."session_recording_linked_flag",
+ "posthog_team"."session_recording_network_payload_capture_config",
+ "posthog_team"."session_recording_masking_config",
+ "posthog_team"."session_recording_url_trigger_config",
+ "posthog_team"."session_recording_url_blocklist_config",
+ "posthog_team"."session_recording_event_trigger_config",
+ "posthog_team"."session_recording_trigger_match_type_config",
+ "posthog_team"."session_recording_trigger_groups",
+ "posthog_team"."session_replay_config",
+ "posthog_team"."session_recording_retention_period",
+ "posthog_team"."event_retention_months",
+ "posthog_team"."conversations_enabled",
+ "posthog_team"."conversations_settings",
+ "posthog_team"."proactive_tasks_enabled",
+ "posthog_team"."survey_config",
+ "posthog_team"."surveys_opt_in",
+ "posthog_team"."product_tours_opt_in",
+ "posthog_team"."capture_console_log_opt_in",
+ "posthog_team"."capture_performance_opt_in",
+ "posthog_team"."capture_dead_clicks",
+ "posthog_team"."autocapture_opt_out",
+ "posthog_team"."autocapture_web_vitals_opt_in",
+ "posthog_team"."autocapture_web_vitals_allowed_metrics",
+ "posthog_team"."autocapture_exceptions_opt_in",
+ "posthog_team"."autocapture_exceptions_errors_to_ignore",
+ "posthog_team"."logs_settings",
+ "posthog_team"."llm_gateway_enabled_at",
+ "posthog_team"."llm_gateway_revoked_at",
+ "posthog_team"."llm_gateway_overspend_allowance_usd",
+ "posthog_team"."heatmaps_opt_in",
+ "posthog_team"."receive_org_level_activity_logs",
+ "posthog_team"."web_analytics_pre_aggregated_tables_enabled",
+ "posthog_team"."web_analytics_pre_aggregated_tables_version",
+ "posthog_team"."flags_persistence_default",
+ "posthog_team"."feature_flag_confirmation_enabled",
+ "posthog_team"."feature_flag_confirmation_message",
+ "posthog_team"."default_evaluation_environments_enabled",
+ "posthog_team"."require_evaluation_environment_tags",
+ "posthog_team"."default_evaluation_contexts_enabled",
+ "posthog_team"."require_evaluation_contexts",
+ "posthog_team"."session_recording_version",
+ "posthog_team"."signup_token",
+ "posthog_team"."is_demo",
+ "posthog_team"."access_control",
+ "posthog_team"."week_start_day",
+ "posthog_team"."inject_web_apps",
+ "posthog_team"."test_account_filters",
+ "posthog_team"."test_account_filters_default_checked",
+ "posthog_team"."path_cleaning_filters",
+ "posthog_team"."timezone",
+ "posthog_team"."data_attributes",
+ "posthog_team"."person_display_name_properties",
+ "posthog_team"."live_events_columns",
+ "posthog_team"."recording_domains",
+ "posthog_team"."human_friendly_comparison_periods",
+ "posthog_team"."cookieless_server_hash_mode",
+ "posthog_team"."primary_dashboard_id",
+ "posthog_team"."default_data_theme",
+ "posthog_team"."extra_settings",
+ "posthog_team"."modifiers",
+ "posthog_team"."correlation_config",
+ "posthog_team"."session_recording_retention_period_days",
+ "posthog_team"."external_data_workspace_id",
+ "posthog_team"."external_data_workspace_last_synced_at",
+ "posthog_team"."api_query_rate_limit",
+ "posthog_team"."drop_events_older_than",
+ "posthog_team"."base_currency",
+ "posthog_team"."business_model"
+ FROM "posthog_team"
+ WHERE "posthog_team"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ ORDER BY "posthog_team"."id" ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.370
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -21998,7 +21306,7 @@
AND NOT ("posthog_dashboardtile"."insight_id" IS NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.389
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.371
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -22017,24 +21325,7 @@
WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.39
- '''
- SELECT "signals_signaluserautonomyconfig"."id",
- "signals_signaluserautonomyconfig"."user_id",
- "signals_signaluserautonomyconfig"."autostart_priority",
- "signals_signaluserautonomyconfig"."slack_notification_integration_id",
- "signals_signaluserautonomyconfig"."slack_notification_channel",
- "signals_signaluserautonomyconfig"."slack_notification_min_priority",
- "signals_signaluserautonomyconfig"."github_assign_on_pull_request",
- "signals_signaluserautonomyconfig"."github_open_pull_request_ready",
- "signals_signaluserautonomyconfig"."created_at",
- "signals_signaluserautonomyconfig"."updated_at"
- FROM "signals_signaluserautonomyconfig"
- WHERE "signals_signaluserautonomyconfig"."user_id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.390
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.372
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_taggeditem"
@@ -22042,7 +21333,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.391
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.373
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -22058,7 +21349,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.392
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.374
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -22074,7 +21365,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.393
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.375
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -22090,7 +21381,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.394
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.376
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -22109,7 +21400,7 @@
WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.395
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.377
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -22129,7 +21420,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.396
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.378
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -22487,7 +21778,7 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.397
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.379
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -22496,7 +21787,54 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.398
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.38
+ '''
+ SELECT "posthog_user"."id",
+ "posthog_user"."password",
+ "posthog_user"."last_login",
+ "posthog_user"."first_name",
+ "posthog_user"."last_name",
+ "posthog_user"."is_staff",
+ "posthog_user"."date_joined",
+ "posthog_user"."uuid",
+ "posthog_user"."current_organization_id",
+ "posthog_user"."current_team_id",
+ "posthog_user"."email",
+ "posthog_user"."pending_email",
+ "posthog_user"."distinct_id",
+ "posthog_user"."is_email_verified",
+ "posthog_user"."credentials_reviewed_at",
+ "posthog_user"."requested_2fa_reset_at",
+ "posthog_user"."has_seen_product_intro_for",
+ "posthog_user"."strapi_id",
+ "posthog_user"."is_active",
+ "posthog_user"."role_at_organization",
+ "posthog_user"."theme_mode",
+ "posthog_user"."partial_notification_settings",
+ "posthog_user"."anonymize_data",
+ "posthog_user"."allow_impersonation",
+ "posthog_user"."toolbar_mode",
+ "posthog_user"."hedgehog_config",
+ "posthog_user"."allow_sidebar_suggestions",
+ "posthog_user"."shortcut_position",
+ "posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
+ "posthog_user"."ui_configuration",
+ "posthog_user"."onboarding_skipped_at",
+ "posthog_user"."onboarding_skipped_reason",
+ "posthog_user"."onboarding_skipped_organization_id",
+ "posthog_user"."onboarding_delegated_to_invite_id",
+ "posthog_user"."onboarding_delegated_to_organization_id",
+ "posthog_user"."onboarding_delegation_accepted_at",
+ "posthog_user"."events_column_config",
+ "posthog_user"."email_opt_in"
+ FROM "posthog_user"
+ WHERE "posthog_user"."id" = 99999
+ ORDER BY "posthog_user"."id" ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.380
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -22542,7 +21880,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.399
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.381
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -22588,77 +21926,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.4
- '''
- SELECT "posthog_organizationmembernotificationlock"."id",
- "posthog_organizationmembernotificationlock"."organization_id",
- "posthog_organizationmembernotificationlock"."organization_membership_id",
- "posthog_organizationmembernotificationlock"."setting",
- "posthog_organizationmembernotificationlock"."scope_id",
- "posthog_organizationmembernotificationlock"."locked_value",
- "posthog_organizationmembernotificationlock"."created_by_id",
- "posthog_organizationmembernotificationlock"."created_at",
- "posthog_organizationmembernotificationlock"."updated_at"
- FROM "posthog_organizationmembernotificationlock"
- WHERE "posthog_organizationmembernotificationlock"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.40
- '''
- SELECT "posthog_organizationmembership"."id",
- "posthog_organizationmembership"."organization_id",
- "posthog_organizationmembership"."user_id",
- "posthog_organizationmembership"."level",
- "posthog_organizationmembership"."joined_at",
- "posthog_organizationmembership"."updated_at",
- "posthog_organizationmembership"."invited_by_id",
- "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organizationmembership"
- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_organizationmembership"."user_id" = 99999)
- LIMIT 21
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.400
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.382
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -22797,7 +22065,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.401
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.383
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -22852,7 +22120,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.402
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.384
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -22875,7 +22143,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.403
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.385
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -22928,7 +22196,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.404
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.386
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -22948,7 +22216,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.405
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.387
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -22961,7 +22229,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.406
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.388
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -22974,7 +22242,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.407
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.389
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -22991,7 +22259,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -23007,7 +22274,24 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.408
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.39
+ '''
+ SELECT "signals_signaluserautonomyconfig"."id",
+ "signals_signaluserautonomyconfig"."user_id",
+ "signals_signaluserautonomyconfig"."autostart_priority",
+ "signals_signaluserautonomyconfig"."slack_notification_integration_id",
+ "signals_signaluserautonomyconfig"."slack_notification_channel",
+ "signals_signaluserautonomyconfig"."slack_notification_min_priority",
+ "signals_signaluserautonomyconfig"."github_assign_on_pull_request",
+ "signals_signaluserautonomyconfig"."github_open_pull_request_ready",
+ "signals_signaluserautonomyconfig"."created_at",
+ "signals_signaluserautonomyconfig"."updated_at"
+ FROM "signals_signaluserautonomyconfig"
+ WHERE "signals_signaluserautonomyconfig"."user_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.390
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -23106,7 +22390,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.409
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.391
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -23152,105 +22436,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.41
- '''
- SELECT "posthog_team"."id",
- "posthog_team"."uuid",
- "posthog_team"."organization_id",
- "posthog_team"."parent_team_id",
- "posthog_team"."project_id",
- "posthog_team"."api_token",
- "posthog_team"."app_urls",
- "posthog_team"."name",
- "posthog_team"."slack_incoming_webhook",
- "posthog_team"."created_at",
- "posthog_team"."updated_at",
- "posthog_team"."anonymize_ips",
- "posthog_team"."completed_snippet_onboarding",
- "posthog_team"."has_completed_onboarding_for",
- "posthog_team"."onboarding_tasks",
- "posthog_team"."ingested_event",
- "posthog_team"."ingested_production_event",
- "posthog_team"."ingested_production_event_last_checked_at",
- "posthog_team"."person_processing_opt_out",
- "posthog_team"."secret_api_token",
- "posthog_team"."secret_api_token_backup",
- "posthog_team"."session_recording_opt_in",
- "posthog_team"."session_recording_sample_rate",
- "posthog_team"."session_recording_minimum_duration_milliseconds",
- "posthog_team"."session_recording_linked_flag",
- "posthog_team"."session_recording_network_payload_capture_config",
- "posthog_team"."session_recording_masking_config",
- "posthog_team"."session_recording_url_trigger_config",
- "posthog_team"."session_recording_url_blocklist_config",
- "posthog_team"."session_recording_event_trigger_config",
- "posthog_team"."session_recording_trigger_match_type_config",
- "posthog_team"."session_recording_trigger_groups",
- "posthog_team"."session_replay_config",
- "posthog_team"."session_recording_retention_period",
- "posthog_team"."event_retention_months",
- "posthog_team"."conversations_enabled",
- "posthog_team"."conversations_settings",
- "posthog_team"."proactive_tasks_enabled",
- "posthog_team"."survey_config",
- "posthog_team"."surveys_opt_in",
- "posthog_team"."product_tours_opt_in",
- "posthog_team"."capture_console_log_opt_in",
- "posthog_team"."capture_performance_opt_in",
- "posthog_team"."capture_dead_clicks",
- "posthog_team"."autocapture_opt_out",
- "posthog_team"."autocapture_web_vitals_opt_in",
- "posthog_team"."autocapture_web_vitals_allowed_metrics",
- "posthog_team"."autocapture_exceptions_opt_in",
- "posthog_team"."autocapture_exceptions_errors_to_ignore",
- "posthog_team"."logs_settings",
- "posthog_team"."llm_gateway_enabled_at",
- "posthog_team"."llm_gateway_revoked_at",
- "posthog_team"."llm_gateway_overspend_allowance_usd",
- "posthog_team"."heatmaps_opt_in",
- "posthog_team"."receive_org_level_activity_logs",
- "posthog_team"."web_analytics_pre_aggregated_tables_enabled",
- "posthog_team"."web_analytics_pre_aggregated_tables_version",
- "posthog_team"."flags_persistence_default",
- "posthog_team"."feature_flag_confirmation_enabled",
- "posthog_team"."feature_flag_confirmation_message",
- "posthog_team"."default_evaluation_environments_enabled",
- "posthog_team"."require_evaluation_environment_tags",
- "posthog_team"."default_evaluation_contexts_enabled",
- "posthog_team"."require_evaluation_contexts",
- "posthog_team"."session_recording_version",
- "posthog_team"."signup_token",
- "posthog_team"."is_demo",
- "posthog_team"."access_control",
- "posthog_team"."week_start_day",
- "posthog_team"."inject_web_apps",
- "posthog_team"."test_account_filters",
- "posthog_team"."test_account_filters_default_checked",
- "posthog_team"."path_cleaning_filters",
- "posthog_team"."timezone",
- "posthog_team"."data_attributes",
- "posthog_team"."person_display_name_properties",
- "posthog_team"."live_events_columns",
- "posthog_team"."recording_domains",
- "posthog_team"."human_friendly_comparison_periods",
- "posthog_team"."cookieless_server_hash_mode",
- "posthog_team"."primary_dashboard_id",
- "posthog_team"."default_data_theme",
- "posthog_team"."extra_settings",
- "posthog_team"."modifiers",
- "posthog_team"."correlation_config",
- "posthog_team"."session_recording_retention_period_days",
- "posthog_team"."external_data_workspace_id",
- "posthog_team"."external_data_workspace_last_synced_at",
- "posthog_team"."api_query_rate_limit",
- "posthog_team"."drop_events_older_than",
- "posthog_team"."base_currency",
- "posthog_team"."business_model"
- FROM "posthog_team"
- WHERE "posthog_team"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.410
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.392
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -23349,7 +22535,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.411
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.393
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -23374,7 +22560,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.412
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.394
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -23392,7 +22578,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.413
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.395
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -23438,7 +22624,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.414
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.396
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -23537,7 +22723,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.415
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.397
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -23566,7 +22752,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.416
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.398
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -23595,7 +22781,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.417
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.399
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -23615,7 +22801,77 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.418
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.4
+ '''
+ SELECT "posthog_organizationmembernotificationlock"."id",
+ "posthog_organizationmembernotificationlock"."organization_id",
+ "posthog_organizationmembernotificationlock"."organization_membership_id",
+ "posthog_organizationmembernotificationlock"."setting",
+ "posthog_organizationmembernotificationlock"."scope_id",
+ "posthog_organizationmembernotificationlock"."locked_value",
+ "posthog_organizationmembernotificationlock"."created_by_id",
+ "posthog_organizationmembernotificationlock"."created_at",
+ "posthog_organizationmembernotificationlock"."updated_at"
+ FROM "posthog_organizationmembernotificationlock"
+ WHERE "posthog_organizationmembernotificationlock"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.40
+ '''
+ SELECT "posthog_organizationmembership"."id",
+ "posthog_organizationmembership"."organization_id",
+ "posthog_organizationmembership"."user_id",
+ "posthog_organizationmembership"."level",
+ "posthog_organizationmembership"."joined_at",
+ "posthog_organizationmembership"."updated_at",
+ "posthog_organizationmembership"."invited_by_id",
+ "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_organizationmembership"
+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_organizationmembership"."user_id" = 99999)
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.400
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -23628,7 +22884,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.419
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.401
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -23644,21 +22900,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.42
- '''
- SELECT 1 AS "a"
- FROM "posthog_filesystemshortcut"
- INNER JOIN "posthog_team" ON ("posthog_filesystemshortcut"."team_id" = "posthog_team"."id")
- WHERE (("posthog_filesystemshortcut"."surface" IS NULL
- OR "posthog_filesystemshortcut"."surface" = 'web')
- AND "posthog_team"."project_id" = 99999
- AND "posthog_filesystemshortcut"."user_id" = 99999
- AND "posthog_filesystemshortcut"."ref" IS NULL
- AND NOT ("posthog_filesystemshortcut"."type" = 'folder'))
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.420
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.402
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -23675,51 +22917,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.421
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.422
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.423
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.403
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -23728,7 +22926,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.424
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.404
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -23774,7 +22972,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.425
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.405
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -23820,7 +23018,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.426
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.406
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -23959,7 +23157,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.427
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.407
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -24014,7 +23212,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.428
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.408
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -24037,7 +23235,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.429
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.409
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -24090,10 +23288,105 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.43
- "SELECT pg_advisory_xact_lock(hashtextextended('file-system-shortcuts:99999:99999', 99999))"
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.41
+ '''
+ SELECT "posthog_team"."id",
+ "posthog_team"."uuid",
+ "posthog_team"."organization_id",
+ "posthog_team"."parent_team_id",
+ "posthog_team"."project_id",
+ "posthog_team"."api_token",
+ "posthog_team"."app_urls",
+ "posthog_team"."name",
+ "posthog_team"."slack_incoming_webhook",
+ "posthog_team"."created_at",
+ "posthog_team"."updated_at",
+ "posthog_team"."anonymize_ips",
+ "posthog_team"."completed_snippet_onboarding",
+ "posthog_team"."has_completed_onboarding_for",
+ "posthog_team"."onboarding_tasks",
+ "posthog_team"."ingested_event",
+ "posthog_team"."ingested_production_event",
+ "posthog_team"."ingested_production_event_last_checked_at",
+ "posthog_team"."person_processing_opt_out",
+ "posthog_team"."secret_api_token",
+ "posthog_team"."secret_api_token_backup",
+ "posthog_team"."session_recording_opt_in",
+ "posthog_team"."session_recording_sample_rate",
+ "posthog_team"."session_recording_minimum_duration_milliseconds",
+ "posthog_team"."session_recording_linked_flag",
+ "posthog_team"."session_recording_network_payload_capture_config",
+ "posthog_team"."session_recording_masking_config",
+ "posthog_team"."session_recording_url_trigger_config",
+ "posthog_team"."session_recording_url_blocklist_config",
+ "posthog_team"."session_recording_event_trigger_config",
+ "posthog_team"."session_recording_trigger_match_type_config",
+ "posthog_team"."session_recording_trigger_groups",
+ "posthog_team"."session_replay_config",
+ "posthog_team"."session_recording_retention_period",
+ "posthog_team"."event_retention_months",
+ "posthog_team"."conversations_enabled",
+ "posthog_team"."conversations_settings",
+ "posthog_team"."proactive_tasks_enabled",
+ "posthog_team"."survey_config",
+ "posthog_team"."surveys_opt_in",
+ "posthog_team"."product_tours_opt_in",
+ "posthog_team"."capture_console_log_opt_in",
+ "posthog_team"."capture_performance_opt_in",
+ "posthog_team"."capture_dead_clicks",
+ "posthog_team"."autocapture_opt_out",
+ "posthog_team"."autocapture_web_vitals_opt_in",
+ "posthog_team"."autocapture_web_vitals_allowed_metrics",
+ "posthog_team"."autocapture_exceptions_opt_in",
+ "posthog_team"."autocapture_exceptions_errors_to_ignore",
+ "posthog_team"."logs_settings",
+ "posthog_team"."llm_gateway_enabled_at",
+ "posthog_team"."llm_gateway_revoked_at",
+ "posthog_team"."llm_gateway_overspend_allowance_usd",
+ "posthog_team"."heatmaps_opt_in",
+ "posthog_team"."receive_org_level_activity_logs",
+ "posthog_team"."web_analytics_pre_aggregated_tables_enabled",
+ "posthog_team"."web_analytics_pre_aggregated_tables_version",
+ "posthog_team"."flags_persistence_default",
+ "posthog_team"."feature_flag_confirmation_enabled",
+ "posthog_team"."feature_flag_confirmation_message",
+ "posthog_team"."default_evaluation_environments_enabled",
+ "posthog_team"."require_evaluation_environment_tags",
+ "posthog_team"."default_evaluation_contexts_enabled",
+ "posthog_team"."require_evaluation_contexts",
+ "posthog_team"."session_recording_version",
+ "posthog_team"."signup_token",
+ "posthog_team"."is_demo",
+ "posthog_team"."access_control",
+ "posthog_team"."week_start_day",
+ "posthog_team"."inject_web_apps",
+ "posthog_team"."test_account_filters",
+ "posthog_team"."test_account_filters_default_checked",
+ "posthog_team"."path_cleaning_filters",
+ "posthog_team"."timezone",
+ "posthog_team"."data_attributes",
+ "posthog_team"."person_display_name_properties",
+ "posthog_team"."live_events_columns",
+ "posthog_team"."recording_domains",
+ "posthog_team"."human_friendly_comparison_periods",
+ "posthog_team"."cookieless_server_hash_mode",
+ "posthog_team"."primary_dashboard_id",
+ "posthog_team"."default_data_theme",
+ "posthog_team"."extra_settings",
+ "posthog_team"."modifiers",
+ "posthog_team"."correlation_config",
+ "posthog_team"."session_recording_retention_period_days",
+ "posthog_team"."external_data_workspace_id",
+ "posthog_team"."external_data_workspace_last_synced_at",
+ "posthog_team"."api_query_rate_limit",
+ "posthog_team"."drop_events_older_than",
+ "posthog_team"."base_currency",
+ "posthog_team"."business_model"
+ FROM "posthog_team"
+ WHERE "posthog_team"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.430
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.410
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -24113,7 +23406,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.431
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.411
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -24126,7 +23419,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.432
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.412
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -24139,7 +23432,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.433
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.413
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -24156,7 +23449,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -24172,7 +23464,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.434
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.414
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -24271,7 +23563,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.435
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.415
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -24317,7 +23609,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.436
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.416
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -24416,7 +23708,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.437
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.417
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -24441,7 +23733,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.438
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.418
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -24459,7 +23751,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.439
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.419
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -24505,9 +23797,9 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.44
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.42
'''
- SELECT "posthog_filesystemshortcut"."path" AS "path"
+ SELECT 1 AS "a"
FROM "posthog_filesystemshortcut"
INNER JOIN "posthog_team" ON ("posthog_filesystemshortcut"."team_id" = "posthog_team"."id")
WHERE (("posthog_filesystemshortcut"."surface" IS NULL
@@ -24516,9 +23808,10 @@
AND "posthog_filesystemshortcut"."user_id" = 99999
AND "posthog_filesystemshortcut"."ref" IS NULL
AND NOT ("posthog_filesystemshortcut"."type" = 'folder'))
+ LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.440
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.420
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -24617,7 +23910,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.441
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.421
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -24646,7 +23939,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.442
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.422
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -24675,7 +23968,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.443
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.423
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -24695,7 +23988,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.444
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.424
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -24708,7 +24001,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.445
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.425
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -24724,7 +24017,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.446
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.426
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -24741,51 +24034,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.447
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.448
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.449
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.427
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -24794,18 +24043,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.45
- '''
- SELECT "posthog_filesystemshortcut"."order" AS "order"
- FROM "posthog_filesystemshortcut"
- INNER JOIN "posthog_team" ON ("posthog_filesystemshortcut"."team_id" = "posthog_team"."id")
- WHERE (("posthog_filesystemshortcut"."surface" IS NULL
- OR "posthog_filesystemshortcut"."surface" = 'web')
- AND "posthog_team"."project_id" = 99999
- AND "posthog_filesystemshortcut"."user_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.450
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.428
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -24851,7 +24089,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.451
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.429
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -24897,7 +24135,10 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.452
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.43
+ "SELECT pg_advisory_xact_lock(hashtextextended('file-system-shortcuts:99999:99999', 99999))"
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.430
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -25036,7 +24277,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.453
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.431
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -25091,7 +24332,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.454
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.432
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -25114,7 +24355,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.455
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.433
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -25167,7 +24408,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.456
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.434
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -25187,7 +24428,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.457
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.435
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -25200,7 +24441,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.458
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.436
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -25213,7 +24454,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.459
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.437
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -25230,7 +24471,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -25246,22 +24486,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.46
- '''
- SELECT "posthog_organizationmembership"."id",
- "posthog_organizationmembership"."organization_id",
- "posthog_organizationmembership"."user_id",
- "posthog_organizationmembership"."level",
- "posthog_organizationmembership"."joined_at",
- "posthog_organizationmembership"."updated_at",
- "posthog_organizationmembership"."invited_by_id"
- FROM "posthog_organizationmembership"
- WHERE "posthog_organizationmembership"."user_id" = 99999
- ORDER BY "posthog_organizationmembership"."id" ASC
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.460
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.438
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -25360,7 +24585,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.461
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.439
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -25406,7 +24631,20 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.462
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.44
+ '''
+ SELECT "posthog_filesystemshortcut"."path" AS "path"
+ FROM "posthog_filesystemshortcut"
+ INNER JOIN "posthog_team" ON ("posthog_filesystemshortcut"."team_id" = "posthog_team"."id")
+ WHERE (("posthog_filesystemshortcut"."surface" IS NULL
+ OR "posthog_filesystemshortcut"."surface" = 'web')
+ AND "posthog_team"."project_id" = 99999
+ AND "posthog_filesystemshortcut"."user_id" = 99999
+ AND "posthog_filesystemshortcut"."ref" IS NULL
+ AND NOT ("posthog_filesystemshortcut"."type" = 'folder'))
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.440
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -25505,7 +24743,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.463
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.441
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -25530,7 +24768,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.464
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.442
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -25548,7 +24786,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.465
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.443
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -25594,7 +24832,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.466
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.444
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -25693,7 +24931,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.467
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.445
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -25722,7 +24960,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.468
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.446
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -25751,7 +24989,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.469
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.447
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -25771,21 +25009,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.47
- '''
- SELECT 1 AS "a"
- FROM "posthog_filesystemshortcut"
- INNER JOIN "posthog_team" ON ("posthog_filesystemshortcut"."team_id" = "posthog_team"."id")
- WHERE (("posthog_filesystemshortcut"."surface" IS NULL
- OR "posthog_filesystemshortcut"."surface" = 'web')
- AND "posthog_team"."project_id" = 99999
- AND "posthog_filesystemshortcut"."user_id" = 99999
- AND "posthog_filesystemshortcut"."ref" IS NULL
- AND NOT ("posthog_filesystemshortcut"."type" = 'folder'))
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.470
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.448
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -25798,7 +25022,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.471
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.449
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -25814,7 +25038,18 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.472
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.45
+ '''
+ SELECT "posthog_filesystemshortcut"."order" AS "order"
+ FROM "posthog_filesystemshortcut"
+ INNER JOIN "posthog_team" ON ("posthog_filesystemshortcut"."team_id" = "posthog_team"."id")
+ WHERE (("posthog_filesystemshortcut"."surface" IS NULL
+ OR "posthog_filesystemshortcut"."surface" = 'web')
+ AND "posthog_team"."project_id" = 99999
+ AND "posthog_filesystemshortcut"."user_id" = 99999)
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.450
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -25831,51 +25066,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.473
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.474
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.475
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.451
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -25884,7 +25075,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.476
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.452
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -25930,7 +25121,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.477
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.453
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -25976,7 +25167,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.478
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.454
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -26115,7 +25306,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.479
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.455
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -26170,16 +25361,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.48
- '''
- SELECT "posthog_team"."organization_id" AS "organization_id"
- FROM "posthog_team"
- WHERE "posthog_team"."id" = 99999
- ORDER BY "posthog_team"."id" ASC
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.480
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.456
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -26202,7 +25384,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.481
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.457
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -26255,7 +25437,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.482
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.458
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboard"
@@ -26269,7 +25451,7 @@
AND NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.483
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.459
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -26286,7 +25468,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -26375,7 +25556,22 @@
LIMIT 300
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.484
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.46
+ '''
+ SELECT "posthog_organizationmembership"."id",
+ "posthog_organizationmembership"."organization_id",
+ "posthog_organizationmembership"."user_id",
+ "posthog_organizationmembership"."level",
+ "posthog_organizationmembership"."joined_at",
+ "posthog_organizationmembership"."updated_at",
+ "posthog_organizationmembership"."invited_by_id"
+ FROM "posthog_organizationmembership"
+ WHERE "posthog_organizationmembership"."user_id" = 99999
+ ORDER BY "posthog_organizationmembership"."id" ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.460
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -26398,7 +25594,7 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.485
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.461
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -26419,7 +25615,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.486
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.462
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -26465,7 +25661,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.487
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.463
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -26511,7 +25707,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.488
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.464
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -26650,7 +25846,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.489
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.465
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -26705,15 +25901,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.49
- '''
- SELECT "posthog_team"."id" AS "id"
- FROM "posthog_team"
- WHERE ("posthog_team"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_team"."receive_org_level_activity_logs")
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.490
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.466
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -26736,7 +25924,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.491
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.467
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -26789,7 +25977,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.492
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.468
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboard"
@@ -26805,7 +25993,7 @@
AND NOT "posthog_dashboard"."deleted")
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.493
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.469
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -26904,7 +26092,21 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.494
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.47
+ '''
+ SELECT 1 AS "a"
+ FROM "posthog_filesystemshortcut"
+ INNER JOIN "posthog_team" ON ("posthog_filesystemshortcut"."team_id" = "posthog_team"."id")
+ WHERE (("posthog_filesystemshortcut"."surface" IS NULL
+ OR "posthog_filesystemshortcut"."surface" = 'web')
+ AND "posthog_team"."project_id" = 99999
+ AND "posthog_filesystemshortcut"."user_id" = 99999
+ AND "posthog_filesystemshortcut"."ref" IS NULL
+ AND NOT ("posthog_filesystemshortcut"."type" = 'folder'))
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.470
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -26929,7 +26131,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.495
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.471
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -26941,7 +26143,7 @@
AND NOT ("posthog_dashboardtile"."insight_id" IS NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.496
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.472
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -26960,7 +26162,7 @@
WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.497
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.473
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_taggeditem"
@@ -26968,7 +26170,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.498
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.474
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -26984,7 +26186,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.499
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.475
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -27000,68 +26202,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.5
- '''
- SELECT "posthog_organizationmembernotificationlock"."id",
- "posthog_organizationmembernotificationlock"."organization_id",
- "posthog_organizationmembernotificationlock"."organization_membership_id",
- "posthog_organizationmembernotificationlock"."setting",
- "posthog_organizationmembernotificationlock"."scope_id",
- "posthog_organizationmembernotificationlock"."locked_value",
- "posthog_organizationmembernotificationlock"."created_by_id",
- "posthog_organizationmembernotificationlock"."created_at",
- "posthog_organizationmembernotificationlock"."updated_at"
- FROM "posthog_organizationmembernotificationlock"
- WHERE "posthog_organizationmembernotificationlock"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.50
- '''
- SELECT "posthog_user"."id",
- "posthog_user"."password",
- "posthog_user"."last_login",
- "posthog_user"."first_name",
- "posthog_user"."last_name",
- "posthog_user"."is_staff",
- "posthog_user"."date_joined",
- "posthog_user"."uuid",
- "posthog_user"."current_organization_id",
- "posthog_user"."current_team_id",
- "posthog_user"."email",
- "posthog_user"."pending_email",
- "posthog_user"."distinct_id",
- "posthog_user"."is_email_verified",
- "posthog_user"."credentials_reviewed_at",
- "posthog_user"."requested_2fa_reset_at",
- "posthog_user"."has_seen_product_intro_for",
- "posthog_user"."strapi_id",
- "posthog_user"."is_active",
- "posthog_user"."role_at_organization",
- "posthog_user"."theme_mode",
- "posthog_user"."partial_notification_settings",
- "posthog_user"."anonymize_data",
- "posthog_user"."allow_impersonation",
- "posthog_user"."toolbar_mode",
- "posthog_user"."hedgehog_config",
- "posthog_user"."allow_sidebar_suggestions",
- "posthog_user"."shortcut_position",
- "posthog_user"."passkeys_enabled_for_2fa",
- "posthog_user"."hide_mcp_hints",
- "posthog_user"."ui_configuration",
- "posthog_user"."onboarding_skipped_at",
- "posthog_user"."onboarding_skipped_reason",
- "posthog_user"."onboarding_skipped_organization_id",
- "posthog_user"."onboarding_delegated_to_invite_id",
- "posthog_user"."onboarding_delegated_to_organization_id",
- "posthog_user"."onboarding_delegation_accepted_at",
- "posthog_user"."events_column_config",
- "posthog_user"."email_opt_in"
- FROM "posthog_user"
- WHERE ("posthog_user"."is_active"
- AND "posthog_user"."id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.500
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.476
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -27077,7 +26218,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.501
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.477
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -27096,7 +26237,7 @@
WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.502
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.478
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -27116,7 +26257,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.503
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.479
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -27474,7 +26615,16 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.504
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.48
+ '''
+ SELECT "posthog_team"."organization_id" AS "organization_id"
+ FROM "posthog_team"
+ WHERE "posthog_team"."id" = 99999
+ ORDER BY "posthog_team"."id" ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.480
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -27483,7 +26633,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.505
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.481
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -27529,7 +26679,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.506
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.482
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -27575,7 +26725,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.507
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.483
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -27714,7 +26864,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.508
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.484
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -27769,7 +26919,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.509
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.485
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -27792,53 +26942,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.51
- '''
- SELECT "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
- LIMIT 21
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.510
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.486
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -27891,7 +26995,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.511
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.487
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -27911,7 +27015,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.512
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.488
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -27924,7 +27028,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.513
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.489
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -27937,7 +27041,15 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.514
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.49
+ '''
+ SELECT "posthog_team"."id" AS "id"
+ FROM "posthog_team"
+ WHERE ("posthog_team"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_team"."receive_org_level_activity_logs")
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.490
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -27954,7 +27066,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -27970,7 +27081,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.515
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.491
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -28069,7 +27180,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.516
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.492
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -28115,7 +27226,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.517
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.493
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -28214,7 +27325,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.518
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.494
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -28239,7 +27350,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.519
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.495
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -28257,192 +27368,53 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.52
- '''
- SELECT "posthog_team"."id",
- "posthog_team"."uuid",
- "posthog_team"."organization_id",
- "posthog_team"."parent_team_id",
- "posthog_team"."project_id",
- "posthog_team"."api_token",
- "posthog_team"."app_urls",
- "posthog_team"."name",
- "posthog_team"."slack_incoming_webhook",
- "posthog_team"."created_at",
- "posthog_team"."updated_at",
- "posthog_team"."anonymize_ips",
- "posthog_team"."completed_snippet_onboarding",
- "posthog_team"."has_completed_onboarding_for",
- "posthog_team"."onboarding_tasks",
- "posthog_team"."ingested_event",
- "posthog_team"."ingested_production_event",
- "posthog_team"."ingested_production_event_last_checked_at",
- "posthog_team"."person_processing_opt_out",
- "posthog_team"."secret_api_token",
- "posthog_team"."secret_api_token_backup",
- "posthog_team"."session_recording_opt_in",
- "posthog_team"."session_recording_sample_rate",
- "posthog_team"."session_recording_minimum_duration_milliseconds",
- "posthog_team"."session_recording_linked_flag",
- "posthog_team"."session_recording_network_payload_capture_config",
- "posthog_team"."session_recording_masking_config",
- "posthog_team"."session_recording_url_trigger_config",
- "posthog_team"."session_recording_url_blocklist_config",
- "posthog_team"."session_recording_event_trigger_config",
- "posthog_team"."session_recording_trigger_match_type_config",
- "posthog_team"."session_recording_trigger_groups",
- "posthog_team"."session_replay_config",
- "posthog_team"."session_recording_retention_period",
- "posthog_team"."event_retention_months",
- "posthog_team"."conversations_enabled",
- "posthog_team"."conversations_settings",
- "posthog_team"."proactive_tasks_enabled",
- "posthog_team"."survey_config",
- "posthog_team"."surveys_opt_in",
- "posthog_team"."product_tours_opt_in",
- "posthog_team"."capture_console_log_opt_in",
- "posthog_team"."capture_performance_opt_in",
- "posthog_team"."capture_dead_clicks",
- "posthog_team"."autocapture_opt_out",
- "posthog_team"."autocapture_web_vitals_opt_in",
- "posthog_team"."autocapture_web_vitals_allowed_metrics",
- "posthog_team"."autocapture_exceptions_opt_in",
- "posthog_team"."autocapture_exceptions_errors_to_ignore",
- "posthog_team"."logs_settings",
- "posthog_team"."llm_gateway_enabled_at",
- "posthog_team"."llm_gateway_revoked_at",
- "posthog_team"."llm_gateway_overspend_allowance_usd",
- "posthog_team"."heatmaps_opt_in",
- "posthog_team"."receive_org_level_activity_logs",
- "posthog_team"."web_analytics_pre_aggregated_tables_enabled",
- "posthog_team"."web_analytics_pre_aggregated_tables_version",
- "posthog_team"."flags_persistence_default",
- "posthog_team"."feature_flag_confirmation_enabled",
- "posthog_team"."feature_flag_confirmation_message",
- "posthog_team"."default_evaluation_environments_enabled",
- "posthog_team"."require_evaluation_environment_tags",
- "posthog_team"."default_evaluation_contexts_enabled",
- "posthog_team"."require_evaluation_contexts",
- "posthog_team"."session_recording_version",
- "posthog_team"."signup_token",
- "posthog_team"."is_demo",
- "posthog_team"."access_control",
- "posthog_team"."week_start_day",
- "posthog_team"."inject_web_apps",
- "posthog_team"."test_account_filters",
- "posthog_team"."test_account_filters_default_checked",
- "posthog_team"."path_cleaning_filters",
- "posthog_team"."timezone",
- "posthog_team"."data_attributes",
- "posthog_team"."person_display_name_properties",
- "posthog_team"."live_events_columns",
- "posthog_team"."recording_domains",
- "posthog_team"."human_friendly_comparison_periods",
- "posthog_team"."cookieless_server_hash_mode",
- "posthog_team"."primary_dashboard_id",
- "posthog_team"."default_data_theme",
- "posthog_team"."extra_settings",
- "posthog_team"."modifiers",
- "posthog_team"."correlation_config",
- "posthog_team"."session_recording_retention_period_days",
- "posthog_team"."external_data_workspace_id",
- "posthog_team"."external_data_workspace_last_synced_at",
- "posthog_team"."api_query_rate_limit",
- "posthog_team"."drop_events_older_than",
- "posthog_team"."base_currency",
- "posthog_team"."business_model",
- "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_team"
- INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
- WHERE "posthog_team"."id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.520
- '''
- SELECT "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
- LIMIT 21
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.521
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.496
+ '''
+ SELECT "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_organization"
+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.497
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -28541,7 +27513,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.522
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.498
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -28570,7 +27542,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.523
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.499
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -28599,7 +27571,68 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.524
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.5
+ '''
+ SELECT "posthog_organizationmembernotificationlock"."id",
+ "posthog_organizationmembernotificationlock"."organization_id",
+ "posthog_organizationmembernotificationlock"."organization_membership_id",
+ "posthog_organizationmembernotificationlock"."setting",
+ "posthog_organizationmembernotificationlock"."scope_id",
+ "posthog_organizationmembernotificationlock"."locked_value",
+ "posthog_organizationmembernotificationlock"."created_by_id",
+ "posthog_organizationmembernotificationlock"."created_at",
+ "posthog_organizationmembernotificationlock"."updated_at"
+ FROM "posthog_organizationmembernotificationlock"
+ WHERE "posthog_organizationmembernotificationlock"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.50
+ '''
+ SELECT "posthog_user"."id",
+ "posthog_user"."password",
+ "posthog_user"."last_login",
+ "posthog_user"."first_name",
+ "posthog_user"."last_name",
+ "posthog_user"."is_staff",
+ "posthog_user"."date_joined",
+ "posthog_user"."uuid",
+ "posthog_user"."current_organization_id",
+ "posthog_user"."current_team_id",
+ "posthog_user"."email",
+ "posthog_user"."pending_email",
+ "posthog_user"."distinct_id",
+ "posthog_user"."is_email_verified",
+ "posthog_user"."credentials_reviewed_at",
+ "posthog_user"."requested_2fa_reset_at",
+ "posthog_user"."has_seen_product_intro_for",
+ "posthog_user"."strapi_id",
+ "posthog_user"."is_active",
+ "posthog_user"."role_at_organization",
+ "posthog_user"."theme_mode",
+ "posthog_user"."partial_notification_settings",
+ "posthog_user"."anonymize_data",
+ "posthog_user"."allow_impersonation",
+ "posthog_user"."toolbar_mode",
+ "posthog_user"."hedgehog_config",
+ "posthog_user"."allow_sidebar_suggestions",
+ "posthog_user"."shortcut_position",
+ "posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
+ "posthog_user"."ui_configuration",
+ "posthog_user"."onboarding_skipped_at",
+ "posthog_user"."onboarding_skipped_reason",
+ "posthog_user"."onboarding_skipped_organization_id",
+ "posthog_user"."onboarding_delegated_to_invite_id",
+ "posthog_user"."onboarding_delegated_to_organization_id",
+ "posthog_user"."onboarding_delegation_accepted_at",
+ "posthog_user"."events_column_config",
+ "posthog_user"."email_opt_in"
+ FROM "posthog_user"
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.500
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -28619,7 +27652,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.525
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.501
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -28632,7 +27665,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.526
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.502
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -28648,7 +27681,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.527
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.503
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -28665,106 +27698,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.528
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.529
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.53
- '''
- SELECT "posthog_organizationmembership"."id",
- "posthog_organizationmembership"."organization_id",
- "posthog_organizationmembership"."user_id",
- "posthog_organizationmembership"."level",
- "posthog_organizationmembership"."joined_at",
- "posthog_organizationmembership"."updated_at",
- "posthog_organizationmembership"."invited_by_id",
- "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organizationmembership"
- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_organizationmembership"."user_id" = 99999)
- LIMIT 21
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.530
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.504
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -28773,7 +27707,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.531
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.505
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -28819,7 +27753,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.532
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.506
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -28865,7 +27799,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.533
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.507
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -29004,7 +27938,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.534
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.508
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -29059,7 +27993,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.535
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.509
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -29082,7 +28016,53 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.536
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.51
+ '''
+ SELECT "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_organization"
+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.510
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -29135,7 +28115,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.537
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.511
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -29155,7 +28135,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.538
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.512
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -29168,7 +28148,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.539
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.513
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -29181,30 +28161,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.54
- '''
- SELECT "ee_accesscontrol"."id",
- "ee_accesscontrol"."team_id",
- "ee_accesscontrol"."access_level",
- "ee_accesscontrol"."resource",
- "ee_accesscontrol"."resource_id",
- "ee_accesscontrol"."organization_member_id",
- "ee_accesscontrol"."role_id",
- "ee_accesscontrol"."created_by_id",
- "ee_accesscontrol"."created_at",
- "ee_accesscontrol"."updated_at"
- FROM "ee_accesscontrol"
- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")
- WHERE (("ee_accesscontrol"."organization_member_id" IS NULL
- AND "ee_accesscontrol"."role_id" IS NULL
- AND "ee_accesscontrol"."team_id" = 99999)
- OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_organizationmembership"."user_id" = 99999
- AND "ee_accesscontrol"."role_id" IS NULL
- AND "ee_accesscontrol"."team_id" = 99999))
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.540
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.514
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -29221,7 +28178,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -29237,7 +28193,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.541
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.515
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -29336,7 +28292,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.542
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.516
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -29382,7 +28338,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.543
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.517
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -29481,7 +28437,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.544
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.518
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -29506,7 +28462,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.545
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.519
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -29524,7 +28480,146 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.546
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.52
+ '''
+ SELECT "posthog_team"."id",
+ "posthog_team"."uuid",
+ "posthog_team"."organization_id",
+ "posthog_team"."parent_team_id",
+ "posthog_team"."project_id",
+ "posthog_team"."api_token",
+ "posthog_team"."app_urls",
+ "posthog_team"."name",
+ "posthog_team"."slack_incoming_webhook",
+ "posthog_team"."created_at",
+ "posthog_team"."updated_at",
+ "posthog_team"."anonymize_ips",
+ "posthog_team"."completed_snippet_onboarding",
+ "posthog_team"."has_completed_onboarding_for",
+ "posthog_team"."onboarding_tasks",
+ "posthog_team"."ingested_event",
+ "posthog_team"."ingested_production_event",
+ "posthog_team"."ingested_production_event_last_checked_at",
+ "posthog_team"."person_processing_opt_out",
+ "posthog_team"."secret_api_token",
+ "posthog_team"."secret_api_token_backup",
+ "posthog_team"."session_recording_opt_in",
+ "posthog_team"."session_recording_sample_rate",
+ "posthog_team"."session_recording_minimum_duration_milliseconds",
+ "posthog_team"."session_recording_linked_flag",
+ "posthog_team"."session_recording_network_payload_capture_config",
+ "posthog_team"."session_recording_masking_config",
+ "posthog_team"."session_recording_url_trigger_config",
+ "posthog_team"."session_recording_url_blocklist_config",
+ "posthog_team"."session_recording_event_trigger_config",
+ "posthog_team"."session_recording_trigger_match_type_config",
+ "posthog_team"."session_recording_trigger_groups",
+ "posthog_team"."session_replay_config",
+ "posthog_team"."session_recording_retention_period",
+ "posthog_team"."event_retention_months",
+ "posthog_team"."conversations_enabled",
+ "posthog_team"."conversations_settings",
+ "posthog_team"."proactive_tasks_enabled",
+ "posthog_team"."survey_config",
+ "posthog_team"."surveys_opt_in",
+ "posthog_team"."product_tours_opt_in",
+ "posthog_team"."capture_console_log_opt_in",
+ "posthog_team"."capture_performance_opt_in",
+ "posthog_team"."capture_dead_clicks",
+ "posthog_team"."autocapture_opt_out",
+ "posthog_team"."autocapture_web_vitals_opt_in",
+ "posthog_team"."autocapture_web_vitals_allowed_metrics",
+ "posthog_team"."autocapture_exceptions_opt_in",
+ "posthog_team"."autocapture_exceptions_errors_to_ignore",
+ "posthog_team"."logs_settings",
+ "posthog_team"."llm_gateway_enabled_at",
+ "posthog_team"."llm_gateway_revoked_at",
+ "posthog_team"."llm_gateway_overspend_allowance_usd",
+ "posthog_team"."heatmaps_opt_in",
+ "posthog_team"."receive_org_level_activity_logs",
+ "posthog_team"."web_analytics_pre_aggregated_tables_enabled",
+ "posthog_team"."web_analytics_pre_aggregated_tables_version",
+ "posthog_team"."flags_persistence_default",
+ "posthog_team"."feature_flag_confirmation_enabled",
+ "posthog_team"."feature_flag_confirmation_message",
+ "posthog_team"."default_evaluation_environments_enabled",
+ "posthog_team"."require_evaluation_environment_tags",
+ "posthog_team"."default_evaluation_contexts_enabled",
+ "posthog_team"."require_evaluation_contexts",
+ "posthog_team"."session_recording_version",
+ "posthog_team"."signup_token",
+ "posthog_team"."is_demo",
+ "posthog_team"."access_control",
+ "posthog_team"."week_start_day",
+ "posthog_team"."inject_web_apps",
+ "posthog_team"."test_account_filters",
+ "posthog_team"."test_account_filters_default_checked",
+ "posthog_team"."path_cleaning_filters",
+ "posthog_team"."timezone",
+ "posthog_team"."data_attributes",
+ "posthog_team"."person_display_name_properties",
+ "posthog_team"."live_events_columns",
+ "posthog_team"."recording_domains",
+ "posthog_team"."human_friendly_comparison_periods",
+ "posthog_team"."cookieless_server_hash_mode",
+ "posthog_team"."primary_dashboard_id",
+ "posthog_team"."default_data_theme",
+ "posthog_team"."extra_settings",
+ "posthog_team"."modifiers",
+ "posthog_team"."correlation_config",
+ "posthog_team"."session_recording_retention_period_days",
+ "posthog_team"."external_data_workspace_id",
+ "posthog_team"."external_data_workspace_last_synced_at",
+ "posthog_team"."api_query_rate_limit",
+ "posthog_team"."drop_events_older_than",
+ "posthog_team"."base_currency",
+ "posthog_team"."business_model",
+ "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_team"
+ INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
+ WHERE "posthog_team"."id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.520
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -29570,7 +28665,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.547
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.521
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -29669,7 +28764,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.548
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.522
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -29698,7 +28793,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.549
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.523
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -29727,60 +28822,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.55
- '''
- SELECT "posthog_organizationmembership"."id",
- "posthog_organizationmembership"."organization_id",
- "posthog_organizationmembership"."user_id",
- "posthog_organizationmembership"."level",
- "posthog_organizationmembership"."joined_at",
- "posthog_organizationmembership"."updated_at",
- "posthog_organizationmembership"."invited_by_id",
- "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organizationmembership"
- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
- WHERE "posthog_organizationmembership"."user_id" = 99999
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.550
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.524
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -29800,7 +28842,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.551
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.525
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -29813,7 +28855,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.552
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.526
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -29829,7 +28871,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.553
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.527
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -29846,51 +28888,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.554
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.555
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.556
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.528
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -29899,7 +28897,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.557
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.529
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -29945,7 +28943,62 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.558
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.53
+ '''
+ SELECT "posthog_organizationmembership"."id",
+ "posthog_organizationmembership"."organization_id",
+ "posthog_organizationmembership"."user_id",
+ "posthog_organizationmembership"."level",
+ "posthog_organizationmembership"."joined_at",
+ "posthog_organizationmembership"."updated_at",
+ "posthog_organizationmembership"."invited_by_id",
+ "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_organizationmembership"
+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_organizationmembership"."user_id" = 99999)
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.530
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -29991,7 +29044,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.559
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.531
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -30130,21 +29183,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.56
- '''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_dashboard"
- INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
- LEFT OUTER JOIN "posthog_filesystemviewlog" recent_dashboard_views ON ("posthog_team"."id" = recent_dashboard_views."team_id"
- AND ((recent_dashboard_views."user_id" = 99999
- AND recent_dashboard_views."type" = 'dashboard'
- AND recent_dashboard_views."ref" = ("posthog_dashboard"."id")::varchar)))
- WHERE ("posthog_team"."project_id" = 99999
- AND NOT ("posthog_dashboard"."deleted")
- AND NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.560
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.532
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -30199,7 +29238,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.561
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.533
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -30222,7 +29261,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.562
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.534
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -30275,7 +29314,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.563
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.535
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -30295,7 +29334,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.564
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.536
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -30308,7 +29347,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.565
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.537
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -30321,7 +29360,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.566
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.538
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -30338,7 +29377,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -30354,7 +29392,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.567
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.539
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -30453,7 +29491,30 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.568
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.54
+ '''
+ SELECT "ee_accesscontrol"."id",
+ "ee_accesscontrol"."team_id",
+ "ee_accesscontrol"."access_level",
+ "ee_accesscontrol"."resource",
+ "ee_accesscontrol"."resource_id",
+ "ee_accesscontrol"."organization_member_id",
+ "ee_accesscontrol"."role_id",
+ "ee_accesscontrol"."created_by_id",
+ "ee_accesscontrol"."created_at",
+ "ee_accesscontrol"."updated_at"
+ FROM "ee_accesscontrol"
+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")
+ WHERE (("ee_accesscontrol"."organization_member_id" IS NULL
+ AND "ee_accesscontrol"."role_id" IS NULL
+ AND "ee_accesscontrol"."team_id" = 99999)
+ OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_organizationmembership"."user_id" = 99999
+ AND "ee_accesscontrol"."role_id" IS NULL
+ AND "ee_accesscontrol"."team_id" = 99999))
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.540
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -30499,7 +29560,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.569
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.541
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -30598,53 +29659,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.57
- '''
- SELECT "posthog_user"."id",
- "posthog_user"."password",
- "posthog_user"."last_login",
- "posthog_user"."first_name",
- "posthog_user"."last_name",
- "posthog_user"."is_staff",
- "posthog_user"."date_joined",
- "posthog_user"."uuid",
- "posthog_user"."current_organization_id",
- "posthog_user"."current_team_id",
- "posthog_user"."email",
- "posthog_user"."pending_email",
- "posthog_user"."distinct_id",
- "posthog_user"."is_email_verified",
- "posthog_user"."credentials_reviewed_at",
- "posthog_user"."requested_2fa_reset_at",
- "posthog_user"."has_seen_product_intro_for",
- "posthog_user"."strapi_id",
- "posthog_user"."is_active",
- "posthog_user"."role_at_organization",
- "posthog_user"."theme_mode",
- "posthog_user"."partial_notification_settings",
- "posthog_user"."anonymize_data",
- "posthog_user"."allow_impersonation",
- "posthog_user"."toolbar_mode",
- "posthog_user"."hedgehog_config",
- "posthog_user"."allow_sidebar_suggestions",
- "posthog_user"."shortcut_position",
- "posthog_user"."passkeys_enabled_for_2fa",
- "posthog_user"."hide_mcp_hints",
- "posthog_user"."ui_configuration",
- "posthog_user"."onboarding_skipped_at",
- "posthog_user"."onboarding_skipped_reason",
- "posthog_user"."onboarding_skipped_organization_id",
- "posthog_user"."onboarding_delegated_to_invite_id",
- "posthog_user"."onboarding_delegated_to_organization_id",
- "posthog_user"."onboarding_delegation_accepted_at",
- "posthog_user"."events_column_config",
- "posthog_user"."email_opt_in"
- FROM "posthog_user"
- WHERE ("posthog_user"."is_active"
- AND "posthog_user"."id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.570
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.542
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -30669,7 +29684,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.571
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.543
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -30687,7 +29702,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.572
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.544
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -30733,7 +29748,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.573
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.545
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -30832,7 +29847,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.574
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.546
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -30861,7 +29876,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.575
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.547
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -30890,7 +29905,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.576
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.548
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -30910,7 +29925,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.577
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.549
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -30923,42 +29938,16 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.578
- '''
- SELECT "posthog_teammarketinganalyticsconfig"."team_id",
- "posthog_teammarketinganalyticsconfig"."attribution_window_days",
- "posthog_teammarketinganalyticsconfig"."attribution_mode",
- "posthog_teammarketinganalyticsconfig"."filter_test_accounts",
- "posthog_teammarketinganalyticsconfig"."sources_map",
- "posthog_teammarketinganalyticsconfig"."conversion_goals",
- "posthog_teammarketinganalyticsconfig"."campaign_name_mappings",
- "posthog_teammarketinganalyticsconfig"."custom_source_mappings",
- "posthog_teammarketinganalyticsconfig"."campaign_field_preferences"
- FROM "posthog_teammarketinganalyticsconfig"
- WHERE "posthog_teammarketinganalyticsconfig"."team_id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.579
- '''
- SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
- "customer_analytics_teamcustomeranalyticsconfig"."activity_event",
- "customer_analytics_teamcustomeranalyticsconfig"."signup_pageview_event",
- "customer_analytics_teamcustomeranalyticsconfig"."signup_event",
- "customer_analytics_teamcustomeranalyticsconfig"."subscription_event",
- "customer_analytics_teamcustomeranalyticsconfig"."payment_event",
- "customer_analytics_teamcustomeranalyticsconfig"."account_group_type_index",
- "customer_analytics_teamcustomeranalyticsconfig"."default_pinned_properties",
- "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules",
- "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules_enabled_at"
- FROM "customer_analytics_teamcustomeranalyticsconfig"
- WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.58
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.55
'''
- 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",
@@ -30997,56 +29986,45 @@
"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: TestDashboard.test_listing_dashboards_is_not_nplus1.580
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.550
'''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
+ SELECT "posthog_teammarketinganalyticsconfig"."team_id",
+ "posthog_teammarketinganalyticsconfig"."attribution_window_days",
+ "posthog_teammarketinganalyticsconfig"."attribution_mode",
+ "posthog_teammarketinganalyticsconfig"."filter_test_accounts",
+ "posthog_teammarketinganalyticsconfig"."sources_map",
+ "posthog_teammarketinganalyticsconfig"."conversion_goals",
+ "posthog_teammarketinganalyticsconfig"."campaign_name_mappings",
+ "posthog_teammarketinganalyticsconfig"."custom_source_mappings",
+ "posthog_teammarketinganalyticsconfig"."campaign_field_preferences"
+ FROM "posthog_teammarketinganalyticsconfig"
+ WHERE "posthog_teammarketinganalyticsconfig"."team_id" = 99999
+ LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.581
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.551
'''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
+ SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
+ "customer_analytics_teamcustomeranalyticsconfig"."activity_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."signup_pageview_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."signup_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."subscription_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."payment_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_group_type_index",
+ "customer_analytics_teamcustomeranalyticsconfig"."default_pinned_properties",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules_enabled_at"
+ FROM "customer_analytics_teamcustomeranalyticsconfig"
+ WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
+ LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.582
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.552
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -31055,7 +30033,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.583
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.553
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -31101,7 +30079,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.584
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.554
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -31147,7 +30125,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.585
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.555
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -31286,7 +30264,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.586
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.556
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -31341,7 +30319,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.587
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.557
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -31364,7 +30342,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.588
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.558
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -31417,7 +30395,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.589
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.559
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboard"
@@ -31431,146 +30409,21 @@
AND NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.59
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.56
'''
- SELECT "posthog_team"."id",
- "posthog_team"."uuid",
- "posthog_team"."organization_id",
- "posthog_team"."parent_team_id",
- "posthog_team"."project_id",
- "posthog_team"."api_token",
- "posthog_team"."app_urls",
- "posthog_team"."name",
- "posthog_team"."slack_incoming_webhook",
- "posthog_team"."created_at",
- "posthog_team"."updated_at",
- "posthog_team"."anonymize_ips",
- "posthog_team"."completed_snippet_onboarding",
- "posthog_team"."has_completed_onboarding_for",
- "posthog_team"."onboarding_tasks",
- "posthog_team"."ingested_event",
- "posthog_team"."ingested_production_event",
- "posthog_team"."ingested_production_event_last_checked_at",
- "posthog_team"."person_processing_opt_out",
- "posthog_team"."secret_api_token",
- "posthog_team"."secret_api_token_backup",
- "posthog_team"."session_recording_opt_in",
- "posthog_team"."session_recording_sample_rate",
- "posthog_team"."session_recording_minimum_duration_milliseconds",
- "posthog_team"."session_recording_linked_flag",
- "posthog_team"."session_recording_network_payload_capture_config",
- "posthog_team"."session_recording_masking_config",
- "posthog_team"."session_recording_url_trigger_config",
- "posthog_team"."session_recording_url_blocklist_config",
- "posthog_team"."session_recording_event_trigger_config",
- "posthog_team"."session_recording_trigger_match_type_config",
- "posthog_team"."session_recording_trigger_groups",
- "posthog_team"."session_replay_config",
- "posthog_team"."session_recording_retention_period",
- "posthog_team"."event_retention_months",
- "posthog_team"."conversations_enabled",
- "posthog_team"."conversations_settings",
- "posthog_team"."proactive_tasks_enabled",
- "posthog_team"."survey_config",
- "posthog_team"."surveys_opt_in",
- "posthog_team"."product_tours_opt_in",
- "posthog_team"."capture_console_log_opt_in",
- "posthog_team"."capture_performance_opt_in",
- "posthog_team"."capture_dead_clicks",
- "posthog_team"."autocapture_opt_out",
- "posthog_team"."autocapture_web_vitals_opt_in",
- "posthog_team"."autocapture_web_vitals_allowed_metrics",
- "posthog_team"."autocapture_exceptions_opt_in",
- "posthog_team"."autocapture_exceptions_errors_to_ignore",
- "posthog_team"."logs_settings",
- "posthog_team"."llm_gateway_enabled_at",
- "posthog_team"."llm_gateway_revoked_at",
- "posthog_team"."llm_gateway_overspend_allowance_usd",
- "posthog_team"."heatmaps_opt_in",
- "posthog_team"."receive_org_level_activity_logs",
- "posthog_team"."web_analytics_pre_aggregated_tables_enabled",
- "posthog_team"."web_analytics_pre_aggregated_tables_version",
- "posthog_team"."flags_persistence_default",
- "posthog_team"."feature_flag_confirmation_enabled",
- "posthog_team"."feature_flag_confirmation_message",
- "posthog_team"."default_evaluation_environments_enabled",
- "posthog_team"."require_evaluation_environment_tags",
- "posthog_team"."default_evaluation_contexts_enabled",
- "posthog_team"."require_evaluation_contexts",
- "posthog_team"."session_recording_version",
- "posthog_team"."signup_token",
- "posthog_team"."is_demo",
- "posthog_team"."access_control",
- "posthog_team"."week_start_day",
- "posthog_team"."inject_web_apps",
- "posthog_team"."test_account_filters",
- "posthog_team"."test_account_filters_default_checked",
- "posthog_team"."path_cleaning_filters",
- "posthog_team"."timezone",
- "posthog_team"."data_attributes",
- "posthog_team"."person_display_name_properties",
- "posthog_team"."live_events_columns",
- "posthog_team"."recording_domains",
- "posthog_team"."human_friendly_comparison_periods",
- "posthog_team"."cookieless_server_hash_mode",
- "posthog_team"."primary_dashboard_id",
- "posthog_team"."default_data_theme",
- "posthog_team"."extra_settings",
- "posthog_team"."modifiers",
- "posthog_team"."correlation_config",
- "posthog_team"."session_recording_retention_period_days",
- "posthog_team"."external_data_workspace_id",
- "posthog_team"."external_data_workspace_last_synced_at",
- "posthog_team"."api_query_rate_limit",
- "posthog_team"."drop_events_older_than",
- "posthog_team"."base_currency",
- "posthog_team"."business_model",
- "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_team"
- INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
- WHERE "posthog_team"."id" = 99999
- LIMIT 21
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_dashboard"
+ INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
+ LEFT OUTER JOIN "posthog_filesystemviewlog" recent_dashboard_views ON ("posthog_team"."id" = recent_dashboard_views."team_id"
+ AND ((recent_dashboard_views."user_id" = 99999
+ AND recent_dashboard_views."type" = 'dashboard'
+ AND recent_dashboard_views."ref" = ("posthog_dashboard"."id")::varchar)))
+ WHERE ("posthog_team"."project_id" = 99999
+ AND NOT ("posthog_dashboard"."deleted")
+ AND NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.590
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.560
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -31587,7 +30440,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -31676,7 +30528,7 @@
LIMIT 300
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.591
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.561
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -31699,7 +30551,7 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_listing_dashboards_is_not_nplus1.592
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.562
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -31720,6 +30572,237 @@
5 /* ... */))
'''
# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.57
+ '''
+ SELECT "posthog_user"."id",
+ "posthog_user"."password",
+ "posthog_user"."last_login",
+ "posthog_user"."first_name",
+ "posthog_user"."last_name",
+ "posthog_user"."is_staff",
+ "posthog_user"."date_joined",
+ "posthog_user"."uuid",
+ "posthog_user"."current_organization_id",
+ "posthog_user"."current_team_id",
+ "posthog_user"."email",
+ "posthog_user"."pending_email",
+ "posthog_user"."distinct_id",
+ "posthog_user"."is_email_verified",
+ "posthog_user"."credentials_reviewed_at",
+ "posthog_user"."requested_2fa_reset_at",
+ "posthog_user"."has_seen_product_intro_for",
+ "posthog_user"."strapi_id",
+ "posthog_user"."is_active",
+ "posthog_user"."role_at_organization",
+ "posthog_user"."theme_mode",
+ "posthog_user"."partial_notification_settings",
+ "posthog_user"."anonymize_data",
+ "posthog_user"."allow_impersonation",
+ "posthog_user"."toolbar_mode",
+ "posthog_user"."hedgehog_config",
+ "posthog_user"."allow_sidebar_suggestions",
+ "posthog_user"."shortcut_position",
+ "posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
+ "posthog_user"."ui_configuration",
+ "posthog_user"."onboarding_skipped_at",
+ "posthog_user"."onboarding_skipped_reason",
+ "posthog_user"."onboarding_skipped_organization_id",
+ "posthog_user"."onboarding_delegated_to_invite_id",
+ "posthog_user"."onboarding_delegated_to_organization_id",
+ "posthog_user"."onboarding_delegation_accepted_at",
+ "posthog_user"."events_column_config",
+ "posthog_user"."email_opt_in"
+ FROM "posthog_user"
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.58
+ '''
+ SELECT "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_organization"
+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.59
+ '''
+ SELECT "posthog_team"."id",
+ "posthog_team"."uuid",
+ "posthog_team"."organization_id",
+ "posthog_team"."parent_team_id",
+ "posthog_team"."project_id",
+ "posthog_team"."api_token",
+ "posthog_team"."app_urls",
+ "posthog_team"."name",
+ "posthog_team"."slack_incoming_webhook",
+ "posthog_team"."created_at",
+ "posthog_team"."updated_at",
+ "posthog_team"."anonymize_ips",
+ "posthog_team"."completed_snippet_onboarding",
+ "posthog_team"."has_completed_onboarding_for",
+ "posthog_team"."onboarding_tasks",
+ "posthog_team"."ingested_event",
+ "posthog_team"."ingested_production_event",
+ "posthog_team"."ingested_production_event_last_checked_at",
+ "posthog_team"."person_processing_opt_out",
+ "posthog_team"."secret_api_token",
+ "posthog_team"."secret_api_token_backup",
+ "posthog_team"."session_recording_opt_in",
+ "posthog_team"."session_recording_sample_rate",
+ "posthog_team"."session_recording_minimum_duration_milliseconds",
+ "posthog_team"."session_recording_linked_flag",
+ "posthog_team"."session_recording_network_payload_capture_config",
+ "posthog_team"."session_recording_masking_config",
+ "posthog_team"."session_recording_url_trigger_config",
+ "posthog_team"."session_recording_url_blocklist_config",
+ "posthog_team"."session_recording_event_trigger_config",
+ "posthog_team"."session_recording_trigger_match_type_config",
+ "posthog_team"."session_recording_trigger_groups",
+ "posthog_team"."session_replay_config",
+ "posthog_team"."session_recording_retention_period",
+ "posthog_team"."event_retention_months",
+ "posthog_team"."conversations_enabled",
+ "posthog_team"."conversations_settings",
+ "posthog_team"."proactive_tasks_enabled",
+ "posthog_team"."survey_config",
+ "posthog_team"."surveys_opt_in",
+ "posthog_team"."product_tours_opt_in",
+ "posthog_team"."capture_console_log_opt_in",
+ "posthog_team"."capture_performance_opt_in",
+ "posthog_team"."capture_dead_clicks",
+ "posthog_team"."autocapture_opt_out",
+ "posthog_team"."autocapture_web_vitals_opt_in",
+ "posthog_team"."autocapture_web_vitals_allowed_metrics",
+ "posthog_team"."autocapture_exceptions_opt_in",
+ "posthog_team"."autocapture_exceptions_errors_to_ignore",
+ "posthog_team"."logs_settings",
+ "posthog_team"."llm_gateway_enabled_at",
+ "posthog_team"."llm_gateway_revoked_at",
+ "posthog_team"."llm_gateway_overspend_allowance_usd",
+ "posthog_team"."heatmaps_opt_in",
+ "posthog_team"."receive_org_level_activity_logs",
+ "posthog_team"."web_analytics_pre_aggregated_tables_enabled",
+ "posthog_team"."web_analytics_pre_aggregated_tables_version",
+ "posthog_team"."flags_persistence_default",
+ "posthog_team"."feature_flag_confirmation_enabled",
+ "posthog_team"."feature_flag_confirmation_message",
+ "posthog_team"."default_evaluation_environments_enabled",
+ "posthog_team"."require_evaluation_environment_tags",
+ "posthog_team"."default_evaluation_contexts_enabled",
+ "posthog_team"."require_evaluation_contexts",
+ "posthog_team"."session_recording_version",
+ "posthog_team"."signup_token",
+ "posthog_team"."is_demo",
+ "posthog_team"."access_control",
+ "posthog_team"."week_start_day",
+ "posthog_team"."inject_web_apps",
+ "posthog_team"."test_account_filters",
+ "posthog_team"."test_account_filters_default_checked",
+ "posthog_team"."path_cleaning_filters",
+ "posthog_team"."timezone",
+ "posthog_team"."data_attributes",
+ "posthog_team"."person_display_name_properties",
+ "posthog_team"."live_events_columns",
+ "posthog_team"."recording_domains",
+ "posthog_team"."human_friendly_comparison_periods",
+ "posthog_team"."cookieless_server_hash_mode",
+ "posthog_team"."primary_dashboard_id",
+ "posthog_team"."default_data_theme",
+ "posthog_team"."extra_settings",
+ "posthog_team"."modifiers",
+ "posthog_team"."correlation_config",
+ "posthog_team"."session_recording_retention_period_days",
+ "posthog_team"."external_data_workspace_id",
+ "posthog_team"."external_data_workspace_last_synced_at",
+ "posthog_team"."api_query_rate_limit",
+ "posthog_team"."drop_events_older_than",
+ "posthog_team"."base_currency",
+ "posthog_team"."business_model",
+ "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_team"
+ INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
+ WHERE "posthog_team"."id" = 99999
+ LIMIT 21
+ '''
+# ---
# name: TestDashboard.test_listing_dashboards_is_not_nplus1.6
'''
SELECT "posthog_oauthapplication"."redirect_uris",
@@ -32996,7 +32079,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -34599,7 +33681,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -37021,7 +36102,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
diff --git a/posthog/api/test/dashboards/test_dashboard.py b/posthog/api/test/dashboards/test_dashboard.py
index 78c763e02264..c4543bf8e4ca 100644
--- a/posthog/api/test/dashboards/test_dashboard.py
+++ b/posthog/api/test/dashboards/test_dashboard.py
@@ -43,7 +43,7 @@ from posthog.models.signals import mute_selected_signals
from posthog.test.db_context_capturing import capture_db_queries
from posthog.test.insight_queries import browser_filtered_pageview_query, default_pageview_query, insight_query
from posthog.test.test_utils import create_group_type_mapping_without_created_at
-from posthog.user_permissions import UserDashboardPermissions, UserPermissions
+from posthog.user_permissions import UserPermissions
from products.access_control.backend.facade.user_access_control import UserAccessControl
from products.access_control.backend.models.access_control import AccessControl
@@ -672,14 +672,6 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):
self.assertEqual(response_data["created_by"]["distinct_id"], self.user.distinct_id)
self.assertEqual(response_data["created_by"]["first_name"], self.user.first_name)
self.assertEqual(response_data["creation_mode"], "default")
- self.assertEqual(
- response_data["restriction_level"],
- Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT,
- )
- self.assertEqual(
- response_data["effective_privilege_level"],
- Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
def test_create_basic_dashboard(self):
# the front end sends an empty description even if not allowed to add one
@@ -689,44 +681,10 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):
self.assertEqual(response_data["description"], "")
self.assertEqual(response_data["tags"], [])
self.assertEqual(response_data["creation_mode"], "default")
- self.assertEqual(
- response_data["restriction_level"],
- Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT,
- )
- self.assertEqual(
- response_data["effective_privilege_level"],
- Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
instance = Dashboard.objects.get(id=response_data["id"])
self.assertEqual(instance.name, "My new dashboard")
- @parameterized.expand([("create",), ("update",)])
- def test_reject_legacy_collaborator_restriction_on_write(self, operation: str) -> None:
- self.organization.available_product_features = []
- self.organization.save()
-
- if operation == "create":
- response = self.client.post(
- f"/api/projects/{self.team.id}/dashboards/",
- {
- "name": "legacy dashboard",
- "restriction_level": Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- },
- )
- self.assertFalse(Dashboard.objects.filter(name="legacy dashboard").exists())
- else:
- dashboard = Dashboard.objects.create(team=self.team, name="dashboard", created_by=self.user)
- response = self.client.patch(
- f"/api/projects/{self.team.id}/dashboards/{dashboard.id}",
- {"restriction_level": Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT},
- )
- dashboard.refresh_from_db()
- self.assertEqual(dashboard.restriction_level, Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT)
-
- self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
- self.assertEqual(response.json()["attr"], "restriction_level")
-
def test_update_dashboard(self):
dashboard = Dashboard.objects.create(
team=self.team,
@@ -741,14 +699,6 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):
self.assertEqual(response_data["name"], "dashboard new name")
self.assertEqual(response_data["created_by"]["distinct_id"], self.user.distinct_id)
self.assertEqual(response_data["creation_mode"], "template")
- self.assertEqual(
- response_data["restriction_level"],
- Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT,
- )
- self.assertEqual(
- response_data["effective_privilege_level"],
- Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
dashboard.refresh_from_db()
self.assertEqual(dashboard.name, "dashboard new name")
@@ -1091,18 +1041,18 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):
with self.assertNumQueries(baseline + 10):
self.dashboard_api.get_dashboard(dashboard_id, query_params={"no_items_field": "true"})
- # baseline + 10 + 7 once at least one insight materializes. Three of the 7 read the
+ # baseline + 10 + 6 once at least one insight materializes. Three of the 6 read the
# revenue, marketing and customer analytics configs that go into the query cache key.
self.dashboard_api.create_insight({"dashboards": [dashboard_id]})
- with self.assertNumQueries(baseline + 10 + 7):
+ with self.assertNumQueries(baseline + 10 + 6):
self.dashboard_api.get_dashboard(dashboard_id, query_params={"no_items_field": "true"})
self.dashboard_api.create_insight({"dashboards": [dashboard_id]})
- with self.assertNumQueries(baseline + 10 + 7):
+ with self.assertNumQueries(baseline + 10 + 6):
self.dashboard_api.get_dashboard(dashboard_id, query_params={"no_items_field": "true"})
self.dashboard_api.create_insight({"dashboards": [dashboard_id]})
- with self.assertNumQueries(baseline + 10 + 7):
+ with self.assertNumQueries(baseline + 10 + 6):
self.dashboard_api.get_dashboard(dashboard_id, query_params={"no_items_field": "true"})
def test_insight_alerts_do_not_nplus1_dashboard_gets(self) -> None:
@@ -1408,26 +1358,33 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):
)
assert response.status_code == 400
- def test_bulk_delete_checks_each_dashboard_permission(self) -> None:
- first_id, _ = self.dashboard_api.create_dashboard({"name": "Editable board"})
- second_id, _ = self.dashboard_api.create_dashboard({"name": "Restricted board"})
- original_can_edit = UserPermissions.dashboard
+ def test_bulk_delete_skips_dashboards_without_edit_access(self) -> None:
+ editable_id, _ = self.dashboard_api.create_dashboard({"name": "Editable board"})
+ viewer_id, _ = self.dashboard_api.create_dashboard({"name": "View-only board"})
+ user = self._create_user("[email protected]", level=OrganizationMembership.Level.MEMBER)
+ membership = user.organization_memberships.get(organization=self.organization)
+ for dashboard_id, access_level in ((editable_id, "editor"), (viewer_id, "viewer")):
+ AccessControl.objects.create(
+ team=self.team,
+ resource="dashboard",
+ resource_id=str(dashboard_id),
+ access_level=access_level,
+ organization_member=membership,
+ )
+ self.client.force_login(user)
- def dashboard_permissions(permissions: UserPermissions, dashboard: Dashboard) -> UserDashboardPermissions:
- if dashboard.id == second_id:
- return MagicMock(can_edit=False)
- return original_can_edit(permissions, dashboard)
+ response = self.client.post(
+ f"/api/projects/{self.team.id}/dashboards/bulk_delete/",
+ {"ids": [editable_id, viewer_id]},
+ format="json",
+ )
- with patch.object(UserPermissions, "dashboard", dashboard_permissions):
- response = self.client.post(
- f"/api/projects/{self.team.id}/dashboards/bulk_delete/",
- {"ids": [first_id, second_id]},
- format="json",
- )
assert response.status_code == 200
- assert response.json()["deleted"] == [first_id]
- assert response.json()["skipped"][0]["id"] == second_id
- assert Dashboard.objects.filter(team=self.team, id=second_id).exists()
+ assert response.json() == {
+ "deleted": [editable_id],
+ "skipped": [{"id": viewer_id, "reason": "You do not have permission to edit this dashboard"}],
+ }
+ assert Dashboard.objects.filter(team=self.team, id=viewer_id).exists()
def test_delete_dashboard_can_delete_tiles(self):
dashboard_one_id, _ = self.dashboard_api.create_dashboard({"filters": {"date_from": "-14d"}})
@@ -3772,8 +3729,6 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):
"deleted": False,
"derived_name": None,
"description": None,
- "effective_privilege_level": 37,
- "effective_restriction_level": 21,
"favorited": False,
"filter_override_context": None,
"filters_hash": ANY,
diff --git a/posthog/api/test/test_sharing.py b/posthog/api/test/test_sharing.py
index ffbbf3a69fc0..d6d35a689180 100644
--- a/posthog/api/test/test_sharing.py
+++ b/posthog/api/test/test_sharing.py
@@ -380,7 +380,6 @@ class TestSharing(APIBaseTest):
team=self.team,
name="example dashboard",
created_by=other_user,
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
)
response = self.client.patch(
diff --git a/posthog/management/commands/migrate_dashboard_collaborators.py b/posthog/management/commands/migrate_dashboard_collaborators.py
deleted file mode 100644
index 2c10073d458f..000000000000
--- a/posthog/management/commands/migrate_dashboard_collaborators.py
+++ /dev/null
@@ -1,65 +0,0 @@
-import argparse
-from typing import Any
-from uuid import UUID
-
-from django.core.management.base import BaseCommand, CommandError
-
-from posthog.rbac.migrations.rbac_dashboard_migration import rbac_dashboard_access_control_migration
-
-from products.dashboards.backend.models.dashboard import Dashboard
-
-
-class Command(BaseCommand):
- help = "Migrate legacy dashboard collaborator access to access control"
-
- def add_arguments(self, parser: argparse.ArgumentParser) -> None:
- parser.add_argument(
- "--org-ids",
- type=str,
- help="Comma-separated organization UUIDs to limit the migration. Omit to process all eligible organizations.",
- )
- parser.add_argument(
- "--dry-run",
- action="store_true",
- help="Show the dashboards that would be migrated without making changes.",
- )
-
- def handle(self, *args: Any, **options: Any) -> None:
- dashboards = Dashboard.objects.filter(restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT)
- org_ids_input = options.get("org_ids")
- if org_ids_input is not None:
- try:
- requested_org_ids = {UUID(org_id.strip()) for org_id in org_ids_input.split(",") if org_id.strip()}
- except ValueError as error:
- raise CommandError("--org-ids must be a comma-separated list of organization UUIDs.") from error
- if not requested_org_ids:
- raise CommandError("--org-ids must include at least one organization UUID.")
- dashboards = dashboards.filter(team__organization_id__in=requested_org_ids)
-
- dashboard_count = dashboards.count()
- organization_ids = list(
- dashboards.values_list("team__organization_id", flat=True).distinct().order_by("team__organization_id")
- )
- organization_count = len(organization_ids)
-
- if dashboard_count == 0:
- self.stdout.write("No dashboards need collaborator migration.")
- return
-
- dashboard_label = "dashboard" if dashboard_count == 1 else "dashboards"
- organization_label = "organization" if organization_count == 1 else "organizations"
- if options.get("dry_run"):
- self.stdout.write(
- f"Would migrate {dashboard_count} {dashboard_label} across {organization_count} {organization_label}."
- )
- return
-
- for organization_id in organization_ids:
- rbac_dashboard_access_control_migration(organization_id)
-
- self.stdout.write(
- self.style.SUCCESS(
- f"Migrated collaborator access for {dashboard_count} {dashboard_label} "
- f"across {organization_count} {organization_label}."
- )
- )
diff --git a/posthog/management/commands/run_rbac_migrations.py b/posthog/management/commands/run_rbac_migrations.py
index 03bff1f1e73e..978aa18b9546 100644
--- a/posthog/management/commands/run_rbac_migrations.py
+++ b/posthog/management/commands/run_rbac_migrations.py
@@ -7,7 +7,6 @@ from django.core.management.base import BaseCommand
import structlog
from posthog.models.organization import Organization
-from posthog.rbac.migrations.rbac_dashboard_migration import rbac_dashboard_access_control_migration
from posthog.rbac.migrations.rbac_feature_flag_migration import rbac_feature_flag_role_access_migration
from posthog.rbac.migrations.rbac_team_migration import rbac_team_access_control_migration
@@ -111,9 +110,8 @@ class Command(BaseCommand):
team_success = org_result["team_migration"]["success"]
ff_success = org_result["feature_flag_migration"]["success"]
- dashboard_success = org_result["dashboard_migration"]["success"]
- if team_success and ff_success and dashboard_success:
+ if team_success and ff_success:
self.stdout.write(self.style.SUCCESS(f"Organization {org_id} ({org_name}): All migrations successful"))
else:
self.stdout.write(self.style.WARNING(f"Organization {org_id} ({org_name}): Some migrations failed"))
@@ -126,17 +124,12 @@ class Command(BaseCommand):
error = org_result["feature_flag_migration"]["error"] or "Unknown error"
self.stdout.write(self.style.ERROR(f" Feature flag migration failed: {error}"))
- if not dashboard_success:
- error = org_result["dashboard_migration"]["error"] or "Unknown error"
- self.stdout.write(self.style.ERROR(f" Dashboard migration failed: {error}"))
-
def find_organizations_needing_migration(self, rollout_date) -> list[int]:
"""
Find organizations that need RBAC migration based on the following criteria:
- Has a team with access_control = True
- Has an OrganizationResourceAccess row
- Has a Role with feature flag access settings
- - Has dashboards with restriction_level = 37 (ONLY_COLLABORATORS_CAN_EDIT)
- Created after the rollout date
Returns:
@@ -162,18 +155,6 @@ class Command(BaseCommand):
)
logger.info(f"Found {len(orgs_with_feature_flag_roles)} organizations with feature flag roles")
- # Find organizations with dashboards that have restriction level 37
- from products.dashboards.backend.models.dashboard import Dashboard
-
- orgs_with_restricted_dashboards = (
- Organization.objects.filter(
- team__dashboard__restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT
- )
- .values_list("id", flat=True)
- .distinct()
- )
- logger.info(f"Found {len(orgs_with_restricted_dashboards)} organizations with restricted dashboards")
-
# Find organizations created after the rollout date
orgs_after_rollout_date = Organization.objects.filter(created_at__date__gte=rollout_date).values_list(
"id", flat=True
@@ -182,10 +163,7 @@ class Command(BaseCommand):
# Combine all organization IDs
needs_migration = (
- set(orgs_with_team_access_control)
- | set(orgs_with_resource_access)
- | set(orgs_with_feature_flag_roles)
- | set(orgs_with_restricted_dashboards)
+ set(orgs_with_team_access_control) | set(orgs_with_resource_access) | set(orgs_with_feature_flag_roles)
)
logger.info(f"Found {len(needs_migration)} total organizations that need migration")
@@ -216,7 +194,6 @@ class Command(BaseCommand):
"organization_id": org_id,
"team_migration": dict(migration_init),
"feature_flag_migration": dict(migration_init),
- "dashboard_migration": dict(migration_init),
}
# Verify organization exists
@@ -256,24 +233,8 @@ class Command(BaseCommand):
"Feature flag role access migration failed", organization_id=org_id, error=error_msg, exc_info=True
)
- # Run dashboard access control migration
- try:
- rbac_dashboard_access_control_migration(org_id)
- org_result["dashboard_migration"]["success"] = True
- logger.info("Dashboard access control migration successful", organization_id=org_id)
- except Exception as e:
- error_msg = str(e)
- org_result["dashboard_migration"]["error"] = error_msg
- logger.error(
- "Dashboard access control migration failed", organization_id=org_id, error=error_msg, exc_info=True
- )
-
# Update summary counters
- if (
- org_result["team_migration"]["success"]
- and org_result["feature_flag_migration"]["success"]
- and org_result["dashboard_migration"]["success"]
- ):
+ if org_result["team_migration"]["success"] and org_result["feature_flag_migration"]["success"]:
results["successful"] += 1
logger.info("All migrations successful for organization", organization_id=org_id)
else:
diff --git a/posthog/management/commands/test/test_migrate_dashboard_collaborators.py b/posthog/management/commands/test/test_migrate_dashboard_collaborators.py
deleted file mode 100644
index 88a7eac335a2..000000000000
--- a/posthog/management/commands/test/test_migrate_dashboard_collaborators.py
+++ /dev/null
@@ -1,36 +0,0 @@
-from io import StringIO
-
-from posthog.test.base import BaseTest
-
-from django.core.management import call_command
-
-from products.access_control.backend.models.access_control import AccessControl
-from products.dashboards.backend.models.dashboard import Dashboard
-
-
-class TestMigrateDashboardCollaborators(BaseTest):
- def test_dry_run_and_rerun_are_safe(self) -> None:
- dashboard = Dashboard.objects.create(
- team=self.team,
- name="Restricted dashboard",
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
- args = [f"--org-ids={self.organization.id}"]
- dry_run_output = StringIO()
-
- call_command("migrate_dashboard_collaborators", *args, "--dry-run", stdout=dry_run_output)
-
- dashboard.refresh_from_db()
- assert dashboard.restriction_level == Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT
- assert not AccessControl.objects.filter(resource="dashboard", resource_id=str(dashboard.id)).exists()
- assert "Would migrate 1 dashboard across 1 organization." in dry_run_output.getvalue()
-
- call_command("migrate_dashboard_collaborators", *args)
- dashboard.refresh_from_db()
- assert dashboard.restriction_level == Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT
- access_controls = AccessControl.objects.filter(resource="dashboard", resource_id=str(dashboard.id))
- assert access_controls.count() == 1
- assert access_controls.get().access_level == "viewer"
-
- call_command("migrate_dashboard_collaborators", *args, stdout=StringIO())
- assert access_controls.count() == 1
diff --git a/posthog/management/migration_analysis/atomic_false_acknowledged_migrations.txt b/posthog/management/migration_analysis/atomic_false_acknowledged_migrations.txt
index e099d8127c54..6400428f91da 100644
--- a/posthog/management/migration_analysis/atomic_false_acknowledged_migrations.txt
+++ b/posthog/management/migration_analysis/atomic_false_acknowledged_migrations.txt
@@ -53,6 +53,7 @@ signals.0177_backfill_scout_notebook_write
# the child instead of all 14 tables at once. Re-running is a no-op: DropForeignKey reads what is left from pg_constraint.
posthog.1383_taggeditem_untrack_legacy_keys
ee.0064_split_identity_provider_config_scopes
+ee.0065_migrate_dashboard_collaborators
conversations.0076_tag_legacy_conversation_attachments
posthog.1398_remove_userproductlist_state
data_modeling.0047_remove_datawarehousemodelpath_state
diff --git a/posthog/models/resource_transfer/test/__snapshots__/test_visitor_field_snapshots.ambr b/posthog/models/resource_transfer/test/__snapshots__/test_visitor_field_snapshots.ambr
index a5e2d0ba10f3..56fa7f52a784 100644
--- a/posthog/models/resource_transfer/test/__snapshots__/test_visitor_field_snapshots.ambr
+++ b/posthog/models/resource_transfer/test/__snapshots__/test_visitor_field_snapshots.ambr
@@ -182,7 +182,6 @@
'name',
'pinned',
'quick_filter_ids',
- 'restriction_level',
'variables',
])
# ---
@@ -572,8 +571,6 @@
'CreationMode',
'DoesNotExist',
'MultipleObjectsReturned',
- 'PrivilegeLevel',
- 'RestrictionLevel',
'__annotate_func__',
'__doc__',
'__firstlineno__',
@@ -594,7 +591,6 @@
'get_file_system_unfiled',
'get_next_by_created_at',
'get_previous_by_created_at',
- 'get_restriction_level_display',
'id',
'is_shared',
'is_sharing_enabled',
@@ -604,7 +600,6 @@
'objects',
'objects_including_soft_deleted',
'primary_dashboard_teams',
- 'privileges',
'share_token',
'sharingconfiguration_set',
'tagged_items',
diff --git a/posthog/rbac/migrations/rbac_dashboard_migration.py b/posthog/rbac/migrations/rbac_dashboard_migration.py
index ca4160d2c7f2..8ce19a39b27e 100644
--- a/posthog/rbac/migrations/rbac_dashboard_migration.py
+++ b/posthog/rbac/migrations/rbac_dashboard_migration.py
@@ -1,194 +1,109 @@
-from typing import Literal
+"""Convert collaborator edit limits without replacing the dashboard's live ACLs.
+
+The legacy column and privileges stay intact for previous-release pods during a rolling deploy.
+The separate resource keeps the new limits out of those pods' dashboard ACL resolution.
+"""
+
+from typing import Any
from django.db import transaction
from django.db.models import Q
import structlog
-from posthog.constants import AvailableFeature
-from posthog.exceptions_capture import capture_exception
-from posthog.models.organization import Organization, OrganizationMembership
-
-from products.access_control.backend.facade.user_access_control import ordered_access_levels
-from products.access_control.backend.models.access_control import AccessControl
-from products.access_control.backend.models.role import RoleMembership
-from products.dashboards.backend.models.dashboard import Dashboard
-
logger = structlog.get_logger(__name__)
-
-def _has_dashboard_role_access(
- dashboard: Dashboard,
- organization: Organization,
- user_id: int,
-) -> bool:
- if not organization.is_feature_available(AvailableFeature.ROLE_BASED_ACCESS):
- return False
-
- role_ids = (
- RoleMembership.objects.filter(user_id=user_id, role__organization_id=organization.id)
- .valid_for_authorization()
- .values("role_id")
- )
- return (
- AccessControl.objects.filter(
- team_id=dashboard.team_id,
- resource="dashboard",
- organization_member__isnull=True,
- role_id__in=role_ids,
- )
- .filter(Q(resource_id=str(dashboard.id)) | Q(resource_id__isnull=True))
- .exists()
- )
-
-
-def _ensure_dashboard_access_control(
- dashboard: Dashboard,
- organization_member: OrganizationMembership | None,
- access_level: Literal["viewer", "editor"],
-) -> None:
- access_control = AccessControl.objects.filter(
- team_id=dashboard.team_id,
- resource="dashboard",
- resource_id=str(dashboard.id),
- organization_member=organization_member,
- role__isnull=True,
- ).first()
- if access_control is None:
- AccessControl.objects.create(
- team_id=dashboard.team_id,
- access_level=access_level,
- resource="dashboard",
- resource_id=str(dashboard.id),
- organization_member=organization_member,
+ONLY_COLLABORATORS_CAN_EDIT = 37
+# Mirrors the runtime resource in UserAccessControl without importing live models into a migration.
+DASHBOARD_EDIT_LIMIT_RESOURCE = "dashboard_edit_limit"
+DASHBOARD_ACCESS_LEVELS = ("none", "viewer", "editor", "manager")
+
+
+def rbac_dashboard_access_control_migration(apps: Any, schema_editor: Any) -> None:
+ OrganizationMembership = apps.get_model("posthog", "OrganizationMembership")
+ AccessControl = apps.get_model("ee", "AccessControl")
+ DashboardPrivilege = apps.get_model("ee", "DashboardPrivilege")
+ db_alias = schema_editor.connection.alias
+
+ with schema_editor.connection.cursor() as cursor:
+ cursor.execute(
+ """
+ SELECT d.id, d.team_id, t.organization_id
+ FROM posthog_dashboard d
+ JOIN posthog_team t ON t.id = d.team_id
+ WHERE d.restriction_level = %s
+ ORDER BY d.id
+ """,
+ [ONLY_COLLABORATORS_CAN_EDIT],
)
- return
-
- if access_control.access_level in ordered_access_levels("dashboard"):
- return
-
- logger.warning(
- "Replacing invalid dashboard access level during migration",
- access_control_id=access_control.id,
- invalid_access_level=access_control.access_level,
- replacement_access_level=access_level,
- )
- access_control.access_level = access_level
- access_control.save(update_fields=["access_level"])
-
-
-def rbac_dashboard_access_control_migration(organization_id: int) -> None:
- """
- This migration converts legacy dashboard permissions to the new RBAC system.
-
- It handles two cases:
- 1. Dashboards with restriction_level=37 (ONLY_COLLABORATORS_CAN_EDIT):
- - Creates a default "view" access control entry
- - Changes restriction_level to 21 (EVERYONE_IN_PROJECT_CAN_EDIT)
- 2. Dashboard privilege rows:
- - Converts each DashboardPrivilege to an AccessControl entry with "edit" access
- - Removes the original DashboardPrivilege entries
- """
- logger.info("Starting RBAC dashboard migrations", organization_id=organization_id)
-
- try:
- with transaction.atomic():
- organization = Organization.objects.get(id=organization_id)
-
- # Get dashboards that need migration (restriction level 37)
- team_ids = organization.teams.values_list("id", flat=True)
- restricted_dashboards = Dashboard.objects.filter(
- team_id__in=team_ids, restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT
+ restricted_dashboards = cursor.fetchall()
+
+ for dashboard_id, team_id, organization_id in restricted_dashboards:
+ with transaction.atomic(using=db_alias):
+ with schema_editor.connection.cursor() as cursor:
+ cursor.execute(
+ "SELECT id FROM posthog_dashboard WHERE id = %s AND restriction_level = %s FOR UPDATE",
+ [dashboard_id, ONLY_COLLABORATORS_CAN_EDIT],
+ )
+ if cursor.fetchone() is None:
+ continue
+
+ limits = AccessControl.objects.using(db_alias).filter(
+ team_id=team_id, resource=DASHBOARD_EDIT_LIMIT_RESOURCE, resource_id=str(dashboard_id)
)
-
- for dashboard in restricted_dashboards:
- try:
- _ensure_dashboard_access_control(
- dashboard,
- organization_member=None,
+ if limits.exists():
+ continue
+
+ # Invalid rules must not abort every upgrade retry or turn into edit grants.
+ repaired_dashboard_rules = (
+ AccessControl.objects.using(db_alias)
+ .filter(team_id=team_id, resource="dashboard")
+ .filter(Q(resource_id=str(dashboard_id)) | Q(resource_id__isnull=True))
+ .exclude(access_level__in=DASHBOARD_ACCESS_LEVELS)
+ .update(access_level="viewer")
+ )
+ repaired_project_rules = (
+ AccessControl.objects.using(db_alias)
+ .filter(team_id=team_id, resource="project", resource_id=str(team_id))
+ .exclude(access_level__in=("none", "member", "admin"))
+ .update(access_level="none")
+ )
+ if repaired_dashboard_rules or repaired_project_rules:
+ logger.warning(
+ "Repaired invalid access levels during dashboard conversion",
+ dashboard_id=dashboard_id,
+ dashboard_rules=repaired_dashboard_rules,
+ project_rules=repaired_project_rules,
+ )
+
+ editor_ids = (
+ DashboardPrivilege.objects.using(db_alias)
+ .filter(dashboard_id=dashboard_id, level=ONLY_COLLABORATORS_CAN_EDIT)
+ .values("user_id")
+ )
+ memberships = (
+ OrganizationMembership.objects.using(db_alias)
+ .filter(organization_id=organization_id, user_id__in=editor_ids)
+ .values_list("id", flat=True)
+ )
+ AccessControl.objects.using(db_alias).bulk_create(
+ [
+ AccessControl(
+ team_id=team_id,
+ resource=DASHBOARD_EDIT_LIMIT_RESOURCE,
+ resource_id=str(dashboard_id),
access_level="viewer",
- )
-
- # Convert dashboard privileges to access control entries
- try:
- from ee.models import DashboardPrivilege
-
- dashboard_privileges = DashboardPrivilege.objects.filter(dashboard_id=dashboard.id)
-
- for privilege in dashboard_privileges:
- try:
- # Find the organization membership for this user
- org_membership = OrganizationMembership.objects.filter(
- user=privilege.user, organization=organization
- ).first()
-
- if not org_membership:
- logger.warning(
- "No organization membership found for user",
- user_id=privilege.user.id,
- dashboard_id=dashboard.id,
- )
- continue
-
- if _has_dashboard_role_access(dashboard, organization, privilege.user_id):
- logger.info(
- "Preserving role-based dashboard access for collaborator",
- dashboard_id=dashboard.id,
- user_id=privilege.user_id,
- )
- else:
- _ensure_dashboard_access_control(
- dashboard,
- organization_member=org_membership,
- access_level="editor",
- )
-
- privilege.delete()
- logger.info(
- "Migrated dashboard privilege to access control",
- dashboard_id=dashboard.id,
- user_id=privilege.user.id,
- team_id=dashboard.team_id,
- )
-
- except Exception as e:
- error_message = f"Failed to migrate dashboard privilege for user {privilege.user.id}"
- logger.exception(error_message, exc_info=e)
- capture_exception(
- e,
- additional_properties={
- "dashboard_id": dashboard.id,
- "user_id": privilege.user.id,
- "organization_id": organization_id,
- },
- )
- raise
-
- except ImportError:
- # DashboardPrivilege model not available, skip privilege migration
- logger.info("DashboardPrivilege model not available, skipping privilege migration")
-
- # Update restriction level to EVERYONE_IN_PROJECT_CAN_EDIT (21)
- dashboard.restriction_level = Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT
- dashboard.save(update_fields=["restriction_level"])
-
- logger.info(
- "Updated dashboard restriction level",
- dashboard_id=dashboard.id,
- new_restriction_level=dashboard.restriction_level,
- )
-
- except Exception as e:
- error_message = f"Failed to migrate dashboard {dashboard.id}"
- logger.exception(error_message, exc_info=e)
- capture_exception(
- e, additional_properties={"dashboard_id": dashboard.id, "organization_id": organization_id}
- )
- raise
-
- logger.info("Finished RBAC dashboard migrations", organization_id=organization_id)
- except Exception as e:
- error_message = f"Failed to complete RBAC dashboard migration for organization {organization_id}"
- logger.exception(error_message, exc_info=e)
- capture_exception(e, additional_properties={"organization_id": organization_id})
- raise
+ ),
+ *[
+ AccessControl(
+ team_id=team_id,
+ resource=DASHBOARD_EDIT_LIMIT_RESOURCE,
+ resource_id=str(dashboard_id),
+ organization_member_id=membership_id,
+ access_level="editor",
+ )
+ for membership_id in memberships
+ ],
+ ],
+ batch_size=1000,
+ )
diff --git a/posthog/rbac/migrations/test/test_rbac_dashboard_migration.py b/posthog/rbac/migrations/test/test_rbac_dashboard_migration.py
deleted file mode 100644
index 19affbc02e7e..000000000000
--- a/posthog/rbac/migrations/test/test_rbac_dashboard_migration.py
+++ /dev/null
@@ -1,394 +0,0 @@
-import pytest
-from posthog.test.base import BaseTest
-
-from parameterized import parameterized
-
-from posthog.constants import AvailableFeature
-from posthog.models.organization import Organization, OrganizationMembership
-from posthog.models.team.team import Team
-from posthog.models.user import User
-from posthog.rbac.migrations.rbac_dashboard_migration import rbac_dashboard_access_control_migration
-
-from products.access_control.backend.facade.user_access_control import UserAccessControl
-from products.access_control.backend.models.access_control import AccessControl
-from products.access_control.backend.models.role import Role, RoleMembership
-from products.dashboards.backend.models.dashboard import Dashboard
-
-from ee.models.dashboard_privilege import DashboardPrivilege
-
-
-class TestRBACDashboardMigration(BaseTest):
- def setUp(self):
- super().setUp()
- # Enable access control for the organization
- self.organization.available_product_features = [
- {
- "key": AvailableFeature.ACCESS_CONTROL,
- "name": AvailableFeature.ACCESS_CONTROL,
- },
- ]
- self.organization.save()
-
- # Create additional users and team members
- self.user2 = User.objects.create_and_join(self.organization, "[email protected]", "password123")
- self.user3 = User.objects.create_and_join(self.organization, "[email protected]", "password123")
-
- # Get organization memberships
- self.user1_membership = OrganizationMembership.objects.get(user=self.user, organization=self.organization)
- self.user2_membership = OrganizationMembership.objects.get(user=self.user2, organization=self.organization)
- self.user3_membership = OrganizationMembership.objects.get(user=self.user3, organization=self.organization)
-
- def test_migrate_dashboard_with_restriction_level_37_no_privileges(self):
- """Test migrating a dashboard with restriction level 37 but no existing privileges"""
- # Create a dashboard with restriction level 37 (ONLY_COLLABORATORS_CAN_EDIT)
- dashboard = Dashboard.objects.create(
- team=self.team,
- name="Restricted Dashboard",
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
-
- # Verify initial state
- self.assertEqual(dashboard.restriction_level, Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT)
- self.assertFalse(AccessControl.objects.filter(resource="dashboard", resource_id=str(dashboard.id)).exists())
-
- # Run migration
- rbac_dashboard_access_control_migration(self.organization.id)
-
- # Reload dashboard from database
- dashboard.refresh_from_db()
-
- # Verify dashboard restriction level was updated
- self.assertEqual(dashboard.restriction_level, Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT)
-
- # Verify default access control was created
- access_controls = AccessControl.objects.filter(resource="dashboard", resource_id=str(dashboard.id))
- self.assertEqual(access_controls.count(), 1)
-
- default_ac = access_controls.first()
- assert default_ac is not None
- self.assertEqual(default_ac.access_level, "viewer")
- self.assertEqual(default_ac.team_id, self.team.id)
- self.assertIsNone(default_ac.organization_member)
- self.assertIsNone(default_ac.role)
-
- def test_migrate_dashboard_with_restriction_level_37_and_privileges(self):
- """Test migrating a dashboard with restriction level 37 and existing dashboard privileges"""
- # Create a dashboard with restriction level 37
- dashboard = Dashboard.objects.create(
- team=self.team,
- name="Restricted Dashboard with Privileges",
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
-
- # Create dashboard privileges for users
- DashboardPrivilege.objects.create(
- dashboard=dashboard,
- user=self.user2,
- level=Dashboard.PrivilegeLevel.CAN_EDIT,
- )
- DashboardPrivilege.objects.create(
- dashboard=dashboard,
- user=self.user3,
- level=Dashboard.PrivilegeLevel.CAN_VIEW,
- )
-
- # Verify initial state
- self.assertEqual(DashboardPrivilege.objects.filter(dashboard=dashboard).count(), 2)
-
- # Run migration
- rbac_dashboard_access_control_migration(self.organization.id)
-
- # Reload dashboard from database
- dashboard.refresh_from_db()
-
- # Verify dashboard restriction level was updated
- self.assertEqual(dashboard.restriction_level, Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT)
-
- # Verify access controls were created
- access_controls = AccessControl.objects.filter(resource="dashboard", resource_id=str(dashboard.id))
- self.assertEqual(access_controls.count(), 3) # 1 default + 2 user privileges
-
- # Verify default access control
- default_ac = access_controls.filter(organization_member=None, role=None).first()
- assert default_ac is not None
- self.assertEqual(default_ac.access_level, "viewer")
-
- # Verify user-specific access controls
- user2_ac = access_controls.filter(organization_member=self.user2_membership).first()
- assert user2_ac is not None
- self.assertEqual(user2_ac.access_level, "editor")
-
- user3_ac = access_controls.filter(organization_member=self.user3_membership).first()
- assert user3_ac is not None
- self.assertEqual(user3_ac.access_level, "editor") # All privileges become "editor"
-
- # Verify original privileges were deleted
- self.assertEqual(DashboardPrivilege.objects.filter(dashboard=dashboard).count(), 0)
-
- def test_migrate_dashboard_with_restriction_level_21_ignored(self):
- """Test that dashboards with restriction level 21 are ignored"""
- # Create a dashboard with restriction level 21 (EVERYONE_IN_PROJECT_CAN_EDIT)
- dashboard = Dashboard.objects.create(
- team=self.team,
- name="Unrestricted Dashboard",
- restriction_level=Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT,
- )
-
- # Run migration
- rbac_dashboard_access_control_migration(self.organization.id)
-
- # Reload dashboard from database
- dashboard.refresh_from_db()
-
- # Verify dashboard restriction level was not changed
- self.assertEqual(dashboard.restriction_level, Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT)
-
- # Verify no access controls were created
- self.assertFalse(AccessControl.objects.filter(resource="dashboard", resource_id=str(dashboard.id)).exists())
-
- def test_migration_handles_user_without_organization_membership(self):
- """Test that migration handles users without organization membership gracefully"""
- # Create a dashboard with restriction level 37
- dashboard = Dashboard.objects.create(
- team=self.team,
- name="Dashboard with Invalid User",
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
-
- # Create a user without organization membership
- orphaned_user = User.objects.create(email="[email protected]", password="password123")
-
- # Create a dashboard privilege for the orphaned user
- DashboardPrivilege.objects.create(
- dashboard=dashboard,
- user=orphaned_user,
- level=Dashboard.PrivilegeLevel.CAN_EDIT,
- )
-
- # Run migration (should not raise exception)
- rbac_dashboard_access_control_migration(self.organization.id)
-
- # Reload dashboard from database
- dashboard.refresh_from_db()
-
- # Verify dashboard was still migrated
- self.assertEqual(dashboard.restriction_level, Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT)
-
- # Verify default access control was created
- default_ac = AccessControl.objects.filter(
- resource="dashboard", resource_id=str(dashboard.id), organization_member=None, role=None
- ).first()
- assert default_ac is not None
- self.assertEqual(default_ac.access_level, "viewer")
-
- # Verify no access control was created for the orphaned user
- self.assertFalse(
- AccessControl.objects.filter(
- resource="dashboard", resource_id=str(dashboard.id), organization_member__user=orphaned_user
- ).exists()
- )
-
- # The original privilege should NOT be deleted since we couldn't find org membership
- # This is correct behavior - we skip processing for orphaned users
- orphaned_privilege_count = DashboardPrivilege.objects.filter(user=orphaned_user).count()
- self.assertEqual(orphaned_privilege_count, 1) # Should still exist
-
- def test_migration_completes_when_access_control_already_exists(self):
- dashboard = Dashboard.objects.create(
- team=self.team,
- name="Dashboard with Existing Access Control",
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
- existing_ac = AccessControl.objects.create(
- team_id=self.team.id,
- access_level="manager",
- resource="dashboard",
- resource_id=str(dashboard.id),
- organization_member=self.user1_membership,
- )
- default_ac = AccessControl.objects.create(
- team_id=self.team.id,
- access_level="invalid",
- resource="dashboard",
- resource_id=str(dashboard.id),
- )
- member_ac = AccessControl.objects.create(
- team_id=self.team.id,
- access_level="invalid",
- resource="dashboard",
- resource_id=str(dashboard.id),
- organization_member=self.user2_membership,
- )
- DashboardPrivilege.objects.create(
- dashboard=dashboard,
- user=self.user2,
- level=Dashboard.PrivilegeLevel.CAN_EDIT,
- )
-
- rbac_dashboard_access_control_migration(self.organization.id)
-
- dashboard.refresh_from_db()
- self.assertEqual(dashboard.restriction_level, Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT)
- self.assertEqual(AccessControl.objects.filter(resource="dashboard", resource_id=str(dashboard.id)).count(), 3)
- default_ac.refresh_from_db()
- self.assertEqual(default_ac.access_level, "viewer")
- member_ac.refresh_from_db()
- self.assertEqual(member_ac.access_level, "editor")
- self.assertTrue(AccessControl.objects.filter(id=existing_ac.id).exists())
- self.assertFalse(DashboardPrivilege.objects.filter(dashboard=dashboard).exists())
-
- rbac_dashboard_access_control_migration(self.organization.id)
-
- self.assertEqual(AccessControl.objects.filter(resource="dashboard", resource_id=str(dashboard.id)).count(), 3)
-
- def test_migration_preserves_existing_access_control_denials_and_viewers(self):
- dashboard = Dashboard.objects.create(
- team=self.team,
- name="Dashboard with existing restrictions",
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
- default_access = AccessControl.objects.create(
- team_id=self.team.id,
- access_level="none",
- resource="dashboard",
- resource_id=str(dashboard.id),
- )
- member_access = AccessControl.objects.create(
- team_id=self.team.id,
- access_level="viewer",
- resource="dashboard",
- resource_id=str(dashboard.id),
- organization_member=self.user2_membership,
- )
- DashboardPrivilege.objects.create(
- dashboard=dashboard,
- user=self.user2,
- level=Dashboard.PrivilegeLevel.CAN_EDIT,
- )
-
- rbac_dashboard_access_control_migration(self.organization.id)
-
- dashboard.refresh_from_db()
- default_access.refresh_from_db()
- member_access.refresh_from_db()
- self.assertEqual(dashboard.restriction_level, Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT)
- self.assertEqual(default_access.access_level, "none")
- self.assertEqual(member_access.access_level, "viewer")
- self.assertFalse(DashboardPrivilege.objects.filter(dashboard=dashboard).exists())
-
- @parameterized.expand([("viewer",), ("none",)])
- def test_migration_preserves_role_based_dashboard_access(self, role_access_level: str) -> None:
- self.organization.available_product_features = (self.organization.available_product_features or []) + [
- {"key": AvailableFeature.ROLE_BASED_ACCESS, "name": AvailableFeature.ROLE_BASED_ACCESS}
- ]
- self.organization.save()
- role = Role.objects.create(name="Dashboard viewers", organization=self.organization)
- RoleMembership.objects.create(
- role=role,
- user=self.user2,
- organization_member=self.user2_membership,
- )
- dashboard = Dashboard.objects.create(
- team=self.team,
- name="Dashboard with role access",
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
- AccessControl.objects.create(
- team_id=self.team.id,
- access_level=role_access_level,
- resource="dashboard",
- resource_id=str(dashboard.id),
- role=role,
- )
- DashboardPrivilege.objects.create(
- dashboard=dashboard,
- user=self.user2,
- level=Dashboard.PrivilegeLevel.CAN_EDIT,
- )
-
- rbac_dashboard_access_control_migration(self.organization.id)
-
- dashboard.refresh_from_db()
- self.assertEqual(dashboard.restriction_level, Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT)
- self.assertFalse(
- AccessControl.objects.filter(
- team_id=self.team.id,
- resource="dashboard",
- resource_id=str(dashboard.id),
- organization_member=self.user2_membership,
- role=None,
- ).exists()
- )
- self.assertFalse(DashboardPrivilege.objects.filter(dashboard=dashboard).exists())
- user_access = UserAccessControl(user=self.user2, team=self.team)
- self.assertFalse(user_access.check_access_level_for_object(dashboard, "editor"))
- self.assertEqual(
- user_access.check_access_level_for_object(dashboard, "viewer"),
- role_access_level == "viewer",
- )
-
- def test_migration_handles_multiple_teams_in_organization(self):
- """Test that migration works correctly with multiple teams in the organization"""
- # Create another team in the same organization
- team2 = Team.objects.create(organization=self.organization, name="Team 2")
-
- # Create dashboards in both teams
- dashboard1 = Dashboard.objects.create(
- team=self.team,
- name="Team 1 Dashboard",
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
- dashboard2 = Dashboard.objects.create(
- team=team2,
- name="Team 2 Dashboard",
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
-
- # Run migration
- rbac_dashboard_access_control_migration(self.organization.id)
-
- # Verify both dashboards were migrated
- dashboard1.refresh_from_db()
- dashboard2.refresh_from_db()
-
- self.assertEqual(dashboard1.restriction_level, Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT)
- self.assertEqual(dashboard2.restriction_level, Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT)
-
- # Verify access controls were created for both dashboards
- self.assertTrue(AccessControl.objects.filter(resource="dashboard", resource_id=str(dashboard1.id)).exists())
- self.assertTrue(AccessControl.objects.filter(resource="dashboard", resource_id=str(dashboard2.id)).exists())
-
- def test_migration_handles_organization_not_found(self):
- """Test that migration raises exception for non-existent organization"""
- with self.assertRaises(Organization.DoesNotExist):
- rbac_dashboard_access_control_migration(999999)
-
- def test_migration_is_idempotent(self):
- """Test that running the migration multiple times doesn't create duplicates"""
- # Create a dashboard with restriction level 37
- dashboard = Dashboard.objects.create(
- team=self.team,
- name="Idempotent Test Dashboard",
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
-
- # Run migration first time
- rbac_dashboard_access_control_migration(self.organization.id)
-
- # Verify state after first migration
- dashboard.refresh_from_db()
- self.assertEqual(dashboard.restriction_level, Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT)
- access_controls_count = AccessControl.objects.filter(
- resource="dashboard", resource_id=str(dashboard.id)
- ).count()
- self.assertEqual(access_controls_count, 1)
-
- # Run migration second time
- rbac_dashboard_access_control_migration(self.organization.id)
-
- # Verify no duplicates were created
- final_access_controls_count = AccessControl.objects.filter(
- resource="dashboard", resource_id=str(dashboard.id)
- ).count()
- self.assertEqual(final_access_controls_count, access_controls_count)
diff --git a/posthog/test/repo_invariants/test_pagination_contract.py b/posthog/test/repo_invariants/test_pagination_contract.py
index a895b16c8ac1..e1350df82abf 100644
--- a/posthog/test/repo_invariants/test_pagination_contract.py
+++ b/posthog/test/repo_invariants/test_pagination_contract.py
@@ -20,9 +20,7 @@ LIST_VIEWSETS_WITHOUT_DIRECT_SHARED_PAGINATION = {
"products.cdp.backend.api.hog_function_template.PublicHogFunctionTemplateViewSet",
"products.conversations.backend.api.tickets.TicketViewSet",
"products.customer_analytics.backend.presentation.views.views.AccountViewSet",
- "products.dashboards.backend.api.dashboard.LegacyInsightViewSet",
"products.managed_migrations.backend.api.support_batch_imports.BatchImportSupportViewSet",
- "products.product_analytics.backend.presentation.insight_ee.EnterpriseInsightsViewSet",
"products.reminders.backend.api.reminder.ReminderViewSet",
"products.workflows.backend.presentation.views.hog_flow_template.PublicHogFlowTemplateViewSet",
}
@@ -204,7 +202,7 @@ EXISTING_CUSTOM_LIST_VIEWSETS = {
"products.notebooks.backend.presentation.views.reusable_widget.ReusableWidgetViewSet",
"products.notifications.backend.presentation.views.NotificationsViewSet",
"products.product_analytics.backend.presentation.events_retention.EventsRetentionViewSet",
- "products.product_analytics.backend.presentation.insight_ee.EnterpriseInsightsViewSet",
+ "products.product_analytics.backend.presentation.insight.InsightViewSet",
"products.product_tours.backend.api.product_tour.ProductTourViewSet",
"products.replay_vision.backend.api.observations.ReplayObservationViewSet",
"products.replay_vision.backend.api.observations.SessionReplayObservationViewSet",
diff --git a/posthog/test/repo_invariants/test_serializer_timestamp_guard.py b/posthog/test/repo_invariants/test_serializer_timestamp_guard.py
index 5bdd5c5ae667..ee8c08b65146 100644
--- a/posthog/test/repo_invariants/test_serializer_timestamp_guard.py
+++ b/posthog/test/repo_invariants/test_serializer_timestamp_guard.py
@@ -116,7 +116,6 @@ REVIEWED_WRITABLE: dict[str, str] = {
"products.conversations.backend.api.tickets.TicketUpdateRequestSerializer.sla_due_at": "Client or a workflow sets the SLA deadline, and null clears it",
"products.conversations.backend.api.tickets.TicketUpdateRequestSerializer.snoozed_until": "Client-set instant: the ticket action assigns validated_data['snoozed_until'] to ticket.snoozed_until, with no relative-duration parsing on this path",
"products.dashboards.backend.api.dashboard.DashboardSerializer.last_refresh": "The frontend PATCHes successful forced-refresh completion so reopening the dashboard retains its shared cooldown",
- "products.dashboards.backend.api.dashboard.DashboardWriteOpenApiSerializer.last_refresh": "The frontend persists successful forced-refresh completion so reopening the dashboard retains its shared cooldown",
"products.experiments.backend.presentation.serializers.ExperimentSerializer.end_date": "Client stops the experiment by setting this",
"products.experiments.backend.presentation.serializers.ExperimentSerializer.start_date": "Client launches the experiment by setting this",
"products.experiments.backend.presentation.serializers.ExperimentWriteSerializer.end_date": "Client stops the experiment by setting this",
diff --git a/posthog/test/test_user_permissions.py b/posthog/test/test_user_permissions.py
index d48d92be568c..72d61aefefda 100644
--- a/posthog/test/test_user_permissions.py
+++ b/posthog/test/test_user_permissions.py
@@ -11,11 +11,6 @@ from posthog.user_permissions import UserPermissions
from products.access_control.backend.models.access_control import AccessControl
from products.access_control.backend.models.role import Role, RoleMembership
-from products.dashboards.backend.models.dashboard import Dashboard
-from products.dashboards.backend.models.dashboard_tile import DashboardTile
-from products.product_analytics.backend.facade.models import Insight
-
-from ee.models.dashboard_privilege import DashboardPrivilege
class WithPermissionsBase:
@@ -688,248 +683,6 @@ class TestUserTeamPermissions(BaseTest, WithPermissionsBase):
assert self.permissions().current_team.effective_membership_level is None
-class TestUserDashboardPermissions(BaseTest, WithPermissionsBase):
- def setUp(self):
- super().setUp()
- self.organization.available_product_features = [
- {"key": AvailableFeature.ACCESS_CONTROL, "name": AvailableFeature.ACCESS_CONTROL}
- ]
- self.organization.save()
- self.dashboard = Dashboard.objects.create(team=self.team)
-
- def dashboard_permissions(self):
- return self.permissions().dashboard(self.dashboard)
-
- def test_dashboard_effective_restriction_level(self):
- assert (
- self.dashboard_permissions().effective_restriction_level
- == Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT
- )
-
- def test_dashboard_effective_restriction_level_explicit(self):
- self.dashboard.restriction_level = Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT
- self.dashboard.save()
-
- assert (
- self.dashboard_permissions().effective_restriction_level
- == Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT
- )
-
- def test_dashboard_effective_restriction_level_when_feature_not_available(self):
- self.organization.available_product_features = []
- self.organization.save()
-
- self.dashboard.restriction_level = Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT
- self.dashboard.save()
-
- assert (
- self.dashboard_permissions().effective_restriction_level
- == Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT
- )
-
- def test_dashboard_can_restrict(self):
- from products.access_control.backend.models.access_control import AccessControl
-
- # Explicitly set project default access to member level so the user
- # doesn't get the implicit admin default
- AccessControl.objects.create(
- team=self.team,
- resource="project",
- resource_id=str(self.team.id),
- organization_member=None,
- role=None,
- access_level="member",
- )
- assert not self.dashboard_permissions().can_restrict
-
- def test_dashboard_can_restrict_as_admin(self):
- self.organization_membership.level = OrganizationMembership.Level.ADMIN
- self.organization_membership.save()
-
- assert self.dashboard_permissions().can_restrict
-
- def test_dashboard_can_restrict_as_creator(self):
- self.dashboard.created_by = self.user
- self.dashboard.save()
-
- assert self.dashboard_permissions().can_restrict
-
- def test_dashboard_effective_privilege_level_when_everyone_can_edit(self):
- self.dashboard.restriction_level = Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT
- self.dashboard.save()
-
- assert self.dashboard_permissions().effective_privilege_level == Dashboard.PrivilegeLevel.CAN_EDIT
-
- def test_dashboard_effective_privilege_level_when_collaborators_can_edit(self):
- from products.access_control.backend.models.access_control import AccessControl
-
- self.dashboard.restriction_level = Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT
- self.dashboard.save()
-
- # Explicitly set project default access to member level so the user
- # doesn't get the implicit admin default (which would grant can_restrict)
- AccessControl.objects.create(
- team=self.team,
- resource="project",
- resource_id=str(self.team.id),
- organization_member=None,
- role=None,
- access_level="member",
- )
-
- assert self.dashboard_permissions().effective_privilege_level == Dashboard.PrivilegeLevel.CAN_VIEW
-
- def test_dashboard_effective_privilege_level_priviledged(self):
- self.dashboard.restriction_level = Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT
- self.dashboard.save()
-
- DashboardPrivilege.objects.create(
- user=self.user,
- dashboard=self.dashboard,
- level=Dashboard.PrivilegeLevel.CAN_EDIT,
- )
-
- assert self.dashboard_permissions().effective_privilege_level == Dashboard.PrivilegeLevel.CAN_EDIT
-
- def test_dashboard_effective_privilege_level_creator(self):
- self.dashboard.restriction_level = Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT
- self.dashboard.save()
- self.dashboard.created_by = self.user
- self.dashboard.save()
-
- assert self.dashboard_permissions().effective_privilege_level == Dashboard.PrivilegeLevel.CAN_EDIT
-
- def test_dashboard_can_edit_when_everyone_can(self):
- self.dashboard.restriction_level = Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT
- self.dashboard.save()
-
- assert self.dashboard_permissions().can_edit
-
- def test_dashboard_can_edit_not_collaborator(self):
- from products.access_control.backend.models.access_control import AccessControl
-
- self.dashboard.restriction_level = Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT
- self.dashboard.save()
-
- # Explicitly set project default access to member level so the user
- # doesn't get the implicit admin default (which would grant can_restrict -> can_edit)
- AccessControl.objects.create(
- team=self.team,
- resource="project",
- resource_id=str(self.team.id),
- organization_member=None,
- role=None,
- access_level="member",
- )
-
- assert not self.dashboard_permissions().can_edit
-
- def test_dashboard_can_edit_creator(self):
- self.dashboard.restriction_level = Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT
- self.dashboard.save()
- self.dashboard.created_by = self.user
- self.dashboard.save()
-
- assert self.dashboard_permissions().can_edit
-
- def test_dashboard_can_edit_priviledged(self):
- self.dashboard.restriction_level = Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT
- self.dashboard.save()
-
- DashboardPrivilege.objects.create(
- user=self.user,
- dashboard=self.dashboard,
- level=Dashboard.PrivilegeLevel.CAN_EDIT,
- )
-
- assert self.dashboard_permissions().can_edit
-
-
-class TestUserInsightPermissions(BaseTest, WithPermissionsBase):
- def setUp(self):
- super().setUp()
- self.organization.available_product_features = [
- {"key": AvailableFeature.ACCESS_CONTROL, "name": AvailableFeature.ACCESS_CONTROL}
- ]
- self.organization.save()
-
- self.dashboard1 = Dashboard.objects.create(
- team=self.team,
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
- self.dashboard2 = Dashboard.objects.create(team=self.team)
- self.insight = Insight.objects.create(team=self.team)
- self.tile1 = DashboardTile.objects.create(dashboard=self.dashboard1, insight=self.insight)
- self.tile2 = DashboardTile.objects.create(dashboard=self.dashboard2, insight=self.insight)
-
- def insight_permissions(self):
- return self.permissions().insight(self.insight)
-
- def test_effective_restriction_level_limited(self):
- assert (
- self.insight_permissions().effective_restriction_level
- == Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT
- )
-
- def test_effective_restriction_level_all_allow(self):
- Dashboard.objects.all().update(restriction_level=Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT)
-
- assert (
- self.insight_permissions().effective_restriction_level
- == Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT
- )
-
- def test_effective_restriction_level_with_no_dashboards(self):
- DashboardTile.objects.all().delete()
-
- assert (
- self.insight_permissions().effective_restriction_level
- == Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT
- )
-
- def test_effective_restriction_level_with_no_permissioning(self):
- self.organization.available_product_features = []
- self.organization.save()
-
- assert (
- self.insight_permissions().effective_restriction_level
- == Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT
- )
-
- def test_effective_privilege_level_all_limited(self):
- from products.access_control.backend.models.access_control import AccessControl
-
- Dashboard.objects.all().update(restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT)
-
- # Explicitly set project default access to member level so the user
- # doesn't get the implicit admin default (which would grant can_restrict -> can_edit)
- AccessControl.objects.create(
- team=self.team,
- resource="project",
- resource_id=str(self.team.id),
- organization_member=None,
- role=None,
- access_level="member",
- )
-
- assert self.insight_permissions().effective_privilege_level == Dashboard.PrivilegeLevel.CAN_VIEW
-
- def test_effective_privilege_level_some_limited(self):
- assert self.insight_permissions().effective_privilege_level == Dashboard.PrivilegeLevel.CAN_EDIT
-
- def test_effective_privilege_level_all_limited_as_collaborator(self):
- Dashboard.objects.all().update(restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT)
- self.dashboard1.created_by = self.user
- self.dashboard1.save()
-
- assert self.insight_permissions().effective_privilege_level == Dashboard.PrivilegeLevel.CAN_EDIT
-
- def test_effective_privilege_level_with_no_dashboards(self):
- DashboardTile.objects.all().delete()
-
- assert self.insight_permissions().effective_privilege_level == Dashboard.PrivilegeLevel.CAN_EDIT
-
-
class TestUserPermissionsEfficiency(BaseTest, WithPermissionsBase):
def test_project_ids_visible_for_user_queries_teams_once(self):
teams = [self.team]
@@ -943,37 +696,6 @@ class TestUserPermissionsEfficiency(BaseTest, WithPermissionsBase):
assert set(project_ids) == {team.project_id for team in teams}
- def test_dashboard_efficiency(self):
- self.organization.available_product_features = [
- {"name": AvailableFeature.ACCESS_CONTROL, "key": AvailableFeature.ACCESS_CONTROL},
- ]
- self.organization.save()
-
- dashboard = Dashboard.objects.create(
- team=self.team,
- restriction_level=Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT,
- )
- insights, tiles = [], []
- for _ in range(10):
- insight = Insight.objects.create(team=self.team)
- tile = DashboardTile.objects.create(dashboard=dashboard, insight=insight)
- insights.append(insight)
- tiles.append(tile)
-
- user_permissions = self.permissions()
- user_permissions.set_preloaded_dashboard_tiles(tiles)
-
- with self.assertNumQueries(4):
- assert user_permissions.current_team.effective_membership_level is not None
- assert user_permissions.dashboard(dashboard).effective_restriction_level is not None
- assert user_permissions.dashboard(dashboard).can_restrict is not None
- assert user_permissions.dashboard(dashboard).effective_privilege_level is not None
- assert user_permissions.dashboard(dashboard).can_edit is not None
-
- for insight in insights:
- assert user_permissions.insight(insight).effective_restriction_level is not None
- assert user_permissions.insight(insight).effective_privilege_level is not None
-
class TestProjectAccessResolversAgree(BaseTest):
def _plain_member(self) -> None:
diff --git a/posthog/user_permissions.py b/posthog/user_permissions.py
index b4e94eb431d4..fc98723670bd 100644
--- a/posthog/user_permissions.py
+++ b/posthog/user_permissions.py
@@ -6,11 +6,6 @@ from posthog.constants import AvailableFeature
from posthog.models import Organization, OrganizationMembership, Team, User
from posthog.organization_caching import get_cached_organization_memberships
-from products.dashboards.backend.facade.enums import PrivilegeLevel, RestrictionLevel
-from products.dashboards.backend.models.dashboard import Dashboard
-from products.dashboards.backend.models.dashboard_tile import DashboardTile
-from products.product_analytics.backend.facade.models import Insight
-
if TYPE_CHECKING:
from products.access_control.backend.models.access_control import AccessControl
@@ -22,21 +17,16 @@ class UserPermissions:
Generally responsible for the following tasks:
1. Calculating whether a user has access to the current team
2. Calculating whether a user has access to other team(s)
- 3. Calculating permissioning of a certain object (dashboard, insight) in the team
- Note that task 3 depends on task 1, so for efficiency sake the class _generally_
- expects the current team/organization to be passed to it and will use it to skip certain
- lookups.
+ For efficiency sake the class _generally_ expects the current team/organization to be
+ passed to it and will use it to skip certain lookups.
"""
def __init__(self, user: User, team: Optional[Team] = None):
self.user = user
self._current_team = team
- self._tiles: Optional[list[DashboardTile]] = None
self._team_permissions: dict[int, UserTeamPermissions] = {}
- self._dashboard_permissions: dict[int, UserDashboardPermissions] = {}
- self._insight_permissions: dict[int, UserInsightPermissions] = {}
@cached_property
def current_team(self) -> "UserTeamPermissions":
@@ -52,22 +42,6 @@ class UserPermissions:
self._team_permissions[team.pk] = UserTeamPermissions(self, team)
return self._team_permissions[team.pk]
- def dashboard(self, dashboard: Dashboard) -> "UserDashboardPermissions":
- if self._current_team is None:
- raise ValueError("Cannot call .dashboard without passing current team to UserPermissions")
-
- if dashboard.pk not in self._dashboard_permissions:
- self._dashboard_permissions[dashboard.pk] = UserDashboardPermissions(self, dashboard)
- return self._dashboard_permissions[dashboard.pk]
-
- def insight(self, insight: Insight) -> "UserInsightPermissions":
- if self._current_team is None:
- raise ValueError("Cannot call .insight without passing current team to UsePermissions")
-
- if insight.pk not in self._insight_permissions:
- self._insight_permissions[insight.pk] = UserInsightPermissions(self, insight)
- return self._insight_permissions[insight.pk]
-
@cached_property
def teams_visible_for_user(self) -> list[Team]:
candidate_teams = Team.objects.filter(organization_id__in=self.organizations.keys()).only(
@@ -103,16 +77,6 @@ class UserPermissions:
memberships = get_cached_organization_memberships(self.user)
return {membership.organization_id: membership for membership in memberships}
- @cached_property
- def dashboard_privileges(self) -> dict[int, PrivilegeLevel]:
- try:
- from ee.models import DashboardPrivilege
-
- rows = DashboardPrivilege.objects.filter(user=self.user).values_list("dashboard_id", "level")
- return {dashboard_id: cast(PrivilegeLevel, level) for dashboard_id, level in rows}
- except ImportError:
- return {}
-
@cached_property
def _prefetched_access_controls(self) -> dict[int, list["AccessControl"]]:
"""Project AccessControl rows that can change this user's answer, grouped by team_id.
@@ -167,28 +131,6 @@ class UserPermissions:
result.setdefault(organization_id, set()).add(role_id)
return result
- def set_preloaded_dashboard_tiles(self, tiles: list[DashboardTile]):
- """
- Allows for speeding up insight-related permissions code
- """
- self._tiles = tiles
-
- @cached_property
- def preloaded_insight_dashboards(self) -> Optional[list[Dashboard]]:
- if self._tiles is None:
- return None
-
- dashboard_ids = {tile.dashboard_id for tile in self._tiles}
- # nosemgrep: idor-lookup-without-team (IDs from internal FK query)
- return list(Dashboard.objects.filter(pk__in=dashboard_ids))
-
- def reset_insights_dashboard_cached_results(self):
- """
- Resets cached results for insights/dashboards. Useful for update methods.
- """
- self._dashboard_permissions = {}
- self._insight_permissions = {}
-
class UserTeamPermissions:
def __init__(self, user_permissions: "UserPermissions", team: Team):
@@ -296,89 +238,6 @@ def user_can_access_team(user: User, team: Team) -> bool:
return UserPermissions(user).team(team).effective_membership_level is not None
-class UserDashboardPermissions:
- def __init__(self, user_permissions: "UserPermissions", dashboard: Dashboard):
- self.p = user_permissions
- self.dashboard = dashboard
-
- @cached_property
- def effective_restriction_level(self) -> RestrictionLevel:
- return (
- RestrictionLevel(self.dashboard.restriction_level)
- if cast(Organization, self.p.current_organization).is_feature_available(AvailableFeature.ACCESS_CONTROL)
- else RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT
- )
-
- @cached_property
- def can_restrict(self) -> bool:
- # Sync conditions with frontend hasInherentRestrictionsRights
- from posthog.models.organization import OrganizationMembership
-
- # The owner (aka creator) has full permissions
- if self.p.user.pk == self.dashboard.created_by_id:
- return True
- effective_project_membership_level = self.p.current_team.effective_membership_level
- return (
- effective_project_membership_level is not None
- and effective_project_membership_level >= OrganizationMembership.Level.ADMIN
- )
-
- @cached_property
- def effective_privilege_level(self) -> PrivilegeLevel:
- if (
- # Checks can be skipped if the dashboard in on the lowest restriction level
- self.effective_restriction_level == RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT
- # Users with restriction rights can do anything
- or self.can_restrict
- ):
- # Returning the highest access level if no checks needed
- return PrivilegeLevel.CAN_EDIT
-
- # We return lowest access level if there's no explicit privilege for this user
- return self.p.dashboard_privileges.get(self.dashboard.pk, PrivilegeLevel.CAN_VIEW)
-
- @cached_property
- def can_edit(self) -> bool:
- if self.effective_restriction_level < RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT:
- return True
- return self.effective_privilege_level >= PrivilegeLevel.CAN_EDIT
-
-
-class UserInsightPermissions:
- def __init__(self, user_permissions: "UserPermissions", insight: Insight):
- self.p = user_permissions
- self.insight = insight
-
- @cached_property
- def effective_restriction_level(self) -> RestrictionLevel:
- if len(self.insight_dashboards) == 0:
- return RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT
-
- return max(self.p.dashboard(dashboard).effective_restriction_level for dashboard in self.insight_dashboards)
-
- @cached_property
- def effective_privilege_level(self) -> PrivilegeLevel:
- if len(self.insight_dashboards) == 0:
- return PrivilegeLevel.CAN_EDIT
-
- if any(self.p.dashboard(dashboard).can_edit for dashboard in self.insight_dashboards):
- return PrivilegeLevel.CAN_EDIT
- else:
- return PrivilegeLevel.CAN_VIEW
-
- @cached_property
- def insight_dashboards(self):
- # If we're in dashboard(s) and have sped up lookups
- if self.p.preloaded_insight_dashboards is not None:
- return self.p.preloaded_insight_dashboards
-
- dashboard_ids = set(
- DashboardTile.objects.filter(insight=self.insight.pk).values_list("dashboard_id", flat=True)
- )
- # nosemgrep: idor-lookup-without-team (IDs from internal FK query)
- return list(Dashboard.objects.filter(pk__in=dashboard_ids))
-
-
class UserPermissionsSerializerMixin:
"""
Mixin for getting easy access to UserPermissions within a mixin
diff --git a/products/access_control/backend/facade/user_access_control.py b/products/access_control/backend/facade/user_access_control.py
index 09186d76e659..e1db0e92be64 100644
--- a/products/access_control/backend/facade/user_access_control.py
+++ b/products/access_control/backend/facade/user_access_control.py
@@ -54,6 +54,7 @@ AccessControlLevelResource = Literal[AccessControlLevelNone, "viewer", "editor",
AccessControlLevel = Literal[AccessControlLevelMember, AccessControlLevelResource]
NO_ACCESS_LEVEL = "none"
+DASHBOARD_EDIT_LIMIT_RESOURCE = "dashboard_edit_limit"
ACCESS_CONTROL_LEVELS_MEMBER: tuple[AccessControlLevelMember, ...] = get_args(AccessControlLevelMember)
ACCESS_CONTROL_LEVELS_RESOURCE: tuple[AccessControlLevelResource, ...] = get_args(AccessControlLevelResource)
@@ -467,6 +468,8 @@ class UserAccessControl:
# Pop from __dict__ rather than hasattr/delattr
# hasattr on an un-computed cached_property would re-populate the value we're clearing
self.__dict__.pop("_cached_access_controls", None)
+ self.__dict__.pop("_dashboard_edit_limits", None)
+ self.__dict__.pop("_is_project_admin", None)
self.__dict__.pop("blocked_resource_ids_by_scope", None)
self.__dict__.pop("allowlisted_resource_ids_by_scope", None)
self.__dict__.pop("blocked_resources", None)
@@ -862,6 +865,54 @@ class UserAccessControl:
# If there are access controls we pick the highest level the user has
return self._highest_access_from_rows(resource, access_controls).access_level
+ @cached_property
+ def _dashboard_edit_limits(self) -> dict[str, dict[str, str]]:
+ limits: dict[str, dict[str, str]] = defaultdict(dict)
+ for row in self._cached_access_controls:
+ if row.resource == DASHBOARD_EDIT_LIMIT_RESOURCE and row.resource_id is not None:
+ subject = (
+ "member"
+ if row.organization_member_id is not None
+ else "role"
+ if row.role_id is not None
+ else "default"
+ )
+ limits[row.resource_id][subject] = row.access_level
+ return limits
+
+ @cached_property
+ def _is_project_admin(self) -> bool:
+ return self._team is not None and self.get_user_access_level(self._team) == "admin"
+
+ def has_object_access_limit(self, resource: APIScopeObject, resource_id: str) -> bool:
+ if resource != "dashboard" or self.is_organization_admin or not self.access_controls_supported:
+ return False
+ limits = self._dashboard_edit_limits.get(resource_id)
+ return limits is not None and limits.get("default") != "editor"
+
+ def _apply_dashboard_edit_limit(
+ self, target: _ObjectAccessTarget, access: Optional[ResolvedAccess]
+ ) -> Optional[ResolvedAccess]:
+ if (
+ target.resource != "dashboard"
+ or access is None
+ or access.access_level in ("none", "viewer")
+ or self._is_creator_id(target.created_by_id)
+ or not self.has_object_access_limit(target.resource, target.object_id)
+ or self._is_project_admin
+ ):
+ return access
+ limits = self._dashboard_edit_limits[target.object_id]
+ if limits.get("member") == "editor" or limits.get("role") == "editor":
+ return access
+ return ResolvedAccess(
+ access_level="viewer",
+ source="object",
+ source_subject="default",
+ source_resource="dashboard",
+ source_resource_id=target.object_id,
+ )
+
def check_access_level_for_object(self, obj: Model, required_level: AccessControlLevel, explicit=False) -> bool:
"""
Entry point for all permissions around a specific object.
@@ -1719,22 +1770,22 @@ class UserAccessControl:
fallback_parent_id=None,
)
- def _access_level_for_target(
+ def _resolved_access_for_target(
self, target: _ObjectAccessTarget, explicit: bool = False
- ) -> Optional[AccessControlLevel]:
+ ) -> Optional[ResolvedAccess]:
"""The enforced object resolution. Model instances and references both end here, so the
two entry points cannot drift."""
if self._is_most_specific_access_control_enabled:
resolved_access = self._most_specific_access_for_target(target)
if resolved_access is None or (explicit and resolved_access.source == "system_default"):
return None
- return resolved_access.access_level
+ return resolved_access
resolved, access = self._object_access_level_precheck(
target.resource, self._is_creator_id(target.created_by_id), explicit=explicit
)
if resolved:
- return access.access_level if access else None
+ return access
object_access_controls = self._get_access_controls(
self._access_controls_filters_for_object(target.resource, target.object_id)
@@ -1751,9 +1802,19 @@ class UserAccessControl:
self._report_resolved_access_divergence(
"object", target.resource, access, lambda: self._most_specific_access_for_target(target)
)
+ return access
+
+ def _access_level_for_target(
+ self, target: _ObjectAccessTarget, explicit: bool = False
+ ) -> Optional[AccessControlLevel]:
+ access = self._apply_dashboard_edit_limit(target, self._resolved_access_for_target(target, explicit=explicit))
return access.access_level if access else None
def get_user_access_level(self, obj: Model, explicit=False) -> Optional[AccessControlLevel]:
+ if self._team is not None and model_to_resource(obj) == "dashboard":
+ team_id = getattr(obj, "team_id", None)
+ if isinstance(team_id, int) and team_id != self._team.id:
+ return self.for_team_ids([team_id])[team_id].get_user_access_level(obj, explicit=explicit)
target = self._target_for_object(obj)
if target is None:
return None
@@ -1777,21 +1838,7 @@ class UserAccessControl:
if target is None:
return None
- if self._is_most_specific_access_control_enabled:
- return self._most_specific_access_for_target(target)
-
- resolved, access = self._object_access_level_precheck(
- target.resource, self._is_creator_id(target.created_by_id)
- )
- if resolved:
- return access
-
- object_access_controls = self._get_access_controls(
- self._access_controls_filters_for_object(target.resource, target.object_id)
- )
- return self._object_access_level_from_rows(
- target.resource, object_access_controls, fallback_parent_id=target.fallback_parent_id
- )
+ return self._apply_dashboard_edit_limit(target, self._resolved_access_for_target(target))
def bulk_object_access_levels(
self,
@@ -1832,6 +1879,12 @@ class UserAccessControl:
access = self._most_specific_object_access_from_rows(resource, object_rows)
else:
access = self._object_access_level_from_rows(resource, object_rows)
+ access = self._apply_dashboard_edit_limit(
+ _ObjectAccessTarget(
+ resource=resource, object_id=object_id, created_by_id=created_by_id, fallback_parent_id=None
+ ),
+ access,
+ )
results[object_id] = access.access_level if access else None
return results
@@ -1876,7 +1929,7 @@ class UserAccessControl:
target = self._target_for_object(obj)
if target is None:
return None
- return self._most_specific_access_for_target(target)
+ return self._apply_dashboard_edit_limit(target, self._most_specific_access_for_target(target))
def _most_specific_access_for_target(self, target: _ObjectAccessTarget) -> Optional[ResolvedAccess]:
resolved, access = self._object_access_level_precheck(
diff --git a/products/access_control/backend/presentation/access_control.py b/products/access_control/backend/presentation/access_control.py
index 1ed504cf31f5..d561412b591f 100644
--- a/products/access_control/backend/presentation/access_control.py
+++ b/products/access_control/backend/presentation/access_control.py
@@ -2,6 +2,7 @@ from collections.abc import Callable
from dataclasses import asdict
from typing import TYPE_CHECKING, Any, Optional, cast
+from django.db import transaction
from django.db.models import Model
from rest_framework import exceptions, serializers, status
@@ -32,6 +33,7 @@ from products.access_control.backend.facade.subject_access_control import Subjec
from products.access_control.backend.facade.user_access_control import (
ACCESS_CONTROL_LEVELS_RESOURCE,
ACCESS_CONTROL_MAX_OBJECTS_PER_RESOURCE,
+ DASHBOARD_EDIT_LIMIT_RESOURCE,
AccessSource,
ResolvedAccess,
UserAccessControl,
@@ -286,30 +288,54 @@ def apply_access_control_rule(
if not access_control_api.can_write_access_rules(team_id=team.id, user_id=user.id):
raise exceptions.PermissionDenied(TERRAFORM_MANAGED_MESSAGE)
- instance = AccessControl.objects.filter(
- team=team,
- resource=params["resource"],
- resource_id=params.get("resource_id"),
- organization_member=params.get("organization_member"),
- role=params.get("role"),
- ).first()
-
- if params["access_level"] is None:
- if instance is None:
- return None
- instance.delete()
- # Drop the preloaded access-control snapshot so later reads this request are fresh.
- user_access_control._clear_cache()
- return None
+ with transaction.atomic():
+ instance = AccessControl.objects.filter(
+ team=team,
+ resource=params["resource"],
+ resource_id=params.get("resource_id"),
+ organization_member=params.get("organization_member"),
+ role=params.get("role"),
+ ).first()
+
+ if params["access_level"] is None:
+ if instance is not None:
+ instance.delete()
+ rule = None
+ else:
+ if instance:
+ serializer = build_serializer(instance)
+ serializer.is_valid(raise_exception=True)
+ serializer.validated_data["team"] = team
+ rule = serializer.save()
+
+ if params["resource"] == "dashboard" and params.get("resource_id") is not None:
+ limits = AccessControl.objects.filter(
+ team=team, resource=DASHBOARD_EDIT_LIMIT_RESOURCE, resource_id=params["resource_id"]
+ )
+ if params.get("organization_member") is None and params.get("role") is None:
+ limits_deleted, _ = limits.delete()
+ if limits_deleted:
+ # Keep migration retries from restoring a limit the admin explicitly removed.
+ AccessControl.objects.create(
+ team=team,
+ resource=DASHBOARD_EDIT_LIMIT_RESOURCE,
+ resource_id=params["resource_id"],
+ access_level="editor",
+ )
+ elif limits.filter(organization_member__isnull=True, role__isnull=True, access_level="viewer").exists():
+ limits.filter(organization_member=params.get("organization_member"), role=params.get("role")).delete()
+ if params["access_level"] in ("editor", "manager"):
+ AccessControl.objects.create(
+ team=team,
+ resource=DASHBOARD_EDIT_LIMIT_RESOURCE,
+ resource_id=params["resource_id"],
+ organization_member=params.get("organization_member"),
+ role=params.get("role"),
+ access_level="editor",
+ )
- if instance:
- serializer = build_serializer(instance)
- serializer.is_valid(raise_exception=True)
- serializer.validated_data["team"] = team
- rule = serializer.save()
# Drop the preloaded access-control snapshot so later reads this request are fresh.
user_access_control._clear_cache()
-
return rule
diff --git a/products/access_control/backend/tests/test_access_control.py b/products/access_control/backend/tests/test_access_control.py
index 262ea3e6d7fb..562adbb3dccd 100644
--- a/products/access_control/backend/tests/test_access_control.py
+++ b/products/access_control/backend/tests/test_access_control.py
@@ -16,6 +16,7 @@ from posthog.constants import AvailableFeature
from posthog.models import PropertyDefinition
from posthog.models.organization import Organization, OrganizationMembership
from posthog.models.personal_api_key import PersonalAPIKey
+from posthog.models.tagged_item_registry import content_type_for
from posthog.models.team.team import Team
from posthog.models.user import User
from posthog.models.utils import generate_random_token_personal, hash_key_value
@@ -1227,6 +1228,7 @@ class TestAccessControlQueryCounts(BaseAccessControlTest):
self.notebook = Notebook.objects.create(team=self.team, created_by=self.user, title="my notebook")
# Baseline call to trigger caching of one off things like instance settings
+ content_type_for(Dashboard)
self.client.get(f"/api/projects/@current/notebooks/{self.notebook.short_id}")
# Tag lookups read content types through a process-wide cache. Fill it here so the counts
# do not depend on which tests ran before in the same worker.
@@ -1334,6 +1336,7 @@ class TestAccessControlQueryCounts(BaseAccessControlTest):
self.client.get("/api/projects/@current/notebooks/")
def test_query_counts_stable_when_listing_resources_including_access_control_info(self):
+ content_type_for(FeatureFlag)
for i in range(10):
FeatureFlag.objects.create(team=self.team, created_by=self.other_user, key=f"flag-{i}")
diff --git a/products/access_control/backend/tests/test_user_access_control.py b/products/access_control/backend/tests/test_user_access_control.py
index 1706709005e7..19b65383c977 100644
--- a/products/access_control/backend/tests/test_user_access_control.py
+++ b/products/access_control/backend/tests/test_user_access_control.py
@@ -1302,6 +1302,10 @@ class TestUserAccessControlSpecificAccessLevelForObject(BaseUserAccessControlTes
access_level = self.user_access_control.specific_access_level_for_object(feature_flag)
assert access_level == "viewer"
+ deferred_flag = FeatureFlag.objects.only("id", "created_by").get(id=feature_flag.id)
+ with self.assertNumQueries(0):
+ assert self.user_access_control.get_user_access_level(deferred_flag) == "viewer"
+ assert "team_id" in deferred_flag.get_deferred_fields()
def test_notebook_specific_access_control(self):
"""Test notebook-specific access controls"""
diff --git a/products/annotations/backend/api/test/__snapshots__/test_annotation.ambr b/products/annotations/backend/api/test/__snapshots__/test_annotation.ambr
index f1ab78889272..06a5f0d2fd08 100644
--- a/products/annotations/backend/api/test/__snapshots__/test_annotation.ambr
+++ b/products/annotations/backend/api/test/__snapshots__/test_annotation.ambr
@@ -457,7 +457,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -1120,7 +1119,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -1660,7 +1658,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
diff --git a/products/dashboards/backend/api/dashboard.py b/products/dashboards/backend/api/dashboard.py
index 24a24bcf03fc..aed9900accf2 100644
--- a/products/dashboards/backend/api/dashboard.py
+++ b/products/dashboards/backend/api/dashboard.py
@@ -143,7 +143,6 @@ from products.dashboards.backend.constants import (
RUN_INSIGHTS_MIN_TILE_CHARS,
)
from products.dashboards.backend.facade.api import DashboardTileBasicSerializer, tile_ids_prefetch
-from products.dashboards.backend.facade.enums import PrivilegeLevel, RestrictionLevel
from products.dashboards.backend.feature_flags import dashboard_widgets_enabled
from products.dashboards.backend.models.dashboard import (
DASHBOARD_GRID_COMPACTION_MODES,
@@ -314,11 +313,7 @@ DASHBOARD_SHARED_FIELDS = [
"breakdown_colors",
"data_color_theme_id",
"tags",
- "restriction_level",
- "effective_restriction_level",
- "effective_privilege_level",
"user_access_level",
- "access_control_version",
"last_refresh",
"persisted_filters",
"persisted_variables",
@@ -948,7 +943,7 @@ class CanEditDashboard(BasePermission):
def has_object_permission(self, request: Request, view, dashboard) -> bool:
if request.method in SAFE_METHODS:
return True
- return view.user_permissions.dashboard(dashboard).can_edit
+ return bool(view.user_access_control.check_access_level_for_object(dashboard, "editor"))
def _hide_extra_details(context: dict[str, Any], representation: dict[str, Any]) -> None:
@@ -1255,9 +1250,6 @@ class DashboardBasicSerializer(
UserAccessControlSerializerMixin,
):
created_by = UserBasicSerializer(read_only=True)
- effective_privilege_level = serializers.SerializerMethodField()
- effective_restriction_level = serializers.SerializerMethodField()
- access_control_version = serializers.SerializerMethodField()
is_shared = serializers.BooleanField(source="is_sharing_enabled", read_only=True, required=False)
last_viewed_at = serializers.DateTimeField(read_only=True, required=False, allow_null=True)
folder = serializers.SerializerMethodField(
@@ -1300,11 +1292,7 @@ class DashboardBasicSerializer(
"deleted",
"creation_mode",
"tags",
- "restriction_level",
- "effective_restriction_level",
- "effective_privilege_level",
"user_access_level",
- "access_control_version",
"last_refresh",
"team_id",
"search_match_type",
@@ -1314,32 +1302,8 @@ class DashboardBasicSerializer(
"name": {"help_text": "Name of the dashboard."},
"description": {"help_text": "Description of the dashboard."},
"pinned": {"help_text": "Whether the dashboard is pinned to the top of the list."},
- "restriction_level": {
- "help_text": (
- "Only restriction level 21 is accepted on create and update. "
- "Legacy value 37 is deprecated and rejected."
- )
- },
}
- @extend_schema_field(serializers.ChoiceField(choices=RestrictionLevel.choices))
- def get_effective_restriction_level(self, dashboard: Dashboard) -> RestrictionLevel:
- if self.context.get("is_shared"):
- return RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT
- return self.user_permissions.dashboard(dashboard).effective_restriction_level
-
- @extend_schema_field(serializers.ChoiceField(choices=PrivilegeLevel.choices))
- def get_effective_privilege_level(self, dashboard: Dashboard) -> PrivilegeLevel:
- if self.context.get("is_shared"):
- return PrivilegeLevel.CAN_VIEW
- return self.user_permissions.dashboard(dashboard).effective_privilege_level
-
- def get_access_control_version(self, dashboard: Dashboard) -> str:
- # This effectively means that the dashboard they are using the old dashboard permissions
- if dashboard.restriction_level > RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT:
- return "v1"
- return "v2"
-
@extend_schema_field(serializers.CharField(allow_null=True))
def get_folder(self, dashboard: Dashboard) -> str | None:
# Don't expose the project-tree location to anonymous viewers of a publicly shared dashboard,
@@ -1415,16 +1379,6 @@ class DashboardMetadataSerializer(DashboardBasicSerializer):
filters = serializers.SerializerMethodField()
variables = serializers.SerializerMethodField()
created_by = UserBasicSerializer(read_only=True)
- effective_privilege_level = serializers.SerializerMethodField()
- effective_restriction_level = serializers.SerializerMethodField()
- access_control_version = serializers.SerializerMethodField()
- restriction_level = serializers.ChoiceField(
- choices=RestrictionLevel.choices,
- required=False,
- help_text=(
- "Only restriction level 21 is accepted on create and update. Legacy value 37 is deprecated and rejected."
- ),
- )
is_shared = serializers.BooleanField(source="is_sharing_enabled", read_only=True, required=False)
breakdown_colors = BreakdownColorsField(
child=BreakdownColorConfigSerializer(),
@@ -1475,19 +1429,11 @@ class DashboardMetadataSerializer(DashboardBasicSerializer):
fields = DASHBOARD_SHARED_FIELDS
read_only_fields = [
"creation_mode",
- "effective_restriction_level",
"is_shared",
"user_access_level",
"last_accessed_at",
]
- def validate_restriction_level(self, value: int) -> int:
- if value == RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT:
- raise serializers.ValidationError(
- "Collaborator-only dashboard access is no longer supported. Set the restriction level to 21."
- )
- return value
-
def validate_group_titles(self, value: dict[str, str] | None) -> dict[str, str] | None:
if value is None:
return None
@@ -1828,7 +1774,6 @@ class DashboardSerializer(DashboardMetadataSerializer):
]
read_only_fields = [
"creation_mode",
- "effective_restriction_level",
"is_shared",
"user_access_level",
"last_accessed_at",
@@ -2150,11 +2095,6 @@ class DashboardSerializer(DashboardMetadataSerializer):
@monitor(feature=Feature.DASHBOARD, endpoint="dashboard", method="PATCH")
def update(self, instance: Dashboard, validated_data: dict, *args: Any, **kwargs: Any) -> Dashboard:
previous_layout_compaction = _effective_layout_compaction(instance.customization)
- can_user_restrict = self.user_permissions.dashboard(instance).can_restrict
- if "restriction_level" in validated_data and not can_user_restrict:
- raise exceptions.PermissionDenied(
- "Only the dashboard owner and project admins have the restriction rights required to change the dashboard's restriction level."
- )
self._check_delivered_dashboard_filters_access(
cast(User, self.context["request"].user), instance, self.initial_data
)
@@ -2294,7 +2234,6 @@ class DashboardSerializer(DashboardMetadataSerializer):
request=self.context["request"],
)
- self.user_permissions.reset_insights_dashboard_cached_results()
# A rename re-paths the entry in a post-save signal, so the annotation bound before the save now
# points at the old path. Dropping it sends `filed_entry` back to the file system for the new one.
instance.__dict__.pop("_folder_id", None)
@@ -2829,7 +2768,6 @@ class DashboardSerializer(DashboardMetadataSerializer):
serialized_tiles: list[ReturnDict] = []
tiles = DashboardTile.dashboard_queryset(dashboard.tiles.all()).prefetch_related(*tile_insight_prefetches())
- self.user_permissions.set_preloaded_dashboard_tiles(list(tiles))
team = self.context["get_team"]()
chained_tile_refresh_enabled = posthoganalytics.feature_enabled(
@@ -2885,18 +2823,6 @@ class DashboardSerializer(DashboardMetadataSerializer):
return {**validated_data, "creation_mode": "default"}
-class DashboardWriteOpenApiSerializer(DashboardSerializer):
- # Existing dashboards may return 37, but write requests must not accept it.
- restriction_level = serializers.IntegerField( # type: ignore[assignment]
- min_value=RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT.value,
- max_value=RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT.value,
- required=False,
- help_text=(
- "Only restriction level 21 is accepted on create and update. Legacy value 37 is deprecated and rejected."
- ),
- )
-
-
class DashboardSubscribeNudgeResponseSerializer(serializers.Serializer):
created = serializers.BooleanField(
help_text="Whether a nudge notification was created. False when one was already sent recently "
@@ -2962,15 +2888,9 @@ class DashboardSubscribeNudgeResponseSerializer(serializers.Serializer):
),
# Dashboards nest insight payloads via `tiles[].insight`, so the deprecated-`dashboards`-field
# opt-in applies here too — on every action whose response uses DashboardSerializer.
- create=extend_schema(
- request=DashboardWriteOpenApiSerializer,
- parameters=[INCLUDE_DASHBOARDS_PARAMETER],
- ),
+ create=extend_schema(parameters=[INCLUDE_DASHBOARDS_PARAMETER]),
retrieve=extend_schema(parameters=[INCLUDE_DASHBOARDS_PARAMETER]),
- update=extend_schema(
- request=DashboardWriteOpenApiSerializer,
- parameters=[INCLUDE_DASHBOARDS_PARAMETER],
- ),
+ update=extend_schema(parameters=[INCLUDE_DASHBOARDS_PARAMETER]),
partial_update=extend_schema(request=PatchedDashboardOpenApiSerializer, parameters=[INCLUDE_DASHBOARDS_PARAMETER]),
)
class DashboardsViewSet(
@@ -3414,8 +3334,6 @@ class DashboardsViewSet(
)
to_dashboard_obj = get_object_or_404(Dashboard, id=to_dashboard, team__project_id=self.team.project_id)
self.check_object_permissions(request, to_dashboard_obj)
- if not self.user_permissions.dashboard(to_dashboard_obj).can_edit:
- raise exceptions.PermissionDenied("You don't have edit permissions for the destination dashboard.")
if tile.widget_id is not None:
request_user = cast(User, request.user)
if not dashboard_widgets_enabled(team=self.team, user=request_user):
@@ -3582,8 +3500,6 @@ class DashboardsViewSet(
dashboard = self.get_object()
if dashboard.deleted:
raise exceptions.NotFound()
- if not self.user_permissions.dashboard(dashboard).can_edit:
- raise exceptions.PermissionDenied("You don't have edit permissions for this dashboard.")
serializer = CreateTextTileRequestSerializer(data=request.data)
serializer.is_valid(raise_exception=True)
@@ -3620,8 +3536,6 @@ class DashboardsViewSet(
dashboard = self.get_object()
if dashboard.deleted:
raise exceptions.NotFound()
- if not self.user_permissions.dashboard(dashboard).can_edit:
- raise exceptions.PermissionDenied("You don't have edit permissions for this dashboard.")
serializer = UpdateTextTileRequestSerializer(data=request.data)
serializer.is_valid(raise_exception=True)
@@ -3679,8 +3593,6 @@ class DashboardsViewSet(
dashboard = self.get_object()
if dashboard.deleted:
raise exceptions.NotFound()
- if not self.user_permissions.dashboard(dashboard).can_edit:
- raise exceptions.PermissionDenied("You don't have edit permissions for this dashboard.")
serializer = DeleteTileRequestSerializer(data=request.data)
serializer.is_valid(raise_exception=True)
@@ -3791,7 +3703,6 @@ class DashboardsViewSet(
to_attr="prefetched_tags",
),
)
- self.user_permissions.set_preloaded_dashboard_tiles(list(tiles))
# Order over every tile first, so a tile_ids subset keeps the dashboard's own ordering.
ordered_tiles = list(enumerate(DashboardTile.sort_tiles_by_layout(tiles, "sm")))
@@ -4074,8 +3985,6 @@ class DashboardsViewSet(
dashboard = self.get_object()
if dashboard.deleted:
raise exceptions.NotFound()
- if not self.user_permissions.dashboard(dashboard).can_edit:
- raise exceptions.PermissionDenied("You don't have edit permissions for this dashboard.")
serializer = UpdateDashboardWidgetsBatchRequestSerializer(data=request.data)
serializer.is_valid(raise_exception=True)
diff --git a/products/dashboards/backend/api/test/test_dashboard_filters_validation.py b/products/dashboards/backend/api/test/test_dashboard_filters_validation.py
index a47da348fccc..f653f00d62b8 100644
--- a/products/dashboards/backend/api/test/test_dashboard_filters_validation.py
+++ b/products/dashboards/backend/api/test/test_dashboard_filters_validation.py
@@ -4,18 +4,6 @@ from parameterized import parameterized
from rest_framework import serializers
from products.dashboards.backend.api.dashboard import DashboardSerializer
-from products.dashboards.backend.models.dashboard import Dashboard
-
-
-class TestDashboardRestrictionLevelValidation(SimpleTestCase):
- @parameterized.expand([("create", False), ("update", True)])
- def test_rejects_legacy_collaborator_level(self, _name: str, partial: bool) -> None:
- serializer = DashboardSerializer(
- data={"restriction_level": Dashboard.RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT}, partial=partial
- )
-
- assert not serializer.is_valid()
- assert "restriction_level" in serializer.errors
class TestDashboardFiltersValidation(SimpleTestCase):
diff --git a/products/dashboards/backend/api/test/test_dashboard_openapi.py b/products/dashboards/backend/api/test/test_dashboard_openapi.py
index 4e3d2128cbf7..01d8432c6b6a 100644
--- a/products/dashboards/backend/api/test/test_dashboard_openapi.py
+++ b/products/dashboards/backend/api/test/test_dashboard_openapi.py
@@ -1,11 +1,9 @@
from drf_spectacular.generators import SchemaGenerator
from rest_framework import serializers
-from products.dashboards.backend.api.dashboard import DashboardWriteOpenApiSerializer
from products.dashboards.backend.api.test.dashboard_openapi_test_helpers import (
dashboard_patch_runtime_openapi_field_names,
)
-from products.dashboards.backend.facade.enums import RestrictionLevel
from products.dashboards.backend.widget_specs.openapi import PatchedDashboardOpenApiSerializer
@@ -21,13 +19,6 @@ def _patched_dashboard_openapi_component_properties(schema: dict) -> frozenset[s
class TestDashboardPatchOpenApiContract:
- def test_write_schemas_exclude_legacy_collaborator_level(self) -> None:
- supported_level = RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT.value
- for serializer in (DashboardWriteOpenApiSerializer(), PatchedDashboardOpenApiSerializer()):
- field = serializer.fields["restriction_level"]
- assert isinstance(field, serializers.IntegerField)
- assert field.min_value == field.max_value == supported_level
-
def test_patched_dashboard_openapi_covers_runtime_patch_fields(self) -> None:
runtime_fields = dashboard_patch_runtime_openapi_field_names()
openapi_fields = frozenset(PatchedDashboardOpenApiSerializer().fields.keys())
diff --git a/products/dashboards/backend/api/test/test_dashboard_widgets.py b/products/dashboards/backend/api/test/test_dashboard_widgets.py
index 63a962d77671..d68e9374bb13 100644
--- a/products/dashboards/backend/api/test/test_dashboard_widgets.py
+++ b/products/dashboards/backend/api/test/test_dashboard_widgets.py
@@ -2,7 +2,7 @@ from typing import Any
import time_machine
from posthog.test.base import APIBaseTest
-from unittest.mock import ANY, MagicMock, PropertyMock, patch
+from unittest.mock import ANY, MagicMock, patch
from django.db import connection
from django.test import override_settings
@@ -1474,11 +1474,7 @@ class TestDashboardWidgetsBatchUpdate(APIBaseTest):
_, dashboard_json = self.dashboard_api.create_widget_tile(dashboard_id, config={"limit": 5})
tile = dashboard_json["tiles"][0]
- with patch(
- "posthog.user_permissions.UserDashboardPermissions.can_edit",
- new_callable=PropertyMock,
- return_value=False,
- ):
+ with patch.object(UserAccessControl, "check_access_level_for_object", return_value=False):
response = self._batch_update(dashboard_id, [{"tile_id": tile["id"], "config": {"limit": 9}}])
assert response.status_code == status.HTTP_403_FORBIDDEN
diff --git a/products/dashboards/backend/facade/api.py b/products/dashboards/backend/facade/api.py
index f4d08719e6dd..230df7a7280b 100644
--- a/products/dashboards/backend/facade/api.py
+++ b/products/dashboards/backend/facade/api.py
@@ -25,10 +25,8 @@ from posthog.api.sharing_publish_gate import check_can_add_insight_to_shared_das
from posthog.helpers.dashboard_templates import create_from_template
from posthog.models.user import User
from posthog.models.user_home_settings import UserHomeSettings
-from posthog.user_permissions import UserPermissions
from products.access_control.backend.facade.user_access_control import UserAccessControl
-from products.dashboards.backend.facade.enums import PrivilegeLevel
from products.dashboards.backend.models.dashboard import Dashboard
from products.dashboards.backend.models.dashboard_templates import DashboardTemplate
from products.dashboards.backend.models.dashboard_tile import DashboardTile
@@ -256,21 +254,72 @@ def hide_tiles_for_insights(insight_ids: Collection[int]) -> None:
DashboardTile.objects_including_soft_deleted.filter(insight_id__in=insight_ids).update(deleted=True)
-def restore_tiles_for_insights(insight_ids: Collection[int], *, user_permissions: UserPermissions) -> None:
+def _dashboard_edit_access_by_team(
+ dashboards: Collection[Dashboard], user_access_control: UserAccessControl | None
+) -> dict[int, UserAccessControl]:
+ """Resolve dashboard edit access against each dashboard's own team.
+
+ A tile's dashboard can belong to a sibling environment's team in the same project, and the
+ request-scoped UserAccessControl is bound to the requesting team. Resolving a sibling's
+ dashboard through it reads the wrong team's rules and can skip a dashboard the requester may
+ edit. `for_team_ids` returns one instance per dashboard team with the same user and
+ organization, so project scope is preserved.
+ """
+ if user_access_control is None:
+ return {}
+ return user_access_control.for_team_ids({dashboard.team_id for dashboard in dashboards})
+
+
+def insights_with_dashboard_edit_access(
+ insight_ids: Collection[int], *, user_access_control: UserAccessControl, project_id: int
+) -> set[int]:
+ tiles = list(
+ DashboardTile.objects_including_soft_deleted.filter(
+ insight_id__in=insight_ids, dashboard__team__project_id=project_id, dashboard__deleted=False
+ ).select_related("dashboard")
+ )
+ access_by_team = _dashboard_edit_access_by_team([tile.dashboard for tile in tiles], user_access_control)
+ editable: set[int] = set()
+ linked: set[int] = set()
+ limited_dashboards: dict[int, bool] = {}
+ editable_dashboards: dict[int, bool] = {}
+ for tile in tiles:
+ if tile.insight_id is None:
+ continue
+ access = access_by_team[tile.dashboard.team_id]
+ if tile.dashboard_id not in limited_dashboards:
+ limited_dashboards[tile.dashboard_id] = access.has_object_access_limit("dashboard", str(tile.dashboard_id))
+ limited = limited_dashboards[tile.dashboard_id]
+ # Hidden restricted tiles retain their policy; removed unrestricted tiles cannot grant access.
+ if tile.deleted and not limited:
+ continue
+ linked.add(tile.insight_id)
+ if tile.dashboard_id not in editable_dashboards:
+ editable_dashboards[tile.dashboard_id] = not limited or access.check_access_level_for_object(
+ tile.dashboard, "editor"
+ )
+ if editable_dashboards[tile.dashboard_id]:
+ editable.add(tile.insight_id)
+ return editable | (set(insight_ids) - linked)
+
+
+def restore_tiles_for_insights(insight_ids: Collection[int], *, user_access_control: UserAccessControl) -> None:
"""Re-activate soft-deleted tiles of these insights, on live dashboards the requester may edit.
Run inside the caller's transaction: it is one half of restoring the insights themselves.
- Mirrors the per-dashboard CAN_EDIT check membership updates apply, so a restore can't force an
- insight back onto a dashboard the requester can only view. Tiles removed before the delete may
- also reappear; acceptable for the immediate-undo case this backs.
+ Tiles removed before the delete may also reappear; acceptable for the immediate-undo case
+ this backs.
"""
- candidate_tiles = DashboardTile.objects_including_soft_deleted.filter(
- insight_id__in=insight_ids, deleted=True, dashboard__deleted=False
- ).select_related("dashboard")
+ candidate_tiles = list(
+ DashboardTile.objects_including_soft_deleted.filter(
+ insight_id__in=insight_ids, deleted=True, dashboard__deleted=False
+ ).select_related("dashboard")
+ )
+ access_by_team = _dashboard_edit_access_by_team([tile.dashboard for tile in candidate_tiles], user_access_control)
restorable_tile_ids = [
tile.id
for tile in candidate_tiles
- if user_permissions.dashboard(tile.dashboard).effective_privilege_level == PrivilegeLevel.CAN_EDIT
+ if access_by_team[tile.dashboard.team_id].check_access_level_for_object(tile.dashboard, "editor")
]
if restorable_tile_ids:
DashboardTile.objects_including_soft_deleted.filter(id__in=restorable_tile_ids).update(deleted=False)
@@ -306,7 +355,6 @@ def plan_insight_tile_placement(
team_id: int,
query: Any,
user: User,
- user_permissions: UserPermissions,
user_access_control: UserAccessControl | None,
) -> InsightTilePlacement:
"""Check that an insight carrying `query` may be placed on these dashboards.
@@ -318,13 +366,15 @@ def plan_insight_tile_placement(
# nosemgrep: idor-lookup-without-team (team check below)
found = {dashboard.id: dashboard for dashboard in Dashboard.objects.filter(id__in=dashboard_ids)}
dashboards = [found[dashboard_id] for dashboard_id in dict.fromkeys(dashboard_ids) if dashboard_id in found]
+ access_by_team = _dashboard_edit_access_by_team(dashboards, user_access_control)
for dashboard in dashboards:
- # Adding a tile is an edit of the dashboard, so a restricted dashboard the requester
- # can't edit must not be writable here either.
- if user_permissions.dashboard(dashboard).effective_privilege_level != PrivilegeLevel.CAN_EDIT:
- raise CannotAddToDashboard(dashboard.id)
if dashboard.team_id != team_id:
raise DashboardNotFound
+ # Adding a tile is an edit of the dashboard.
+ if user_access_control is not None and not access_by_team[dashboard.team_id].check_access_level_for_object(
+ dashboard, "editor"
+ ):
+ raise CannotAddToDashboard(dashboard.id)
# The dashboard's public link must not expose a query the editor can't run.
check_can_add_insight_to_shared_dashboard(user, dashboard, query, user_access_control)
return InsightTilePlacement(dashboards)
@@ -336,7 +386,6 @@ def update_insight_dashboard_membership(
dashboard_ids: Sequence[int],
query: Any,
user: User,
- user_permissions: UserPermissions,
user_access_control: UserAccessControl | None,
) -> MembershipChange | None:
"""Move an insight on and off dashboards until it sits on exactly `dashboard_ids`.
@@ -366,15 +415,17 @@ def update_insight_dashboard_membership(
added_dashboard_ids: list[int] = []
# nosemgrep: idor-lookup-without-team (team check after lookup)
- for dashboard in Dashboard.objects.filter(id__in=ids_to_add):
- # Does the requester have permission to add to this dashboard? If it is restricted, the
- # patch would otherwise make the insight restricted too.
- if user_permissions.dashboard(dashboard).effective_privilege_level != PrivilegeLevel.CAN_EDIT:
- raise CannotAddToDashboard(dashboard.id)
-
+ add_dashboards = list(Dashboard.objects.filter(id__in=ids_to_add))
+ add_access_by_team = _dashboard_edit_access_by_team(add_dashboards, user_access_control)
+ for dashboard in add_dashboards:
if dashboard.team != insight.team:
raise DashboardNotFound
+ if user_access_control is not None and not add_access_by_team[dashboard.team_id].check_access_level_for_object(
+ dashboard, "editor"
+ ):
+ raise CannotAddToDashboard(dashboard.id)
+
# The dashboard's public link must not expose a query the editor can't run.
check_can_add_insight_to_shared_dashboard(user, dashboard, query, user_access_control)
@@ -388,8 +439,12 @@ def update_insight_dashboard_membership(
removed_dashboard_ids: list[int] = []
if ids_to_remove:
# nosemgrep: idor-lookup-without-team (team check after lookup)
- for dashboard in Dashboard.objects.filter(id__in=ids_to_remove):
- if user_permissions.dashboard(dashboard).effective_privilege_level != PrivilegeLevel.CAN_EDIT:
+ remove_dashboards = list(Dashboard.objects.filter(id__in=ids_to_remove))
+ remove_access_by_team = _dashboard_edit_access_by_team(remove_dashboards, user_access_control)
+ for dashboard in remove_dashboards:
+ if user_access_control is not None and not remove_access_by_team[
+ dashboard.team_id
+ ].check_access_level_for_object(dashboard, "editor"):
raise CannotRemoveFromDashboard(dashboard.id)
# Capture the still-active tiles before soft-deleting so the caller can report one
diff --git a/products/dashboards/backend/facade/enums.py b/products/dashboards/backend/facade/enums.py
index 84fa9e75e2f1..7b9f7d4d2e07 100644
--- a/products/dashboards/backend/facade/enums.py
+++ b/products/dashboards/backend/facade/enums.py
@@ -4,37 +4,13 @@ Shared enums for the dashboards product.
``DashboardAccessMethod`` labels how a dashboard render was reached. It lives in the facade
rather than in ``backend/access.py`` because the insight API tags its own cache metrics with
it, and a data type that crosses the product boundary belongs here.
-
-``RestrictionLevel`` and ``PrivilegeLevel`` are the collaboration levels the ``Dashboard`` model
-stores and every caller compares against. They are defined here for the same reason: the insight
-API reports an insight's effective levels and gates dashboard edits on ``CAN_EDIT``. The model
-keeps ``Dashboard.RestrictionLevel`` / ``Dashboard.PrivilegeLevel`` as aliases of these.
"""
from enum import StrEnum
-from posthog.enums import LabeledIntEnum
-
class DashboardAccessMethod(StrEnum):
HUMAN = "human"
SHARED = "shared"
EMBEDDED = "embedded"
API = "api"
-
-
-class RestrictionLevel(LabeledIntEnum):
- """Collaboration restriction level (which is a dashboard setting). Sync with PrivilegeLevel."""
-
- EVERYONE_IN_PROJECT_CAN_EDIT = 21, "Everyone in the project can edit"
- ONLY_COLLABORATORS_CAN_EDIT = (
- 37,
- "Only those invited to this dashboard can edit",
- )
-
-
-class PrivilegeLevel(LabeledIntEnum):
- """Collaboration privilege level (which is a user property). Sync with RestrictionLevel."""
-
- CAN_VIEW = 21, "Can view dashboard"
- CAN_EDIT = 37, "Can edit dashboard"
diff --git a/products/dashboards/backend/migrations/0027_untrack_dashboard_restriction_level.py b/products/dashboards/backend/migrations/0027_untrack_dashboard_restriction_level.py
new file mode 100644
index 000000000000..f9a25d1f1b68
--- /dev/null
+++ b/products/dashboards/backend/migrations/0027_untrack_dashboard_restriction_level.py
@@ -0,0 +1,22 @@
+from django.db import migrations, models
+
+from posthog.migration_helpers import untrack_field
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("dashboards", "0026_dashboardtile_group_key_badge"),
+ ]
+
+ operations = [
+ # New pods stop naming the column in INSERTs once it leaves model state, so the column
+ # needs a database default for the rolling deploy. Without it Postgres stores NULL, and a
+ # previous-release pod still runs `dashboard.restriction_level > EVERYONE_IN_PROJECT_CAN_EDIT`,
+ # which raises TypeError on None and cannot return the dashboard at all.
+ migrations.AlterField(
+ model_name="dashboard",
+ name="restriction_level",
+ field=models.PositiveSmallIntegerField(null=True, db_default=21),
+ ),
+ untrack_field("dashboard", "restriction_level"),
+ ]
diff --git a/products/dashboards/backend/migrations/max_migration.txt b/products/dashboards/backend/migrations/max_migration.txt
index 11d00959425f..dbf724783a1a 100644
--- a/products/dashboards/backend/migrations/max_migration.txt
+++ b/products/dashboards/backend/migrations/max_migration.txt
@@ -1 +1 @@
-0026_dashboardtile_group_key_badge
+0027_untrack_dashboard_restriction_level
diff --git a/products/dashboards/backend/models/dashboard.py b/products/dashboards/backend/models/dashboard.py
index 41849ed7c161..7978fcd28bff 100644
--- a/products/dashboards/backend/models/dashboard.py
+++ b/products/dashboards/backend/models/dashboard.py
@@ -12,8 +12,6 @@ from posthog.models.tagged_items_relation import Taggable
from posthog.models.utils import RootTeamManager, RootTeamMixin, sane_repr
from posthog.utils import absolute_uri
-from products.dashboards.backend.facade import enums
-
if TYPE_CHECKING:
from posthog.models.team import Team
@@ -57,11 +55,6 @@ class Dashboard(Taggable, FileSystemSyncMixin, ModelActivityMixin, RootTeamMixin
"Unlisted (product-embedded)",
) # Product dashboards (e.g. AI observability) - hidden from general lists, accessed via tag queries
- # Aliases of the facade enums, which is where callers outside this product read them from.
- # Kept on the model so `Dashboard.PrivilegeLevel` and the `choices=` below stay unchanged.
- RestrictionLevel = enums.RestrictionLevel
- PrivilegeLevel = enums.PrivilegeLevel
-
name = models.CharField(max_length=400, null=True, blank=True)
description = models.TextField(blank=True)
team = models.ForeignKey("posthog.Team", on_delete=models.CASCADE)
@@ -78,10 +71,6 @@ class Dashboard(Taggable, FileSystemSyncMixin, ModelActivityMixin, RootTeamMixin
"posthog.DataColorTheme", on_delete=models.SET_NULL, null=True, blank=True, related_name="+"
)
creation_mode = models.CharField(max_length=16, default="default", choices=CreationMode)
- restriction_level = models.PositiveSmallIntegerField(
- default=RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT.value,
- choices=RestrictionLevel.choices,
- )
insights = models.ManyToManyField(
"product_analytics.Insight", related_name="dashboards", through="DashboardTile", blank=True
) # type: models.ManyToManyField
diff --git a/products/dashboards/backend/widget_publication.py b/products/dashboards/backend/widget_publication.py
index 29f0c9038f7a..1abe2239722c 100644
--- a/products/dashboards/backend/widget_publication.py
+++ b/products/dashboards/backend/widget_publication.py
@@ -7,7 +7,6 @@ from rest_framework.exceptions import PermissionDenied, ValidationError
from posthog.exceptions import Conflict
from posthog.models import Team, User
-from posthog.user_permissions import UserPermissions
from products.access_control.backend.facade.user_access_control import UserAccessControl
from products.dashboards.backend.feature_flags import dashboard_widgets_enabled
@@ -47,9 +46,7 @@ class DashboardWidgetPublication:
self.dashboard = get_object_or_404(Dashboard, id=dashboard_id, team_id=team.id, deleted=False)
if not dashboard_widgets_enabled(team=team, user=user):
raise ValidationError("Dashboard widgets are not enabled for this project.")
- if not UserPermissions(user, team).dashboard(
- self.dashboard
- ).can_edit or not self.access.check_access_level_for_object(self.dashboard, "editor"):
+ if not self.access.check_access_level_for_object(self.dashboard, "editor"):
raise PermissionDenied("You don't have edit permissions for this dashboard.")
def publish(
diff --git a/products/dashboards/backend/widget_specs/openapi.py b/products/dashboards/backend/widget_specs/openapi.py
index 3b6b31a8d74c..8380ad608be8 100644
--- a/products/dashboards/backend/widget_specs/openapi.py
+++ b/products/dashboards/backend/widget_specs/openapi.py
@@ -11,7 +11,6 @@ from products.dashboards.backend.constants import (
MAX_GROUP_KEY_LENGTH,
MAX_GROUP_TITLE_LENGTH,
)
-from products.dashboards.backend.facade.enums import RestrictionLevel
from products.dashboards.backend.models.dashboard import DASHBOARD_GRID_COMPACTION_MODES, DASHBOARD_GRID_SPACING_GAPS
from products.dashboards.backend.models.dashboard_tile import DashboardTileBadge
from products.dashboards.backend.widget_specs.pydantic_openapi import pydantic_config_field, pydantic_stub_serializer
@@ -436,14 +435,6 @@ class PatchedDashboardOpenApiSerializer(serializers.Serializer):
help_text="ID of the color theme used for chart visualizations.",
)
tags = serializers.ListField(child=serializers.CharField(), required=False)
- restriction_level = serializers.IntegerField(
- min_value=RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT.value,
- max_value=RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT.value,
- required=False,
- help_text=(
- "Only restriction level 21 is accepted on create and update. Legacy value 37 is deprecated and rejected."
- ),
- )
quick_filter_ids = serializers.ListField(
child=serializers.CharField(),
required=False,
diff --git a/products/dashboards/frontend/generated/api.schemas.ts b/products/dashboards/frontend/generated/api.schemas.ts
index f7f8420a91aa..4fd666057c19 100644
--- a/products/dashboards/frontend/generated/api.schemas.ts
+++ b/products/dashboards/frontend/generated/api.schemas.ts
@@ -207,28 +207,6 @@ export const DashboardCreationModeEnumApi = {
Unlisted: 'unlisted',
} as const
-/**
- * * `21` - Everyone in the project can edit
- * * `37` - Only those invited to this dashboard can edit
- */
-export type RestrictionLevelEnumApi = (typeof RestrictionLevelEnumApi)[keyof typeof RestrictionLevelEnumApi]
-
-export const RestrictionLevelEnumApi = {
- Number21: 21,
- Number37: 37,
-} as const
-
-/**
- * * `21` - Can view dashboard
- * * `37` - Can edit dashboard
- */
-export type PrivilegeLevelEnumApi = (typeof PrivilegeLevelEnumApi)[keyof typeof PrivilegeLevelEnumApi]
-
-export const PrivilegeLevelEnumApi = {
- Number21: 21,
- Number37: 37,
-} as const
-
export type SearchMatchTypeEnumApi = (typeof SearchMatchTypeEnumApi)[keyof typeof SearchMatchTypeEnumApi]
export const SearchMatchTypeEnumApi = {
@@ -275,19 +253,11 @@ export interface DashboardBasicApi {
readonly deleted: boolean
readonly creation_mode: DashboardCreationModeEnumApi
tags?: unknown[]
- /** Only restriction level 21 is accepted on create and update. Legacy value 37 is deprecated and rejected.
- *
- * * `21` - Everyone in the project can edit
- * * `37` - Only those invited to this dashboard can edit */
- readonly restriction_level: RestrictionLevelEnumApi
- readonly effective_restriction_level: RestrictionLevelEnumApi
- readonly effective_privilege_level: PrivilegeLevelEnumApi
/**
* The effective access level the user has for this object
* @nullable
*/
readonly user_access_level: string | null
- readonly access_control_version: string
/** @nullable */
readonly last_refresh: string | null
readonly team_id: number
@@ -304,30 +274,30 @@ export interface PaginatedDashboardBasicListApi {
results: DashboardBasicApi[]
}
-export type DashboardWriteOpenApiApiFilters = { [key: string]: unknown }
+export type DashboardApiFilters = { [key: string]: unknown }
/**
* @nullable
*/
-export type DashboardWriteOpenApiApiVariables = { [key: string]: unknown } | null
+export type DashboardApiVariables = { [key: string]: unknown } | null
/**
* @nullable
*/
-export type DashboardWriteOpenApiApiPersistedFilters = { [key: string]: unknown } | null
+export type DashboardApiPersistedFilters = { [key: string]: unknown } | null
/**
* @nullable
*/
-export type DashboardWriteOpenApiApiPersistedVariables = { [key: string]: unknown } | null
+export type DashboardApiPersistedVariables = { [key: string]: unknown } | null
/**
* Titles for tile groups, keyed by the tiles' group_key. The dashboard shows a title above its group. A write replaces the whole map. Send an empty object or null to remove all group titles.
* @nullable
*/
-export type DashboardWriteOpenApiApiGroupTitles = { [key: string]: string } | null
+export type DashboardApiGroupTitles = { [key: string]: string } | null
-export type DashboardWriteOpenApiApiTilesItem = { [key: string]: unknown }
+export type DashboardApiTilesItem = { [key: string]: unknown }
/**
* * `auto` - auto
@@ -421,142 +391,6 @@ export interface DashboardCustomizationApi {
group_titles?: DashboardCustomizationApiGroupTitles
}
-/**
- * Serializer mixin that handles tags for objects.
- */
-export interface DashboardWriteOpenApiApi {
- readonly id: number
- /**
- * @maxLength 400
- * @nullable
- */
- name?: string | null
- description?: string
- pinned?: boolean
- readonly created_at: string
- readonly created_by: UserBasicApi
- /** @nullable */
- readonly last_accessed_at: string | null
- /** @nullable */
- readonly last_viewed_at: string | null
- /**
- * Path of the project-tree folder this dashboard is filed under in the file system, e.g. 'Unfiled/Dashboards'. An empty string means the project root; null means the dashboard has no file system entry. The dashboard's own name is not part of the path.
- * @nullable
- */
- readonly folder: string | null
- /**
- * Id of this dashboard's file system entry, or null when it has none. Together with `file_system_path` this is everything a caller needs to move the dashboard between folders, so a list page does not have to look the entry up separately.
- * @nullable
- */
- readonly file_system_id: string | null
- /**
- * Full path of this dashboard's file system entry, e.g. 'Unfiled/Dashboards/Revenue'. Unlike `folder` this keeps the dashboard's own name as the last segment, which is what a move needs in order to compute the destination path. Null when it has no entry.
- * @nullable
- */
- readonly file_system_path: string | null
- readonly is_shared: boolean
- deleted?: boolean
- readonly creation_mode: DashboardCreationModeEnumApi
- readonly filters: DashboardWriteOpenApiApiFilters
- /** @nullable */
- readonly variables: DashboardWriteOpenApiApiVariables
- /**
- * Colors pinned to specific breakdown values across the dashboard's tiles. A list of entries, not an object keyed by breakdown value. Send an empty list to clear them.
- * @nullable
- */
- breakdown_colors?: BreakdownColorConfigApi[] | null
- /**
- * ID of the color theme used for chart visualizations.
- * @nullable
- */
- data_color_theme_id?: number | null
- tags?: unknown[]
- /**
- * Only restriction level 21 is accepted on create and update. Legacy value 37 is deprecated and rejected.
- * @minimum 21
- * @maximum 21
- */
- restriction_level?: number
- readonly effective_restriction_level: RestrictionLevelEnumApi
- readonly effective_privilege_level: PrivilegeLevelEnumApi
- /**
- * The effective access level the user has for this object
- * @nullable
- */
- readonly user_access_level: string | null
- readonly access_control_version: string
- /** @nullable */
- last_refresh?: string | null
- /** @nullable */
- readonly persisted_filters: DashboardWriteOpenApiApiPersistedFilters
- /** @nullable */
- readonly persisted_variables: DashboardWriteOpenApiApiPersistedVariables
- readonly team_id: number
- /**
- * List of quick filter IDs associated with this dashboard
- * @nullable
- */
- quick_filter_ids?: string[] | null
- /** Dashboard display settings. */
- readonly customization: DashboardCustomizationApi
- /** Named tile density preset. Use tight, condensed, standard, relaxed, or wide.
- *
- * * `tight` - tight
- * * `condensed` - condensed
- * * `standard` - standard
- * * `relaxed` - relaxed
- * * `wide` - wide */
- grid_spacing?: TileSpacingEnumApi
- /** How tiles rearrange after a move or resize. vertical stacks tiles upward, horizontal stacks tiles to the left, and stable preserves positions while moving colliding tiles.
- *
- * * `vertical` - vertical
- * * `horizontal` - horizontal
- * * `stable` - stable */
- layout_compaction?: LayoutCompactionEnumApi
- /**
- * Titles for tile groups, keyed by the tiles' group_key. The dashboard shows a title above its group. A write replaces the whole map. Send an empty object or null to remove all group titles.
- * @nullable
- */
- group_titles?: DashboardWriteOpenApiApiGroupTitles
- /** @nullable */
- readonly tiles: readonly DashboardWriteOpenApiApiTilesItem[] | null
- /** Template key to create the dashboard from a predefined template. */
- use_template?: string
- /**
- * ID of an existing dashboard to duplicate.
- * @nullable
- */
- use_dashboard?: number | null
- /** When deleting, also delete insights that are only on this dashboard. */
- delete_insights?: boolean
- _create_in_folder?: string
-}
-
-export type DashboardApiFilters = { [key: string]: unknown }
-
-/**
- * @nullable
- */
-export type DashboardApiVariables = { [key: string]: unknown } | null
-
-/**
- * @nullable
- */
-export type DashboardApiPersistedFilters = { [key: string]: unknown } | null
-
-/**
- * @nullable
- */
-export type DashboardApiPersistedVariables = { [key: string]: unknown } | null
-
-/**
- * Titles for tile groups, keyed by the tiles' group_key. The dashboard shows a title above its group. A write replaces the whole map. Send an empty object or null to remove all group titles.
- * @nullable
- */
-export type DashboardApiGroupTitles = { [key: string]: string } | null
-
-export type DashboardApiTilesItem = { [key: string]: unknown }
-
/**
* Serializer mixin that handles tags for objects.
*/
@@ -607,19 +441,11 @@ export interface DashboardApi {
*/
data_color_theme_id?: number | null
tags?: unknown[]
- /** Only restriction level 21 is accepted on create and update. Legacy value 37 is deprecated and rejected.
- *
- * * `21` - Everyone in the project can edit
- * * `37` - Only those invited to this dashboard can edit */
- restriction_level?: RestrictionLevelEnumApi
- readonly effective_restriction_level: RestrictionLevelEnumApi
- readonly effective_privilege_level: PrivilegeLevelEnumApi
/**
* The effective access level the user has for this object
* @nullable
*/
readonly user_access_level: string | null
- readonly access_control_version: string
/** @nullable */
last_refresh?: string | null
/** @nullable */
@@ -1295,12 +1121,6 @@ export interface PatchedPatchedDashboardOpenApiApi {
*/
data_color_theme_id?: number | null
tags?: string[]
- /**
- * Only restriction level 21 is accepted on create and update. Legacy value 37 is deprecated and rejected.
- * @minimum 21
- * @maximum 21
- */
- restriction_level?: number
/**
* List of quick filter IDs associated with this dashboard.
* @nullable
@@ -9986,8 +9806,6 @@ export interface InsightApi {
readonly last_modified_at: string
readonly last_modified_by: UserBasicApi
readonly is_sample: boolean
- readonly effective_restriction_level: RestrictionLevelEnumApi
- readonly effective_privilege_level: PrivilegeLevelEnumApi
/**
* The effective access level the user has for this object
* @nullable
diff --git a/products/dashboards/frontend/generated/api.ts b/products/dashboards/frontend/generated/api.ts
index c87b9ac4cde1..ed9b1844ca86 100644
--- a/products/dashboards/frontend/generated/api.ts
+++ b/products/dashboards/frontend/generated/api.ts
@@ -23,7 +23,6 @@ import type {
DashboardTemplateApi,
DashboardTemplatesListParams,
DashboardTileApi,
- DashboardWriteOpenApiApi,
DashboardsBulkUpdateTagsCreateParams,
DashboardsCopyTileCreateParams,
DashboardsCreateFromTemplateJsonCreateParams,
@@ -274,7 +273,7 @@ export const getDashboardsCreateUrl = (projectId: string, params?: DashboardsCre
export const dashboardsCreate = async (
projectId: string,
- dashboardWriteOpenApiApi?: NonReadonly<DashboardWriteOpenApiApi>,
+ dashboardApi?: NonReadonly<DashboardApi>,
params?: DashboardsCreateParams,
options?: RequestInit
): Promise<DashboardApi> => {
@@ -282,7 +281,7 @@ export const dashboardsCreate = async (
...options,
method: 'POST',
headers: { 'Content-Type': 'application/json', ...options?.headers },
- body: JSON.stringify(dashboardWriteOpenApiApi),
+ body: JSON.stringify(dashboardApi),
})
}
@@ -333,7 +332,7 @@ export const getDashboardsUpdateUrl = (projectId: string, id: number, params?: D
export const dashboardsUpdate = async (
projectId: string,
id: number,
- dashboardWriteOpenApiApi?: NonReadonly<DashboardWriteOpenApiApi>,
+ dashboardApi?: NonReadonly<DashboardApi>,
params?: DashboardsUpdateParams,
options?: RequestInit
): Promise<DashboardApi> => {
@@ -341,7 +340,7 @@ export const dashboardsUpdate = async (
...options,
method: 'PUT',
headers: { 'Content-Type': 'application/json', ...options?.headers },
- body: JSON.stringify(dashboardWriteOpenApiApi),
+ body: JSON.stringify(dashboardApi),
})
}
diff --git a/products/dashboards/frontend/generated/api.zod.ts b/products/dashboards/frontend/generated/api.zod.ts
index 24a8110f63c9..e90832f67d1b 100644
--- a/products/dashboards/frontend/generated/api.zod.ts
+++ b/products/dashboards/frontend/generated/api.zod.ts
@@ -132,9 +132,6 @@ export const DashboardTemplatesCopyBetweenProjectsCreateBody = /* @__PURE__ */ z
export const dashboardsCreateBodyNameMax = 400
export const dashboardsCreateBodyBreakdownColorsItemColorTokenRegExp = new RegExp('^preset-[1-9][0-9]\*$')
-export const dashboardsCreateBodyRestrictionLevelMin = 21
-export const dashboardsCreateBodyRestrictionLevelMax = 21
-
export const dashboardsCreateBodyGroupTitlesMaxOne = 200
export const dashboardsCreateBodyDeleteInsightsDefault = false
@@ -187,14 +184,6 @@ export const DashboardsCreateBody = /* @__PURE__ */ zod
),
data_color_theme_id: zod.number().nullish().describe('ID of the color theme used for chart visualizations.'),
tags: zod.array(zod.unknown()).optional(),
- restriction_level: zod
- .number()
- .min(dashboardsCreateBodyRestrictionLevelMin)
- .max(dashboardsCreateBodyRestrictionLevelMax)
- .optional()
- .describe(
- 'Only restriction level 21 is accepted on create and update. Legacy value 37 is deprecated and rejected.'
- ),
last_refresh: zod.iso.datetime({ offset: true }).nullish(),
quick_filter_ids: zod
.array(zod.string())
@@ -238,9 +227,6 @@ export const DashboardsCreateBody = /* @__PURE__ */ zod
export const dashboardsUpdateBodyNameMax = 400
export const dashboardsUpdateBodyBreakdownColorsItemColorTokenRegExp = new RegExp('^preset-[1-9][0-9]\*$')
-export const dashboardsUpdateBodyRestrictionLevelMin = 21
-export const dashboardsUpdateBodyRestrictionLevelMax = 21
-
export const dashboardsUpdateBodyGroupTitlesMaxOne = 200
export const dashboardsUpdateBodyDeleteInsightsDefault = false
@@ -293,14 +279,6 @@ export const DashboardsUpdateBody = /* @__PURE__ */ zod
),
data_color_theme_id: zod.number().nullish().describe('ID of the color theme used for chart visualizations.'),
tags: zod.array(zod.unknown()).optional(),
- restriction_level: zod
- .number()
- .min(dashboardsUpdateBodyRestrictionLevelMin)
- .max(dashboardsUpdateBodyRestrictionLevelMax)
- .optional()
- .describe(
- 'Only restriction level 21 is accepted on create and update. Legacy value 37 is deprecated and rejected.'
- ),
last_refresh: zod.iso.datetime({ offset: true }).nullish(),
quick_filter_ids: zod
.array(zod.string())
@@ -344,9 +322,6 @@ export const DashboardsUpdateBody = /* @__PURE__ */ zod
export const dashboardsPartialUpdateBodyNameMax = 400
export const dashboardsPartialUpdateBodyBreakdownColorsItemColorTokenRegExp = new RegExp('^preset-[1-9][0-9]\*$')
-export const dashboardsPartialUpdateBodyRestrictionLevelMin = 21
-export const dashboardsPartialUpdateBodyRestrictionLevelMax = 21
-
export const dashboardsPartialUpdateBodyGroupTitlesMaxOne = 200
export const dashboardsPartialUpdateBodyTilesItemLayoutsOneSmOneXMin = 0
@@ -500,14 +475,6 @@ export const DashboardsPartialUpdateBody = /* @__PURE__ */ zod
),
data_color_theme_id: zod.number().nullish().describe('ID of the color theme used for chart visualizations.'),
tags: zod.array(zod.string()).optional(),
- restriction_level: zod
- .number()
- .min(dashboardsPartialUpdateBodyRestrictionLevelMin)
- .max(dashboardsPartialUpdateBodyRestrictionLevelMax)
- .optional()
- .describe(
- 'Only restriction level 21 is accepted on create and update. Legacy value 37 is deprecated and rejected.'
- ),
quick_filter_ids: zod
.array(zod.string())
.nullish()
@@ -2613,15 +2580,6 @@ export const DashboardsCreateFromTemplateJsonCreateBody = /* @__PURE__ */ zod
),
data_color_theme_id: zod.number().nullish().describe('ID of the color theme used for chart visualizations.'),
tags: zod.array(zod.unknown()).optional(),
- restriction_level: zod
- .union([zod.literal(21), zod.literal(37)])
- .describe(
- '\* `21` - Everyone in the project can edit\n\* `37` - Only those invited to this dashboard can edit'
- )
- .optional()
- .describe(
- 'Only restriction level 21 is accepted on create and update. Legacy value 37 is deprecated and rejected.\n\n\* `21` - Everyone in the project can edit\n\* `37` - Only those invited to this dashboard can edit'
- ),
last_refresh: zod.iso.datetime({ offset: true }).nullish(),
quick_filter_ids: zod
.array(zod.string())
@@ -2724,15 +2682,6 @@ export const DashboardsCreateUnlistedDashboardCreateBody = /* @__PURE__ */ zod
),
data_color_theme_id: zod.number().nullish().describe('ID of the color theme used for chart visualizations.'),
tags: zod.array(zod.unknown()).optional(),
- restriction_level: zod
- .union([zod.literal(21), zod.literal(37)])
- .describe(
- '\* `21` - Everyone in the project can edit\n\* `37` - Only those invited to this dashboard can edit'
- )
- .optional()
- .describe(
- 'Only restriction level 21 is accepted on create and update. Legacy value 37 is deprecated and rejected.\n\n\* `21` - Everyone in the project can edit\n\* `37` - Only those invited to this dashboard can edit'
- ),
last_refresh: zod.iso.datetime({ offset: true }).nullish(),
quick_filter_ids: zod
.array(zod.string())
diff --git a/products/dashboards/mcp/tools.yaml b/products/dashboards/mcp/tools.yaml
index 177028f2f693..d800c88af4ed 100644
--- a/products/dashboards/mcp/tools.yaml
+++ b/products/dashboards/mcp/tools.yaml
@@ -50,27 +50,16 @@ tools:
already declined a subscription earlier in this conversation, do not offer again.
exclude_params:
- creation_mode
- - effective_restriction_level
- - effective_privilege_level
- is_shared
- - access_control_version
- last_refresh
- last_accessed_at
- deleted
- persisted_filters
- persisted_variables
- _create_in_folder
- param_overrides:
- restriction_level:
- description: >
- Set to 21 for everyone in the project to edit. Legacy value 37 is deprecated and rejected by the API.
response:
exclude:
- - effective_restriction_level
- - effective_privilege_level
- user_access_level
- - access_control_version
- - restriction_level
- creation_mode
- deleted
- breakdown_colors
@@ -91,8 +80,6 @@ tools:
- tiles.*.insight.filters_hash
- tiles.*.insight.dashboards
- tiles.*.insight.dashboard_tiles
- - tiles.*.insight.effective_restriction_level
- - tiles.*.insight.effective_privilege_level
- tiles.*.insight.user_access_level
- tiles.*.insight.filters
- tiles.*.insight.is_sample
@@ -231,11 +218,7 @@ tools:
cast: string-int
response:
exclude:
- - effective_restriction_level
- - effective_privilege_level
- user_access_level
- - access_control_version
- - restriction_level
- creation_mode
- deleted
- breakdown_colors
@@ -256,8 +239,6 @@ tools:
- tiles.*.insight.filters_hash
- tiles.*.insight.dashboards
- tiles.*.insight.dashboard_tiles
- - tiles.*.insight.effective_restriction_level
- - tiles.*.insight.effective_privilege_level
- tiles.*.insight.user_access_level
- tiles.*.insight.filters
- tiles.*.insight.is_sample
@@ -447,15 +428,14 @@ tools:
title: Update dashboard
description: >
Resize, reposition, or update dashboard tiles. It can also update the dashboard name, description, pinned
- status, tags, filters, and restriction level 21. Legacy value 37 is deprecated and rejected by the API.
- After you create or add insight tiles, call dashboard-get to get their tile IDs, then pass `tiles` with each
- tile's `id` and a `layouts` object holding x, y, w, and h per breakpoint. This works for every tile type,
- including insight tiles. The desktop grid (`layouts.sm`) is 12 columns wide. Set each tile's width and
- height for its content and importance. Width can be any whole number from 1 to 12, subject to the tile's
- minimum size. Mixed rows such as 8-wide and 4-wide tiles can show hierarchy. A write replaces the tile's
- whole layout, so send a complete box, not just the value you want to change. Boxes are stored as sent and
- overlaps are not resolved, so plan the whole grid and send every tile you move in one request. Only set
- `layouts.sm`: the dashboard derives the mobile layout from the sm order and heights. Use
+ status, tags, and filters. After you create or add insight tiles, call dashboard-get to get their tile IDs,
+ then pass `tiles` with each tile's `id` and a `layouts` object holding x, y, w, and h per breakpoint. This
+ works for every tile type, including insight tiles. The desktop grid (`layouts.sm`) is 12 columns wide. Set
+ each tile's width and height for its content and importance. Width can be any whole number from 1 to 12,
+ subject to the tile's minimum size. Mixed rows such as 8-wide and 4-wide tiles can show hierarchy. A write
+ replaces the tile's whole layout, so send a complete box, not just the value you want to change. Boxes are
+ stored as sent and overlaps are not resolved, so plan the whole grid and send every tile you move in one
+ request. Only set `layouts.sm`: the dashboard derives the mobile layout from the sm order and heights. Use
dashboard-reorder-tiles only to repack the whole dashboard with preserved or uniform tile sizes. The same
`tiles` array also updates a widget tile's own settings: add a nested `widget.id` from dashboard-get plus
the fields to change (`config`, `name`, `description`). That is the same PATCH path the UI uses, but prefer
@@ -468,10 +448,7 @@ tools:
insight.
exclude_params:
- creation_mode
- - effective_restriction_level
- - effective_privilege_level
- is_shared
- - access_control_version
- last_refresh
- last_accessed_at
- deleted
@@ -481,16 +458,9 @@ tools:
param_overrides:
id:
cast: string-int
- restriction_level:
- description: >
- Set to 21 for everyone in the project to edit. Legacy value 37 is deprecated and rejected by the API.
response:
exclude:
- - effective_restriction_level
- - effective_privilege_level
- user_access_level
- - access_control_version
- - restriction_level
- creation_mode
- deleted
- breakdown_colors
@@ -511,8 +481,6 @@ tools:
- tiles.*.insight.filters_hash
- tiles.*.insight.dashboards
- tiles.*.insight.dashboard_tiles
- - tiles.*.insight.effective_restriction_level
- - tiles.*.insight.effective_privilege_level
- tiles.*.insight.user_access_level
- tiles.*.insight.filters
- tiles.*.insight.is_sample
diff --git a/products/desktop/packages/api-client/src/generated.ts b/products/desktop/packages/api-client/src/generated.ts
index 07b44bc9c5aa..bb63f5f11d19 100644
--- a/products/desktop/packages/api-client/src/generated.ts
+++ b/products/desktop/packages/api-client/src/generated.ts
@@ -6234,16 +6234,6 @@ export namespace Schemas {
| "template"
| "duplicate"
| "unlisted";
- /**
- * * `21` - Everyone in the project can edit
- * * `37` - Only those invited to this dashboard can edit
- */
- export type RestrictionLevelEnum = 21 | 37;
- /**
- * * `21` - Can view dashboard
- * * `37` - Can edit dashboard
- */
- export type PrivilegeLevelEnum = 21 | 37;
/**
* * `tight` - tight
* * `condensed` - condensed
@@ -6321,17 +6311,10 @@ export namespace Schemas {
* Serializer mixin that handles tags for objects.
*/
tags?: Array<unknown> | undefined;
- /**
- * Serializer mixin that handles tags for objects.
- */
- restriction_level?: RestrictionLevelEnum | undefined;
- effective_restriction_level: RestrictionLevelEnum & unknown;
- effective_privilege_level: PrivilegeLevelEnum & unknown;
/**
* The effective access level the user has for this object
*/
user_access_level: string | null;
- access_control_version: string;
/**
* Serializer mixin that handles tags for objects.
*/
@@ -6680,115 +6663,6 @@ export namespace Schemas {
dashboard_id: number;
deleted?: (boolean | null) | undefined;
};
- /**
- * Serializer mixin that handles tags for objects.
- */
- export type DashboardWriteOpenApi = {
- id: number;
- /**
- * Serializer mixin that handles tags for objects.
- */
- name?: (string | null) | undefined;
- /**
- * Serializer mixin that handles tags for objects.
- */
- description?: string | undefined;
- /**
- * Serializer mixin that handles tags for objects.
- */
- pinned?: boolean | undefined;
- created_at: string;
- created_by: UserBasic & unknown;
- last_accessed_at: string | null;
- last_viewed_at: string | null;
- /**
- * Path of the project-tree folder this dashboard is filed under in the file system, e.g. 'Unfiled/Dashboards'. An empty string means the project root; null means the dashboard has no file system entry. The dashboard's own name is not part of the path.
- */
- folder: string | null;
- /**
- * Id of this dashboard's file system entry, or null when it has none. Together with `file_system_path` this is everything a caller needs to move the dashboard between folders, so a list page does not have to look the entry up separately.
- */
- file_system_id: string | null;
- /**
- * Full path of this dashboard's file system entry, e.g. 'Unfiled/Dashboards/Revenue'. Unlike `folder` this keeps the dashboard's own name as the last segment, which is what a move needs in order to compute the destination path. Null when it has no entry.
- */
- file_system_path: string | null;
- is_shared: boolean;
- /**
- * Serializer mixin that handles tags for objects.
- */
- deleted?: boolean | undefined;
- creation_mode: DashboardCreationModeEnum & unknown;
- filters: Record<string, unknown>;
- variables: Record<string, unknown> | null;
- /**
- * Serializer mixin that handles tags for objects.
- */
- breakdown_colors?: (Array<BreakdownColorConfig> | null) | undefined;
- /**
- * Serializer mixin that handles tags for objects.
- */
- data_color_theme_id?: (number | null) | undefined;
- /**
- * Serializer mixin that handles tags for objects.
- */
- tags?: Array<unknown> | undefined;
- /**
- * Serializer mixin that handles tags for objects.
- */
- restriction_level?: number | undefined;
- effective_restriction_level: RestrictionLevelEnum & unknown;
- effective_privilege_level: PrivilegeLevelEnum & unknown;
- /**
- * The effective access level the user has for this object
- */
- user_access_level: string | null;
- access_control_version: string;
- /**
- * Serializer mixin that handles tags for objects.
- */
- last_refresh?: (string | null) | undefined;
- persisted_filters: Record<string, unknown> | null;
- persisted_variables: Record<string, unknown> | null;
- team_id: number;
- /**
- * Serializer mixin that handles tags for objects.
- */
- quick_filter_ids?: (Array<string> | null) | undefined;
- /**
- * Dashboard display settings.
- */
- customization: DashboardCustomization & unknown;
- /**
- * Serializer mixin that handles tags for objects.
- */
- grid_spacing?: (TileSpacingEnum & unknown) | undefined;
- /**
- * Serializer mixin that handles tags for objects.
- */
- layout_compaction?: (LayoutCompactionEnum & unknown) | undefined;
- /**
- * Serializer mixin that handles tags for objects.
- */
- group_titles?: (Record<string, string> | null) | undefined;
- tiles: Array<Record<string, unknown>> | null;
- /**
- * Serializer mixin that handles tags for objects.
- */
- use_template?: string | undefined;
- /**
- * Serializer mixin that handles tags for objects.
- */
- use_dashboard?: (number | null) | undefined;
- /**
- * Serializer mixin that handles tags for objects.
- */
- delete_insights?: boolean | undefined;
- /**
- * Serializer mixin that handles tags for objects.
- */
- _create_in_folder?: string | undefined;
- };
export type DataTableNodeViewPropsContextType =
| "event_definition"
| "team_columns";
@@ -16210,8 +16084,6 @@ export namespace Schemas {
last_modified_at: string;
last_modified_by: UserBasic & unknown;
is_sample: boolean;
- effective_restriction_level: RestrictionLevelEnum & unknown;
- effective_privilege_level: PrivilegeLevelEnum & unknown;
/**
* The effective access level the user has for this object
*/
@@ -19428,8 +19300,6 @@ export namespace Schemas {
last_modified_at: string;
last_modified_by: UserBasic & unknown;
is_sample: boolean;
- effective_restriction_level: RestrictionLevelEnum & unknown;
- effective_privilege_level: PrivilegeLevelEnum & unknown;
user_access_level: string | null;
timezone: string | null;
is_cached: boolean;
@@ -19462,7 +19332,6 @@ export namespace Schemas {
breakdown_colors: Array<BreakdownColorConfig> | null;
data_color_theme_id: number | null;
tags: Array<string>;
- restriction_level: number;
quick_filter_ids: Array<string> | null;
grid_spacing: TileSpacingEnum;
layout_compaction: LayoutCompactionEnum;
@@ -21953,7 +21822,7 @@ export namespace Endpoints {
}>;
path: { id: number; project_id: string };
- body: Schemas.DashboardWriteOpenApi;
+ body: Schemas.Dashboard;
};
responses: { 200: Schemas.Dashboard };
};
diff --git a/products/feature_flags/backend/api/test/__snapshots__/test_organization_feature_flag.ambr b/products/feature_flags/backend/api/test/__snapshots__/test_organization_feature_flag.ambr
index c709799c1226..dd8ce45e3d54 100644
--- a/products/feature_flags/backend/api/test/__snapshots__/test_organization_feature_flag.ambr
+++ b/products/feature_flags/backend/api/test/__snapshots__/test_organization_feature_flag.ambr
@@ -810,7 +810,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
diff --git a/products/model_crossing_uses_baseline.txt b/products/model_crossing_uses_baseline.txt
index 3a77c4376666..edef29a10adf 100644
--- a/products/model_crossing_uses_baseline.txt
+++ b/products/model_crossing_uses_baseline.txt
@@ -91,7 +91,6 @@ customer_analytics.FeatureRequestProductAreaLink products.customer_analytics.bac
customer_analytics.Meeting products.customer_analytics.backend.facade.testing.create_meeting facade-returns 1
customer_analytics:backend/facade/hogql.py products.customer_analytics.backend.facade.hogql facade-logic 33
customer_analytics:backend/hogql_queries/ posthog.api.test.test_sharing drives(AccountsQuery) 1
-dashboards.Dashboard ee.DashboardPrivilege.dashboard reverse-accessor(privileges) 1
dashboards.Dashboard exports.ExportedAsset.dashboard reverse-accessor(exportedasset_set) 1
dashboards.Dashboard feature_flags.FeatureFlag.analytics_dashboards reverse-accessor(analytics_dashboards) 1
dashboards.Dashboard posthog.SharingConfiguration.dashboard reverse-accessor(sharingconfiguration_set) 1
diff --git a/products/product_analytics/AGENTS.md b/products/product_analytics/AGENTS.md
index 38d427fb43f5..878b36354efc 100644
--- a/products/product_analytics/AGENTS.md
+++ b/products/product_analytics/AGENTS.md
@@ -11,9 +11,9 @@ Do not restrict a project-level insight operation to only `team_id=self.team_id`
### Authorization contract
- `InsightViewSet` filters normal `list` reads through `_filter_queryset_by_access_level`. Custom list-like actions need an access-aware queryset implementation because this helper only filters when `self.action == "list"`.
-- On Enterprise installs, `EnterpriseInsightsViewSet` adds `CanEditInsight` for unsafe detail actions. A new unsafe detail action must keep object permission checks.
+- Unsafe detail actions get object permission checks from the default `AccessControlPermission` chain. A new unsafe detail action keeps them as long as it goes through `get_object`.
- Detail-false bulk actions do not receive DRF object permissions. Filter every target through `_bulk_filter_editable_insights`, or perform the equivalent per-insight editor check. Return skipped targets without changing them.
-- Restore access to an insight does not grant edit access to every dashboard that contains it. Use `restore_tiles_for_insights` with `user_permissions`, so tiles remain hidden on dashboards the requester cannot edit.
+- Restore access to an insight does not grant edit access to every dashboard that contains it. Use `restore_tiles_for_insights` with `user_access_control`, so tiles remain hidden on dashboards the requester cannot edit.
- For an action that supports personal API keys, OAuth, or MCP, declare `required_scopes` or add it to the view set scope-action list. Otherwise, API-key callers receive a 403 response.
### Shared-link contract
@@ -26,7 +26,6 @@ Insight variables cannot use sharing authentication. Keep this rejection in `Ins
### Where to make changes
- Read [the insight API](backend/presentation/insight.py) when changing access, sharing, bulk actions, or project scope.
-- Read [the Enterprise permission wrapper](backend/presentation/insight_ee.py) when changing unsafe insight actions.
- Read [the insight-variable API](backend/presentation/insight_variable.py) when changing variable access.
- Extend [the existing insight API tests](backend/tests/api/test_insight.py) for object access, shared links, or bulk access. Cover inaccessible targets and dashboard tiles that must remain hidden.
diff --git a/products/product_analytics/backend/presentation/insight.py b/products/product_analytics/backend/presentation/insight.py
index 54157f560e3f..cf1a344f9ec8 100644
--- a/products/product_analytics/backend/presentation/insight.py
+++ b/products/product_analytics/backend/presentation/insight.py
@@ -1,4 +1,5 @@
import json
+import builtins
from collections.abc import Sequence
from datetime import datetime, timedelta
from functools import lru_cache
@@ -157,6 +158,7 @@ from products.dashboards.backend.facade.api import (
hide_tiles_for_insights,
insight_has_listed_tile,
insight_ids_on_dashboard,
+ insights_with_dashboard_edit_access,
plan_insight_tile_placement,
restore_tiles_for_insights,
tile_for_insight_on_dashboard,
@@ -166,7 +168,6 @@ from products.dashboards.backend.facade.api import (
unknown_dashboard_ids,
update_insight_dashboard_membership,
)
-from products.dashboards.backend.facade.enums import PrivilegeLevel, RestrictionLevel
from products.product_analytics.backend.facade.account_filters import plan_test_account_filter_update
from products.product_analytics.backend.facade.api import (
insight_variables_for_team,
@@ -193,6 +194,7 @@ from products.product_analytics.backend.presentation.insight_metadata import (
InsightMetadataTimeoutError,
generate_insight_metadata,
)
+from products.product_analytics.backend.presentation.insight_permissions import CanEditInsightDashboards
from products.product_analytics.backend.presentation.insight_write_validation import validate_insight_write
from products.product_analytics.backend.presentation.query_concurrency import query_concurrency_slots
from products.subscriptions.backend.facade.api import delete_insight_subscriptions
@@ -576,8 +578,6 @@ class InsightSerializer(InsightBasicSerializer):
is_cached = serializers.SerializerMethodField(read_only=True)
created_by = UserBasicSerializer(read_only=True)
last_modified_by = UserBasicSerializer(read_only=True)
- effective_restriction_level = serializers.SerializerMethodField()
- effective_privilege_level = serializers.SerializerMethodField()
timezone = serializers.SerializerMethodField(help_text="The timezone this chart is displayed in.")
last_viewed_at = serializers.SerializerMethodField(read_only=True)
dashboards = DashboardIdsField( # type: ignore[assignment]
@@ -651,8 +651,6 @@ class InsightSerializer(InsightBasicSerializer):
"last_modified_at",
"last_modified_by",
"is_sample",
- "effective_restriction_level",
- "effective_privilege_level",
"user_access_level",
"timezone",
"is_cached",
@@ -676,8 +674,6 @@ class InsightSerializer(InsightBasicSerializer):
"short_id",
"updated_at",
"is_sample",
- "effective_restriction_level",
- "effective_privilege_level",
"user_access_level",
"timezone",
"refreshing",
@@ -803,7 +799,6 @@ class InsightSerializer(InsightBasicSerializer):
team_id=team_id,
query=validated_data.get("query"),
user=request.user,
- user_permissions=self.user_permissions,
user_access_control=self.user_access_control,
)
except CannotAddToDashboard as error:
@@ -938,8 +933,6 @@ class InsightSerializer(InsightBasicSerializer):
self._log_insight_update(before_update, dashboards_before_change, updated_insight)
- self.user_permissions.reset_insights_dashboard_cached_results()
-
return updated_insight
def _log_insight_update(
@@ -1008,7 +1001,6 @@ class InsightSerializer(InsightBasicSerializer):
dashboard_ids=dashboard_ids,
query=query,
user=self.context["request"].user,
- user_permissions=self.user_permissions,
user_access_control=self.user_access_control,
)
except CannotAddToDashboard as error:
@@ -1201,18 +1193,6 @@ class InsightSerializer(InsightBasicSerializer):
resolved_layers = resolve_filter_layers_by_priority(dashboard_filters, tile_filters_override)
return {key: value or None for key, value in resolved_layers.items()}
- @extend_schema_field(serializers.ChoiceField(choices=RestrictionLevel.choices))
- def get_effective_restriction_level(self, insight: Insight) -> RestrictionLevel:
- if self.context.get("is_shared"):
- return RestrictionLevel.ONLY_COLLABORATORS_CAN_EDIT
- return self.user_permissions.insight(insight).effective_restriction_level
-
- @extend_schema_field(serializers.ChoiceField(choices=PrivilegeLevel.choices))
- def get_effective_privilege_level(self, insight: Insight) -> PrivilegeLevel:
- if self.context.get("is_shared"):
- return PrivilegeLevel.CAN_VIEW
- return self.user_permissions.insight(insight).effective_privilege_level
-
def to_representation(self, instance: Insight):
representation = super().to_representation(instance)
@@ -2044,6 +2024,7 @@ class InsightViewSet(
viewsets.ModelViewSet,
):
scope_object = "insight"
+ permission_classes = [CanEditInsightDashboards]
# Record a tags change per insight when bulk_update_tags mutates it, matching the single-object path.
bulk_tag_activity_scope = "Insight"
serializer_class = InsightSerializer
@@ -2099,18 +2080,6 @@ class InsightViewSet(
span.set_attribute("insight.search.empty", results_len == 0)
return response
- def paginate_queryset(self, queryset):
- page = super().paginate_queryset(queryset)
- if (
- page is not None
- and getattr(self, "action", None) == "list"
- and not self._is_basic_request()
- and not isinstance(self.request.successful_authenticator, SharingAccessTokenAuthentication)
- ):
- tiles = [tile for insight in page for tile in insight.dashboard_tiles.all()]
- self.user_permissions.set_preloaded_dashboard_tiles(tiles)
- return page
-
def get_serializer_class(self) -> type[serializers.BaseSerializer]:
if self._is_basic_request():
return InsightBasicSerializer
@@ -2714,6 +2683,16 @@ When set, the specified dashboard's filters and date range override will be appl
person_emails=holds("person:read"),
)
+ def validate_bulk_tag_changes(self, objects: Sequence[Insight], tag_action: str, tags: builtins.list[str]) -> None:
+ editable_ids = insights_with_dashboard_edit_access(
+ [insight.id for insight in objects],
+ user_access_control=self.user_access_control,
+ project_id=self.team.project_id,
+ )
+ if any(insight.id not in editable_ids for insight in objects):
+ raise PermissionDenied(CanEditInsightDashboards.message)
+ super().validate_bulk_tag_changes(objects, tag_action, tags)
+
# `Sequence` rather than `list` here: this viewset defines a `list` method that shadows the builtin `list`
# in the class namespace, so `list[...]` in this signature breaks both at class-definition time and for mypy.
def _bulk_filter_editable_insights(
@@ -2737,10 +2716,24 @@ When set, the specified dashboard's filters and date range override will be appl
return insights, skipped
self.user_access_control.preload_object_access_controls(cast(list, insights))
+ # Deletion hides the tiles used by normal edit checks. Tile restoration checks each dashboard separately.
+ dashboard_editable_ids = (
+ {insight.id for insight in insights}
+ if deleted
+ else insights_with_dashboard_edit_access(
+ [insight.id for insight in insights],
+ user_access_control=self.user_access_control,
+ project_id=self.team.project_id,
+ )
+ )
editable: list[Insight] = []
for insight in insights:
user_access_level = self.user_access_control.get_user_access_level(insight)
- if user_access_level and access_level_satisfied_for_resource("insight", user_access_level, "editor"):
+ if (
+ insight.id in dashboard_editable_ids
+ and user_access_level
+ and access_level_satisfied_for_resource("insight", user_access_level, "editor")
+ ):
editable.append(insight)
else:
skipped.append({"id": insight.id, "reason": "You don't have permission to edit this insight"})
@@ -2796,8 +2789,6 @@ When set, the specified dashboard's filters and date range override will be appl
)
bulk_log_activity(activity_log_entries)
- self.user_permissions.reset_insights_dashboard_cached_results()
-
return Response({"deleted": deleted, "skipped": skipped})
@validated_request(
@@ -2825,7 +2816,7 @@ When set, the specified dashboard's filters and date range override will be appl
Insight.objects_including_soft_deleted.filter(
id__in=insight_ids, team__project_id=self.team.project_id
).update(deleted=False, last_modified_at=now(), last_modified_by=current_user)
- restore_tiles_for_insights(insight_ids, user_permissions=self.user_permissions)
+ restore_tiles_for_insights(insight_ids, user_access_control=self.user_access_control)
activity_log_entries: list[LogActivityEntry] = []
for insight in insights:
@@ -2846,8 +2837,6 @@ When set, the specified dashboard's filters and date range override will be appl
)
bulk_log_activity(activity_log_entries)
- self.user_permissions.reset_insights_dashboard_cached_results()
-
return Response({"restored": restored, "skipped": skipped})
@validated_request(
@@ -2902,9 +2891,6 @@ When set, the specified dashboard's filters and date range override will be appl
for key, count in self._set_test_account_filter_on_batch(batch, enabled=enabled).items():
totals[key] += count
- if totals["updated"]:
- self.user_permissions.reset_insights_dashboard_cached_results()
-
# Reported even when nothing changed: a run that finds no insights to flip still tells us
# someone reached for this, and the no-op rate is the signal for whether it's discoverable.
report_user_action(
@@ -2930,10 +2916,6 @@ When set, the specified dashboard's filters and date range override will be appl
Access has to be resolved one insight at a time. `filter_queryset_by_access_level` answers whether an
insight is visible rather than whether it can be edited, so filtering in the query would let insights
the caller only has `viewer` on through to the write.
-
- EE's `CanEditInsight` needs no counterpart here. It refuses insights on dashboards the caller can only
- view, but `can_edit` short-circuits for anyone who `can_restrict`, which is every project admin, and the
- action already requires project admin. Relaxing that requirement would have to bring the check back.
"""
if not self.user_access_control:
return insights, 0
diff --git a/products/product_analytics/backend/presentation/insight_ee.py b/products/product_analytics/backend/presentation/insight_ee.py
deleted file mode 100644
index 394b158b1cb8..000000000000
--- a/products/product_analytics/backend/presentation/insight_ee.py
+++ /dev/null
@@ -1,22 +0,0 @@
-"""Insights viewset variant enforcing dashboard edit permissions, selected by routes.py on EE_AVAILABLE installs."""
-
-from rest_framework.permissions import SAFE_METHODS, BasePermission
-from rest_framework.request import Request
-
-from products.dashboards.backend.facade.enums import PrivilegeLevel
-from products.product_analytics.backend.facade.models import Insight
-from products.product_analytics.backend.presentation.insight import InsightViewSet
-
-
-class CanEditInsight(BasePermission):
- message = "This insight is on a dashboard that can only be edited by its owner, team members invited to editing the dashboard, and project admins."
-
- def has_object_permission(self, request: Request, view, insight: Insight) -> bool:
- if request.method in SAFE_METHODS:
- return True
-
- return view.user_permissions.insight(insight).effective_privilege_level == PrivilegeLevel.CAN_EDIT
-
-
-class EnterpriseInsightsViewSet(InsightViewSet):
- permission_classes = [CanEditInsight]
diff --git a/products/product_analytics/backend/presentation/insight_permissions.py b/products/product_analytics/backend/presentation/insight_permissions.py
new file mode 100644
index 000000000000..49b6e57668c5
--- /dev/null
+++ b/products/product_analytics/backend/presentation/insight_permissions.py
@@ -0,0 +1,24 @@
+from typing import TYPE_CHECKING, cast
+
+from rest_framework.permissions import SAFE_METHODS, BasePermission
+from rest_framework.request import Request
+
+from products.dashboards.backend.facade.api import insights_with_dashboard_edit_access
+from products.product_analytics.backend.facade.models import Insight
+
+if TYPE_CHECKING:
+ from rest_framework.views import APIView
+
+ from products.product_analytics.backend.presentation.insight import InsightViewSet
+
+
+class CanEditInsightDashboards(BasePermission):
+ message = "You don't have permission to edit this insight"
+
+ def has_object_permission(self, request: Request, view: "APIView", insight: Insight) -> bool:
+ if request.method in SAFE_METHODS:
+ return True
+ insight_view = cast("InsightViewSet", view)
+ return insight.id in insights_with_dashboard_edit_access(
+ [insight.id], user_access_control=insight_view.user_access_control, project_id=insight_view.team.project_id
+ )
diff --git a/products/product_analytics/backend/routes.py b/products/product_analytics/backend/routes.py
index c92874cfdb78..0a706162a987 100644
--- a/products/product_analytics/backend/routes.py
+++ b/products/product_analytics/backend/routes.py
@@ -1,22 +1,15 @@
from posthog.api import sharing
from posthog.api.routing import RouterRegistry
-from posthog.settings import EE_AVAILABLE
import products.alerts.backend.presentation.views.alert as alert
from products.product_analytics.backend.presentation.events_retention import EventsRetentionViewSet
from products.product_analytics.backend.presentation.insight import InsightViewSet
-from products.product_analytics.backend.presentation.insight_ee import EnterpriseInsightsViewSet
from products.product_analytics.backend.presentation.insight_variable import InsightVariableViewSet
from products.product_analytics.backend.presentation.paths_v2 import PathsV2ViewSet
def register_routes(routers: RouterRegistry) -> None:
- # EE installs override the insights viewset with EnterpriseInsightsViewSet.
- # The non-EE InsightViewSet is the fallback. Either way, the route name and
- # nested sub-routes (sharing, thresholds) stay identical.
- insights_viewset: type[InsightViewSet] = EnterpriseInsightsViewSet if EE_AVAILABLE else InsightViewSet
-
- insights_router = routers.projects.register(r"insights", insights_viewset, "project_insights", ["team_id"])
+ insights_router = routers.projects.register(r"insights", InsightViewSet, "project_insights", ["team_id"])
# SharingConfigurationViewSet is shared (core); the route lives under
# insights/<id>/sharing — product_analytics owns the sub-route.
diff --git a/products/product_analytics/backend/tests/api/__snapshots__/test_insight.ambr b/products/product_analytics/backend/tests/api/__snapshots__/test_insight.ambr
index 0c5b30a9ede2..729e4437f7db 100644
--- a/products/product_analytics/backend/tests/api/__snapshots__/test_insight.ambr
+++ b/products/product_analytics/backend/tests/api/__snapshots__/test_insight.ambr
@@ -47,97 +47,6 @@
'''
# ---
# name: TestInsight.test_listing_insights_does_not_nplus1.100
- '''
- SELECT "posthog_dashboardtile"."id",
- "posthog_dashboardtile"."dashboard_id",
- "posthog_dashboardtile"."insight_id",
- "posthog_dashboardtile"."text_id",
- "posthog_dashboardtile"."button_tile_id",
- "posthog_dashboardtile"."widget_id",
- "posthog_dashboardtile"."team_id",
- "posthog_dashboardtile"."layouts",
- "posthog_dashboardtile"."color",
- "posthog_dashboardtile"."filters_hash",
- "posthog_dashboardtile"."last_refresh",
- "posthog_dashboardtile"."refreshing",
- "posthog_dashboardtile"."refresh_attempt",
- "posthog_dashboardtile"."filters_overrides",
- "posthog_dashboardtile"."show_description",
- "posthog_dashboardtile"."transparent_background",
- "posthog_dashboardtile"."group_key",
- "posthog_dashboardtile"."badge",
- "posthog_dashboardtile"."deleted"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.101
- '''
- SELECT "posthog_dashboardtile"."id",
- "posthog_dashboardtile"."dashboard_id",
- "posthog_dashboardtile"."insight_id",
- "posthog_dashboardtile"."text_id",
- "posthog_dashboardtile"."button_tile_id",
- "posthog_dashboardtile"."widget_id",
- "posthog_dashboardtile"."team_id",
- "posthog_dashboardtile"."layouts",
- "posthog_dashboardtile"."color",
- "posthog_dashboardtile"."filters_hash",
- "posthog_dashboardtile"."last_refresh",
- "posthog_dashboardtile"."refreshing",
- "posthog_dashboardtile"."refresh_attempt",
- "posthog_dashboardtile"."filters_overrides",
- "posthog_dashboardtile"."show_description",
- "posthog_dashboardtile"."transparent_background",
- "posthog_dashboardtile"."group_key",
- "posthog_dashboardtile"."badge",
- "posthog_dashboardtile"."deleted"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.102
- '''
- SELECT "posthog_insightvariable"."id",
- "posthog_insightvariable"."name",
- "posthog_insightvariable"."code_name",
- "posthog_insightvariable"."type",
- "posthog_insightvariable"."default_value",
- "posthog_insightvariable"."is_multi"
- FROM "posthog_insightvariable"
- INNER JOIN "posthog_team" ON ("posthog_insightvariable"."team_id" = "posthog_team"."id")
- WHERE ("posthog_insightvariable"."team_id" =
- (SELECT U0."parent_team_id" AS "parent_team_id"
- FROM "posthog_team" U0
- WHERE U0."id" = 99999
- LIMIT 1)
- OR ("posthog_team"."parent_team_id" IS NULL
- AND "posthog_insightvariable"."team_id" = 99999))
- ORDER BY "posthog_insightvariable"."name" ASC
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.103
- '''
- SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
- "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
- "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
- "posthog_teamrevenueanalyticsconfig"."events",
- "posthog_teamrevenueanalyticsconfig"."goals",
- "posthog_teamrevenueanalyticsconfig"."base_currency"
- FROM "posthog_teamrevenueanalyticsconfig"
- WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.104
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -153,7 +62,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.105
+# name: TestInsight.test_listing_insights_does_not_nplus1.101
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -170,51 +79,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.106
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.107
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.108
+# name: TestInsight.test_listing_insights_does_not_nplus1.102
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -223,27 +88,14 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.109
+# name: TestInsight.test_listing_insights_does_not_nplus1.103
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboarditem"
WHERE NOT ("posthog_dashboarditem"."deleted")
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.11
- '''
- SELECT "posthog_dashboard"."id" AS "id",
- "posthog_dashboard"."name" AS "name"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.110
+# name: TestInsight.test_listing_insights_does_not_nplus1.104
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -289,7 +141,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.111
+# name: TestInsight.test_listing_insights_does_not_nplus1.105
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -335,7 +187,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.112
+# name: TestInsight.test_listing_insights_does_not_nplus1.106
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -474,7 +326,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.113
+# name: TestInsight.test_listing_insights_does_not_nplus1.107
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -529,7 +381,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.114
+# name: TestInsight.test_listing_insights_does_not_nplus1.108
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -552,7 +404,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.115
+# name: TestInsight.test_listing_insights_does_not_nplus1.109
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -605,7 +457,20 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.116
+# name: TestInsight.test_listing_insights_does_not_nplus1.11
+ '''
+ SELECT "posthog_dashboard"."id" AS "id",
+ "posthog_dashboard"."name" AS "name"
+ FROM "posthog_dashboard"
+ WHERE (NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboard"."id" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.110
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboarditem"
@@ -614,7 +479,7 @@
AND NOT ("posthog_dashboarditem"."deleted"))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.117
+# name: TestInsight.test_listing_insights_does_not_nplus1.111
'''
SELECT "posthog_dashboarditem"."id",
"posthog_dashboarditem"."name",
@@ -801,7 +666,7 @@
LIMIT 100
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.118
+# name: TestInsight.test_listing_insights_does_not_nplus1.112
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -819,7 +684,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.119
+# name: TestInsight.test_listing_insights_does_not_nplus1.113
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -836,20 +701,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.12
- '''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."dashboard_id" = 99999
- AND NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL))
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.120
+# name: TestInsight.test_listing_insights_does_not_nplus1.114
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -870,7 +722,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.121
+# name: TestInsight.test_listing_insights_does_not_nplus1.115
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -883,7 +735,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.122
+# name: TestInsight.test_listing_insights_does_not_nplus1.116
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -897,7 +749,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.123
+# name: TestInsight.test_listing_insights_does_not_nplus1.117
'''
SELECT "posthog_team"."id" AS "id"
FROM "posthog_team"
@@ -905,7 +757,7 @@
AND "posthog_team"."receive_org_level_activity_logs")
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.124
+# name: TestInsight.test_listing_insights_does_not_nplus1.118
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -930,7 +782,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.125
+# name: TestInsight.test_listing_insights_does_not_nplus1.119
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -976,7 +828,20 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.126
+# name: TestInsight.test_listing_insights_does_not_nplus1.12
+ '''
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_dashboardtile"
+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
+ WHERE (NOT ("posthog_dashboardtile"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL)
+ AND NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboardtile"."dashboard_id" = 99999
+ AND NOT ("posthog_dashboardtile"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL))
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.120
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -1022,7 +887,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.127
+# name: TestInsight.test_listing_insights_does_not_nplus1.121
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1161,7 +1026,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.128
+# name: TestInsight.test_listing_insights_does_not_nplus1.122
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1216,7 +1081,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.129
+# name: TestInsight.test_listing_insights_does_not_nplus1.123
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -1239,40 +1104,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.13
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.130
+# name: TestInsight.test_listing_insights_does_not_nplus1.124
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -1325,7 +1157,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.131
+# name: TestInsight.test_listing_insights_does_not_nplus1.125
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -1345,7 +1177,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.132
+# name: TestInsight.test_listing_insights_does_not_nplus1.126
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -1358,7 +1190,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.133
+# name: TestInsight.test_listing_insights_does_not_nplus1.127
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -1371,7 +1203,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.134
+# name: TestInsight.test_listing_insights_does_not_nplus1.128
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -1388,7 +1220,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -1404,7 +1235,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.135
+# name: TestInsight.test_listing_insights_does_not_nplus1.129
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1503,7 +1334,39 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.136
+# name: TestInsight.test_listing_insights_does_not_nplus1.13
+ '''
+ SELECT "posthog_dashboard"."id",
+ "posthog_dashboard"."name",
+ "posthog_dashboard"."description",
+ "posthog_dashboard"."team_id",
+ "posthog_dashboard"."pinned",
+ "posthog_dashboard"."created_at",
+ "posthog_dashboard"."created_by_id",
+ "posthog_dashboard"."deleted",
+ "posthog_dashboard"."last_accessed_at",
+ "posthog_dashboard"."last_refresh",
+ "posthog_dashboard"."filters",
+ "posthog_dashboard"."variables",
+ "posthog_dashboard"."breakdown_colors",
+ "posthog_dashboard"."data_color_theme_id",
+ "posthog_dashboard"."creation_mode",
+ "posthog_dashboard"."quick_filter_ids",
+ "posthog_dashboard"."customization",
+ "posthog_dashboard"."deprecated_tags",
+ "posthog_dashboard"."tags",
+ "posthog_dashboard"."share_token",
+ "posthog_dashboard"."is_shared"
+ FROM "posthog_dashboard"
+ WHERE (NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboard"."id" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.130
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -1549,7 +1412,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.137
+# name: TestInsight.test_listing_insights_does_not_nplus1.131
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -1648,7 +1511,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.138
+# name: TestInsight.test_listing_insights_does_not_nplus1.132
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -1673,7 +1536,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.139
+# name: TestInsight.test_listing_insights_does_not_nplus1.133
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -1691,106 +1554,7 @@
UPDATE
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.14
- '''
- SELECT "posthog_team"."id",
- "posthog_team"."uuid",
- "posthog_team"."organization_id",
- "posthog_team"."parent_team_id",
- "posthog_team"."project_id",
- "posthog_team"."api_token",
- "posthog_team"."app_urls",
- "posthog_team"."name",
- "posthog_team"."slack_incoming_webhook",
- "posthog_team"."created_at",
- "posthog_team"."updated_at",
- "posthog_team"."anonymize_ips",
- "posthog_team"."completed_snippet_onboarding",
- "posthog_team"."has_completed_onboarding_for",
- "posthog_team"."onboarding_tasks",
- "posthog_team"."ingested_event",
- "posthog_team"."ingested_production_event",
- "posthog_team"."ingested_production_event_last_checked_at",
- "posthog_team"."person_processing_opt_out",
- "posthog_team"."secret_api_token",
- "posthog_team"."secret_api_token_backup",
- "posthog_team"."session_recording_opt_in",
- "posthog_team"."session_recording_sample_rate",
- "posthog_team"."session_recording_minimum_duration_milliseconds",
- "posthog_team"."session_recording_linked_flag",
- "posthog_team"."session_recording_network_payload_capture_config",
- "posthog_team"."session_recording_masking_config",
- "posthog_team"."session_recording_url_trigger_config",
- "posthog_team"."session_recording_url_blocklist_config",
- "posthog_team"."session_recording_event_trigger_config",
- "posthog_team"."session_recording_trigger_match_type_config",
- "posthog_team"."session_recording_trigger_groups",
- "posthog_team"."session_replay_config",
- "posthog_team"."session_recording_retention_period",
- "posthog_team"."event_retention_months",
- "posthog_team"."conversations_enabled",
- "posthog_team"."conversations_settings",
- "posthog_team"."proactive_tasks_enabled",
- "posthog_team"."survey_config",
- "posthog_team"."surveys_opt_in",
- "posthog_team"."product_tours_opt_in",
- "posthog_team"."capture_console_log_opt_in",
- "posthog_team"."capture_performance_opt_in",
- "posthog_team"."capture_dead_clicks",
- "posthog_team"."autocapture_opt_out",
- "posthog_team"."autocapture_web_vitals_opt_in",
- "posthog_team"."autocapture_web_vitals_allowed_metrics",
- "posthog_team"."autocapture_exceptions_opt_in",
- "posthog_team"."autocapture_exceptions_errors_to_ignore",
- "posthog_team"."logs_settings",
- "posthog_team"."llm_gateway_enabled_at",
- "posthog_team"."llm_gateway_revoked_at",
- "posthog_team"."llm_gateway_overspend_allowance_usd",
- "posthog_team"."heatmaps_opt_in",
- "posthog_team"."receive_org_level_activity_logs",
- "posthog_team"."web_analytics_pre_aggregated_tables_enabled",
- "posthog_team"."web_analytics_pre_aggregated_tables_version",
- "posthog_team"."flags_persistence_default",
- "posthog_team"."feature_flag_confirmation_enabled",
- "posthog_team"."feature_flag_confirmation_message",
- "posthog_team"."default_evaluation_environments_enabled",
- "posthog_team"."require_evaluation_environment_tags",
- "posthog_team"."default_evaluation_contexts_enabled",
- "posthog_team"."require_evaluation_contexts",
- "posthog_team"."session_recording_version",
- "posthog_team"."signup_token",
- "posthog_team"."is_demo",
- "posthog_team"."access_control",
- "posthog_team"."week_start_day",
- "posthog_team"."inject_web_apps",
- "posthog_team"."test_account_filters",
- "posthog_team"."test_account_filters_default_checked",
- "posthog_team"."path_cleaning_filters",
- "posthog_team"."timezone",
- "posthog_team"."data_attributes",
- "posthog_team"."person_display_name_properties",
- "posthog_team"."live_events_columns",
- "posthog_team"."recording_domains",
- "posthog_team"."human_friendly_comparison_periods",
- "posthog_team"."cookieless_server_hash_mode",
- "posthog_team"."primary_dashboard_id",
- "posthog_team"."default_data_theme",
- "posthog_team"."extra_settings",
- "posthog_team"."modifiers",
- "posthog_team"."correlation_config",
- "posthog_team"."session_recording_retention_period_days",
- "posthog_team"."external_data_workspace_id",
- "posthog_team"."external_data_workspace_last_synced_at",
- "posthog_team"."api_query_rate_limit",
- "posthog_team"."drop_events_older_than",
- "posthog_team"."base_currency",
- "posthog_team"."business_model"
- FROM "posthog_team"
- WHERE "posthog_team"."id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.140
+# name: TestInsight.test_listing_insights_does_not_nplus1.134
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -1819,7 +1583,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.141
+# name: TestInsight.test_listing_insights_does_not_nplus1.135
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -1848,7 +1612,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.142
+# name: TestInsight.test_listing_insights_does_not_nplus1.136
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -1868,7 +1632,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.143
+# name: TestInsight.test_listing_insights_does_not_nplus1.137
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -1881,7 +1645,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.144
+# name: TestInsight.test_listing_insights_does_not_nplus1.138
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -1897,7 +1661,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.145
+# name: TestInsight.test_listing_insights_does_not_nplus1.139
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -1914,113 +1678,122 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.146
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.147
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.148
- '''
- SELECT "posthog_tag"."name" AS "tag__name"
- FROM "posthog_taggeditem"
- INNER JOIN "posthog_tag" ON ("posthog_taggeditem"."tag_id" = "posthog_tag"."id")
- WHERE ("posthog_taggeditem"."content_type_id" = 99999
- AND "posthog_taggeditem"."object_id" = 99999)
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.149
- '''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_dashboarditem"
- WHERE NOT ("posthog_dashboarditem"."deleted")
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.15
+# name: TestInsight.test_listing_insights_does_not_nplus1.14
'''
- SELECT "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ SELECT "posthog_team"."id",
+ "posthog_team"."uuid",
+ "posthog_team"."organization_id",
+ "posthog_team"."parent_team_id",
+ "posthog_team"."project_id",
+ "posthog_team"."api_token",
+ "posthog_team"."app_urls",
+ "posthog_team"."name",
+ "posthog_team"."slack_incoming_webhook",
+ "posthog_team"."created_at",
+ "posthog_team"."updated_at",
+ "posthog_team"."anonymize_ips",
+ "posthog_team"."completed_snippet_onboarding",
+ "posthog_team"."has_completed_onboarding_for",
+ "posthog_team"."onboarding_tasks",
+ "posthog_team"."ingested_event",
+ "posthog_team"."ingested_production_event",
+ "posthog_team"."ingested_production_event_last_checked_at",
+ "posthog_team"."person_processing_opt_out",
+ "posthog_team"."secret_api_token",
+ "posthog_team"."secret_api_token_backup",
+ "posthog_team"."session_recording_opt_in",
+ "posthog_team"."session_recording_sample_rate",
+ "posthog_team"."session_recording_minimum_duration_milliseconds",
+ "posthog_team"."session_recording_linked_flag",
+ "posthog_team"."session_recording_network_payload_capture_config",
+ "posthog_team"."session_recording_masking_config",
+ "posthog_team"."session_recording_url_trigger_config",
+ "posthog_team"."session_recording_url_blocklist_config",
+ "posthog_team"."session_recording_event_trigger_config",
+ "posthog_team"."session_recording_trigger_match_type_config",
+ "posthog_team"."session_recording_trigger_groups",
+ "posthog_team"."session_replay_config",
+ "posthog_team"."session_recording_retention_period",
+ "posthog_team"."event_retention_months",
+ "posthog_team"."conversations_enabled",
+ "posthog_team"."conversations_settings",
+ "posthog_team"."proactive_tasks_enabled",
+ "posthog_team"."survey_config",
+ "posthog_team"."surveys_opt_in",
+ "posthog_team"."product_tours_opt_in",
+ "posthog_team"."capture_console_log_opt_in",
+ "posthog_team"."capture_performance_opt_in",
+ "posthog_team"."capture_dead_clicks",
+ "posthog_team"."autocapture_opt_out",
+ "posthog_team"."autocapture_web_vitals_opt_in",
+ "posthog_team"."autocapture_web_vitals_allowed_metrics",
+ "posthog_team"."autocapture_exceptions_opt_in",
+ "posthog_team"."autocapture_exceptions_errors_to_ignore",
+ "posthog_team"."logs_settings",
+ "posthog_team"."llm_gateway_enabled_at",
+ "posthog_team"."llm_gateway_revoked_at",
+ "posthog_team"."llm_gateway_overspend_allowance_usd",
+ "posthog_team"."heatmaps_opt_in",
+ "posthog_team"."receive_org_level_activity_logs",
+ "posthog_team"."web_analytics_pre_aggregated_tables_enabled",
+ "posthog_team"."web_analytics_pre_aggregated_tables_version",
+ "posthog_team"."flags_persistence_default",
+ "posthog_team"."feature_flag_confirmation_enabled",
+ "posthog_team"."feature_flag_confirmation_message",
+ "posthog_team"."default_evaluation_environments_enabled",
+ "posthog_team"."require_evaluation_environment_tags",
+ "posthog_team"."default_evaluation_contexts_enabled",
+ "posthog_team"."require_evaluation_contexts",
+ "posthog_team"."session_recording_version",
+ "posthog_team"."signup_token",
+ "posthog_team"."is_demo",
+ "posthog_team"."access_control",
+ "posthog_team"."week_start_day",
+ "posthog_team"."inject_web_apps",
+ "posthog_team"."test_account_filters",
+ "posthog_team"."test_account_filters_default_checked",
+ "posthog_team"."path_cleaning_filters",
+ "posthog_team"."timezone",
+ "posthog_team"."data_attributes",
+ "posthog_team"."person_display_name_properties",
+ "posthog_team"."live_events_columns",
+ "posthog_team"."recording_domains",
+ "posthog_team"."human_friendly_comparison_periods",
+ "posthog_team"."cookieless_server_hash_mode",
+ "posthog_team"."primary_dashboard_id",
+ "posthog_team"."default_data_theme",
+ "posthog_team"."extra_settings",
+ "posthog_team"."modifiers",
+ "posthog_team"."correlation_config",
+ "posthog_team"."session_recording_retention_period_days",
+ "posthog_team"."external_data_workspace_id",
+ "posthog_team"."external_data_workspace_last_synced_at",
+ "posthog_team"."api_query_rate_limit",
+ "posthog_team"."drop_events_older_than",
+ "posthog_team"."base_currency",
+ "posthog_team"."business_model"
+ FROM "posthog_team"
+ WHERE "posthog_team"."id" = 99999
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.150
+# name: TestInsight.test_listing_insights_does_not_nplus1.140
+ '''
+ SELECT "posthog_tag"."name" AS "tag__name"
+ FROM "posthog_taggeditem"
+ INNER JOIN "posthog_tag" ON ("posthog_taggeditem"."tag_id" = "posthog_tag"."id")
+ WHERE ("posthog_taggeditem"."content_type_id" = 99999
+ AND "posthog_taggeditem"."object_id" = 99999)
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.141
+ '''
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_dashboarditem"
+ WHERE NOT ("posthog_dashboarditem"."deleted")
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.142
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -2066,7 +1839,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.151
+# name: TestInsight.test_listing_insights_does_not_nplus1.143
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -2112,7 +1885,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.152
+# name: TestInsight.test_listing_insights_does_not_nplus1.144
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -2251,7 +2024,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.153
+# name: TestInsight.test_listing_insights_does_not_nplus1.145
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -2306,7 +2079,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.154
+# name: TestInsight.test_listing_insights_does_not_nplus1.146
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -2329,7 +2102,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.155
+# name: TestInsight.test_listing_insights_does_not_nplus1.147
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -2382,7 +2155,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.156
+# name: TestInsight.test_listing_insights_does_not_nplus1.148
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboarditem"
@@ -2391,7 +2164,7 @@
AND NOT ("posthog_dashboarditem"."deleted"))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.157
+# name: TestInsight.test_listing_insights_does_not_nplus1.149
'''
SELECT "posthog_dashboarditem"."id",
"posthog_dashboarditem"."name",
@@ -2578,7 +2351,53 @@
LIMIT 100
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.158
+# name: TestInsight.test_listing_insights_does_not_nplus1.15
+ '''
+ SELECT "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_organization"
+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ LIMIT 21
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.150
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -2596,7 +2415,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.159
+# name: TestInsight.test_listing_insights_does_not_nplus1.151
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -2613,106 +2432,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.16
- '''
- SELECT "posthog_team"."id",
- "posthog_team"."uuid",
- "posthog_team"."organization_id",
- "posthog_team"."parent_team_id",
- "posthog_team"."project_id",
- "posthog_team"."api_token",
- "posthog_team"."app_urls",
- "posthog_team"."name",
- "posthog_team"."slack_incoming_webhook",
- "posthog_team"."created_at",
- "posthog_team"."updated_at",
- "posthog_team"."anonymize_ips",
- "posthog_team"."completed_snippet_onboarding",
- "posthog_team"."has_completed_onboarding_for",
- "posthog_team"."onboarding_tasks",
- "posthog_team"."ingested_event",
- "posthog_team"."ingested_production_event",
- "posthog_team"."ingested_production_event_last_checked_at",
- "posthog_team"."person_processing_opt_out",
- "posthog_team"."secret_api_token",
- "posthog_team"."secret_api_token_backup",
- "posthog_team"."session_recording_opt_in",
- "posthog_team"."session_recording_sample_rate",
- "posthog_team"."session_recording_minimum_duration_milliseconds",
- "posthog_team"."session_recording_linked_flag",
- "posthog_team"."session_recording_network_payload_capture_config",
- "posthog_team"."session_recording_masking_config",
- "posthog_team"."session_recording_url_trigger_config",
- "posthog_team"."session_recording_url_blocklist_config",
- "posthog_team"."session_recording_event_trigger_config",
- "posthog_team"."session_recording_trigger_match_type_config",
- "posthog_team"."session_recording_trigger_groups",
- "posthog_team"."session_replay_config",
- "posthog_team"."session_recording_retention_period",
- "posthog_team"."event_retention_months",
- "posthog_team"."conversations_enabled",
- "posthog_team"."conversations_settings",
- "posthog_team"."proactive_tasks_enabled",
- "posthog_team"."survey_config",
- "posthog_team"."surveys_opt_in",
- "posthog_team"."product_tours_opt_in",
- "posthog_team"."capture_console_log_opt_in",
- "posthog_team"."capture_performance_opt_in",
- "posthog_team"."capture_dead_clicks",
- "posthog_team"."autocapture_opt_out",
- "posthog_team"."autocapture_web_vitals_opt_in",
- "posthog_team"."autocapture_web_vitals_allowed_metrics",
- "posthog_team"."autocapture_exceptions_opt_in",
- "posthog_team"."autocapture_exceptions_errors_to_ignore",
- "posthog_team"."logs_settings",
- "posthog_team"."llm_gateway_enabled_at",
- "posthog_team"."llm_gateway_revoked_at",
- "posthog_team"."llm_gateway_overspend_allowance_usd",
- "posthog_team"."heatmaps_opt_in",
- "posthog_team"."receive_org_level_activity_logs",
- "posthog_team"."web_analytics_pre_aggregated_tables_enabled",
- "posthog_team"."web_analytics_pre_aggregated_tables_version",
- "posthog_team"."flags_persistence_default",
- "posthog_team"."feature_flag_confirmation_enabled",
- "posthog_team"."feature_flag_confirmation_message",
- "posthog_team"."default_evaluation_environments_enabled",
- "posthog_team"."require_evaluation_environment_tags",
- "posthog_team"."default_evaluation_contexts_enabled",
- "posthog_team"."require_evaluation_contexts",
- "posthog_team"."session_recording_version",
- "posthog_team"."signup_token",
- "posthog_team"."is_demo",
- "posthog_team"."access_control",
- "posthog_team"."week_start_day",
- "posthog_team"."inject_web_apps",
- "posthog_team"."test_account_filters",
- "posthog_team"."test_account_filters_default_checked",
- "posthog_team"."path_cleaning_filters",
- "posthog_team"."timezone",
- "posthog_team"."data_attributes",
- "posthog_team"."person_display_name_properties",
- "posthog_team"."live_events_columns",
- "posthog_team"."recording_domains",
- "posthog_team"."human_friendly_comparison_periods",
- "posthog_team"."cookieless_server_hash_mode",
- "posthog_team"."primary_dashboard_id",
- "posthog_team"."default_data_theme",
- "posthog_team"."extra_settings",
- "posthog_team"."modifiers",
- "posthog_team"."correlation_config",
- "posthog_team"."session_recording_retention_period_days",
- "posthog_team"."external_data_workspace_id",
- "posthog_team"."external_data_workspace_last_synced_at",
- "posthog_team"."api_query_rate_limit",
- "posthog_team"."drop_events_older_than",
- "posthog_team"."base_currency",
- "posthog_team"."business_model"
- FROM "posthog_team"
- WHERE "posthog_team"."id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.160
+# name: TestInsight.test_listing_insights_does_not_nplus1.152
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -2733,7 +2453,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.161
+# name: TestInsight.test_listing_insights_does_not_nplus1.153
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -2746,7 +2466,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.162
+# name: TestInsight.test_listing_insights_does_not_nplus1.154
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -2760,7 +2480,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.163
+# name: TestInsight.test_listing_insights_does_not_nplus1.155
'''
SELECT "posthog_team"."id" AS "id"
FROM "posthog_team"
@@ -2768,7 +2488,7 @@
AND "posthog_team"."receive_org_level_activity_logs")
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.164
+# name: TestInsight.test_listing_insights_does_not_nplus1.156
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -2793,7 +2513,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.165
+# name: TestInsight.test_listing_insights_does_not_nplus1.157
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -2839,7 +2559,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.166
+# name: TestInsight.test_listing_insights_does_not_nplus1.158
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -2880,12 +2600,151 @@
"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_organization"
+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ LIMIT 21
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.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"."business_model",
+ "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_team"
+ INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
+ WHERE "posthog_team"."id" = 99999
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.167
+# name: TestInsight.test_listing_insights_does_not_nplus1.16
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -2978,53 +2837,13 @@
"posthog_team"."api_query_rate_limit",
"posthog_team"."drop_events_older_than",
"posthog_team"."base_currency",
- "posthog_team"."business_model",
- "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
+ "posthog_team"."business_model"
FROM "posthog_team"
- INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
WHERE "posthog_team"."id" = 99999
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.168
+# name: TestInsight.test_listing_insights_does_not_nplus1.160
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -3079,7 +2898,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.169
+# name: TestInsight.test_listing_insights_does_not_nplus1.161
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -3102,32 +2921,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.17
- '''
- SELECT "posthog_filesystem"."team_id",
- "posthog_filesystem"."id",
- "posthog_filesystem"."path",
- "posthog_filesystem"."depth",
- "posthog_filesystem"."type",
- "posthog_filesystem"."ref",
- "posthog_filesystem"."href",
- "posthog_filesystem"."shortcut",
- "posthog_filesystem"."meta",
- "posthog_filesystem"."created_at",
- "posthog_filesystem"."created_by_id",
- "posthog_filesystem"."surface",
- "posthog_filesystem"."project_id"
- FROM "posthog_filesystem"
- WHERE (("posthog_filesystem"."surface" IS NULL
- OR "posthog_filesystem"."surface" = 'web')
- AND "posthog_filesystem"."ref" = '0001'
- AND "posthog_filesystem"."team_id" = 99999
- AND "posthog_filesystem"."type" = 'insight'
- AND NOT ("posthog_filesystem"."shortcut"
- AND "posthog_filesystem"."shortcut" IS NOT NULL))
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.170
+# name: TestInsight.test_listing_insights_does_not_nplus1.162
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -3180,7 +2974,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.171
+# name: TestInsight.test_listing_insights_does_not_nplus1.163
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -3200,7 +2994,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.172
+# name: TestInsight.test_listing_insights_does_not_nplus1.164
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -3213,7 +3007,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.173
+# name: TestInsight.test_listing_insights_does_not_nplus1.165
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -3226,7 +3020,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.174
+# name: TestInsight.test_listing_insights_does_not_nplus1.166
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -3243,7 +3037,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -3259,7 +3052,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.175
+# name: TestInsight.test_listing_insights_does_not_nplus1.167
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -3358,7 +3151,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.176
+# name: TestInsight.test_listing_insights_does_not_nplus1.168
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -3404,7 +3197,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.177
+# name: TestInsight.test_listing_insights_does_not_nplus1.169
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -3503,7 +3296,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.178
+# name: TestInsight.test_listing_insights_does_not_nplus1.17
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -3528,25 +3321,32 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.179
+# name: TestInsight.test_listing_insights_does_not_nplus1.170
'''
- SELECT "posthog_insightviewed"."id",
- "posthog_insightviewed"."team_id",
- "posthog_insightviewed"."user_id",
- "posthog_insightviewed"."insight_id",
- "posthog_insightviewed"."last_viewed_at",
- "posthog_insightviewed"."source",
- "posthog_insightviewed"."dashboard_id"
- FROM "posthog_insightviewed"
- WHERE ("posthog_insightviewed"."insight_id" = 99999
- AND "posthog_insightviewed"."team_id" = 99999
- AND "posthog_insightviewed"."user_id" = 99999)
- LIMIT 21
- FOR
- UPDATE
+ SELECT "posthog_filesystem"."team_id",
+ "posthog_filesystem"."id",
+ "posthog_filesystem"."path",
+ "posthog_filesystem"."depth",
+ "posthog_filesystem"."type",
+ "posthog_filesystem"."ref",
+ "posthog_filesystem"."href",
+ "posthog_filesystem"."shortcut",
+ "posthog_filesystem"."meta",
+ "posthog_filesystem"."created_at",
+ "posthog_filesystem"."created_by_id",
+ "posthog_filesystem"."surface",
+ "posthog_filesystem"."project_id"
+ FROM "posthog_filesystem"
+ WHERE (("posthog_filesystem"."surface" IS NULL
+ OR "posthog_filesystem"."surface" = 'web')
+ AND "posthog_filesystem"."ref" = '0001'
+ AND "posthog_filesystem"."team_id" = 99999
+ AND "posthog_filesystem"."type" = 'insight'
+ AND NOT ("posthog_filesystem"."shortcut"
+ AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.18
+# name: TestInsight.test_listing_insights_does_not_nplus1.171
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -3564,7 +3364,7 @@
UPDATE
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.180
+# name: TestInsight.test_listing_insights_does_not_nplus1.172
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -3593,7 +3393,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.181
+# name: TestInsight.test_listing_insights_does_not_nplus1.173
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -3622,7 +3422,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.182
+# name: TestInsight.test_listing_insights_does_not_nplus1.174
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -3642,7 +3442,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.183
+# name: TestInsight.test_listing_insights_does_not_nplus1.175
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -3655,7 +3455,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.184
+# name: TestInsight.test_listing_insights_does_not_nplus1.176
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -3671,7 +3471,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.185
+# name: TestInsight.test_listing_insights_does_not_nplus1.177
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -3688,51 +3488,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.186
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.187
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.188
+# name: TestInsight.test_listing_insights_does_not_nplus1.178
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -3741,43 +3497,32 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.189
+# name: TestInsight.test_listing_insights_does_not_nplus1.179
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboarditem"
WHERE NOT ("posthog_dashboarditem"."deleted")
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.19
+# name: TestInsight.test_listing_insights_does_not_nplus1.18
'''
- SELECT "posthog_dashboardtile"."id",
- "posthog_dashboardtile"."dashboard_id",
- "posthog_dashboardtile"."insight_id",
- "posthog_dashboardtile"."text_id",
- "posthog_dashboardtile"."button_tile_id",
- "posthog_dashboardtile"."widget_id",
- "posthog_dashboardtile"."team_id",
- "posthog_dashboardtile"."layouts",
- "posthog_dashboardtile"."color",
- "posthog_dashboardtile"."filters_hash",
- "posthog_dashboardtile"."last_refresh",
- "posthog_dashboardtile"."refreshing",
- "posthog_dashboardtile"."refresh_attempt",
- "posthog_dashboardtile"."filters_overrides",
- "posthog_dashboardtile"."show_description",
- "posthog_dashboardtile"."transparent_background",
- "posthog_dashboardtile"."group_key",
- "posthog_dashboardtile"."badge",
- "posthog_dashboardtile"."deleted"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
+ SELECT "posthog_insightviewed"."id",
+ "posthog_insightviewed"."team_id",
+ "posthog_insightviewed"."user_id",
+ "posthog_insightviewed"."insight_id",
+ "posthog_insightviewed"."last_viewed_at",
+ "posthog_insightviewed"."source",
+ "posthog_insightviewed"."dashboard_id"
+ FROM "posthog_insightviewed"
+ WHERE ("posthog_insightviewed"."insight_id" = 99999
+ AND "posthog_insightviewed"."team_id" = 99999
+ AND "posthog_insightviewed"."user_id" = 99999)
+ LIMIT 21
+ FOR
+ UPDATE
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.190
+# name: TestInsight.test_listing_insights_does_not_nplus1.180
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -3823,7 +3568,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.191
+# name: TestInsight.test_listing_insights_does_not_nplus1.181
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -3869,7 +3614,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.192
+# name: TestInsight.test_listing_insights_does_not_nplus1.182
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -4008,7 +3753,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.193
+# name: TestInsight.test_listing_insights_does_not_nplus1.183
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -4063,7 +3808,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.194
+# name: TestInsight.test_listing_insights_does_not_nplus1.184
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -4086,7 +3831,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.195
+# name: TestInsight.test_listing_insights_does_not_nplus1.185
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -4139,7 +3884,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.196
+# name: TestInsight.test_listing_insights_does_not_nplus1.186
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboarditem"
@@ -4148,7 +3893,7 @@
AND NOT ("posthog_dashboarditem"."deleted"))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.197
+# name: TestInsight.test_listing_insights_does_not_nplus1.187
'''
SELECT "posthog_dashboarditem"."id",
"posthog_dashboarditem"."name",
@@ -4335,7 +4080,7 @@
LIMIT 100
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.198
+# name: TestInsight.test_listing_insights_does_not_nplus1.188
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -4353,7 +4098,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.199
+# name: TestInsight.test_listing_insights_does_not_nplus1.189
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -4370,15 +4115,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.2
- '''
- SELECT "posthog_team"."id" AS "id"
- FROM "posthog_team"
- WHERE ("posthog_team"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_team"."receive_org_level_activity_logs")
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.20
+# name: TestInsight.test_listing_insights_does_not_nplus1.19
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -4407,7 +4144,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.200
+# name: TestInsight.test_listing_insights_does_not_nplus1.190
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -4428,6 +4165,43 @@
5 /* ... */))
'''
# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.2
+ '''
+ SELECT "posthog_team"."id" AS "id"
+ FROM "posthog_team"
+ WHERE ("posthog_team"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_team"."receive_org_level_activity_logs")
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.20
+ '''
+ SELECT "posthog_dashboardtile"."id",
+ "posthog_dashboardtile"."dashboard_id",
+ "posthog_dashboardtile"."insight_id",
+ "posthog_dashboardtile"."text_id",
+ "posthog_dashboardtile"."button_tile_id",
+ "posthog_dashboardtile"."widget_id",
+ "posthog_dashboardtile"."team_id",
+ "posthog_dashboardtile"."layouts",
+ "posthog_dashboardtile"."color",
+ "posthog_dashboardtile"."filters_hash",
+ "posthog_dashboardtile"."last_refresh",
+ "posthog_dashboardtile"."refreshing",
+ "posthog_dashboardtile"."refresh_attempt",
+ "posthog_dashboardtile"."filters_overrides",
+ "posthog_dashboardtile"."show_description",
+ "posthog_dashboardtile"."transparent_background",
+ "posthog_dashboardtile"."group_key",
+ "posthog_dashboardtile"."badge",
+ "posthog_dashboardtile"."deleted"
+ FROM "posthog_dashboardtile"
+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
+ WHERE (NOT ("posthog_dashboardtile"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL)
+ AND NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboardtile"."insight_id" = 99999)
+ '''
+# ---
# name: TestInsight.test_listing_insights_does_not_nplus1.21
'''
SELECT "posthog_insightvariable"."id",
@@ -4504,50 +4278,6 @@
'''
# ---
# name: TestInsight.test_listing_insights_does_not_nplus1.26
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.27
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.28
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -4556,39 +4286,14 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.29
+# name: TestInsight.test_listing_insights_does_not_nplus1.27
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboarditem"
WHERE NOT ("posthog_dashboarditem"."deleted")
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.3
- '''
- SELECT "posthog_filesystem"."team_id",
- "posthog_filesystem"."id",
- "posthog_filesystem"."path",
- "posthog_filesystem"."depth",
- "posthog_filesystem"."type",
- "posthog_filesystem"."ref",
- "posthog_filesystem"."href",
- "posthog_filesystem"."shortcut",
- "posthog_filesystem"."meta",
- "posthog_filesystem"."created_at",
- "posthog_filesystem"."created_by_id",
- "posthog_filesystem"."surface",
- "posthog_filesystem"."project_id"
- FROM "posthog_filesystem"
- WHERE (("posthog_filesystem"."surface" IS NULL
- OR "posthog_filesystem"."surface" = 'web')
- AND "posthog_filesystem"."ref" = '0001'
- AND "posthog_filesystem"."team_id" = 99999
- AND "posthog_filesystem"."type" = 'dashboard'
- AND NOT ("posthog_filesystem"."shortcut"
- AND "posthog_filesystem"."shortcut" IS NOT NULL))
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.30
+# name: TestInsight.test_listing_insights_does_not_nplus1.28
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -4634,7 +4339,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.31
+# name: TestInsight.test_listing_insights_does_not_nplus1.29
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -4680,7 +4385,32 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.32
+# name: TestInsight.test_listing_insights_does_not_nplus1.3
+ '''
+ SELECT "posthog_filesystem"."team_id",
+ "posthog_filesystem"."id",
+ "posthog_filesystem"."path",
+ "posthog_filesystem"."depth",
+ "posthog_filesystem"."type",
+ "posthog_filesystem"."ref",
+ "posthog_filesystem"."href",
+ "posthog_filesystem"."shortcut",
+ "posthog_filesystem"."meta",
+ "posthog_filesystem"."created_at",
+ "posthog_filesystem"."created_by_id",
+ "posthog_filesystem"."surface",
+ "posthog_filesystem"."project_id"
+ FROM "posthog_filesystem"
+ WHERE (("posthog_filesystem"."surface" IS NULL
+ OR "posthog_filesystem"."surface" = 'web')
+ AND "posthog_filesystem"."ref" = '0001'
+ AND "posthog_filesystem"."team_id" = 99999
+ AND "posthog_filesystem"."type" = 'dashboard'
+ AND NOT ("posthog_filesystem"."shortcut"
+ AND "posthog_filesystem"."shortcut" IS NOT NULL))
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.30
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -4819,7 +4549,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.33
+# name: TestInsight.test_listing_insights_does_not_nplus1.31
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -4874,7 +4604,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.34
+# name: TestInsight.test_listing_insights_does_not_nplus1.32
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -4897,7 +4627,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.35
+# name: TestInsight.test_listing_insights_does_not_nplus1.33
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -4950,7 +4680,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.36
+# name: TestInsight.test_listing_insights_does_not_nplus1.34
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboarditem"
@@ -4959,7 +4689,7 @@
AND NOT ("posthog_dashboarditem"."deleted"))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.37
+# name: TestInsight.test_listing_insights_does_not_nplus1.35
'''
SELECT "posthog_dashboarditem"."id",
"posthog_dashboarditem"."name",
@@ -5146,7 +4876,7 @@
LIMIT 100
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.38
+# name: TestInsight.test_listing_insights_does_not_nplus1.36
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -5164,7 +4894,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.39
+# name: TestInsight.test_listing_insights_does_not_nplus1.37
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -5181,6 +4911,40 @@
5 /* ... */))
'''
# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.38
+ '''
+ SELECT "posthog_taggeditem"."id",
+ "posthog_taggeditem"."tag_id",
+ "posthog_taggeditem"."content_type_id",
+ "posthog_taggeditem"."object_id",
+ "posthog_taggeditem"."object_uuid",
+ "posthog_taggeditem"."team_id",
+ "posthog_tag"."id",
+ "posthog_tag"."name",
+ "posthog_tag"."team_id"
+ FROM "posthog_taggeditem"
+ INNER JOIN "posthog_tag" ON ("posthog_taggeditem"."tag_id" = "posthog_tag"."id")
+ WHERE ("posthog_taggeditem"."content_type_id" = 99999
+ AND "posthog_taggeditem"."object_id" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.39
+ '''
+ SELECT "posthog_organizationmembership"."id",
+ "posthog_organizationmembership"."organization_id",
+ "posthog_organizationmembership"."user_id",
+ "posthog_organizationmembership"."level",
+ "posthog_organizationmembership"."joined_at",
+ "posthog_organizationmembership"."updated_at",
+ "posthog_organizationmembership"."invited_by_id"
+ FROM "posthog_organizationmembership"
+ WHERE "posthog_organizationmembership"."user_id" = 99999
+ '''
+# ---
# name: TestInsight.test_listing_insights_does_not_nplus1.4
'''
SELECT "posthog_user"."id",
@@ -5227,41 +4991,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.40
- '''
- SELECT "posthog_taggeditem"."id",
- "posthog_taggeditem"."tag_id",
- "posthog_taggeditem"."content_type_id",
- "posthog_taggeditem"."object_id",
- "posthog_taggeditem"."object_uuid",
- "posthog_taggeditem"."team_id",
- "posthog_tag"."id",
- "posthog_tag"."name",
- "posthog_tag"."team_id"
- FROM "posthog_taggeditem"
- INNER JOIN "posthog_tag" ON ("posthog_taggeditem"."tag_id" = "posthog_tag"."id")
- WHERE ("posthog_taggeditem"."content_type_id" = 99999
- AND "posthog_taggeditem"."object_id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.41
- '''
- SELECT "posthog_organizationmembership"."id",
- "posthog_organizationmembership"."organization_id",
- "posthog_organizationmembership"."user_id",
- "posthog_organizationmembership"."level",
- "posthog_organizationmembership"."joined_at",
- "posthog_organizationmembership"."updated_at",
- "posthog_organizationmembership"."invited_by_id"
- FROM "posthog_organizationmembership"
- WHERE "posthog_organizationmembership"."user_id" = 99999
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.42
+# name: TestInsight.test_listing_insights_does_not_nplus1.40
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -5275,7 +5005,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.43
+# name: TestInsight.test_listing_insights_does_not_nplus1.41
'''
SELECT "posthog_team"."id" AS "id"
FROM "posthog_team"
@@ -5283,7 +5013,7 @@
AND "posthog_team"."receive_org_level_activity_logs")
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.44
+# name: TestInsight.test_listing_insights_does_not_nplus1.42
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -5308,7 +5038,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.45
+# name: TestInsight.test_listing_insights_does_not_nplus1.43
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -5354,7 +5084,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.46
+# name: TestInsight.test_listing_insights_does_not_nplus1.44
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -5400,7 +5130,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.47
+# name: TestInsight.test_listing_insights_does_not_nplus1.45
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -5539,7 +5269,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.48
+# name: TestInsight.test_listing_insights_does_not_nplus1.46
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -5594,7 +5324,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.49
+# name: TestInsight.test_listing_insights_does_not_nplus1.47
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -5617,9 +5347,16 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.5
+# name: TestInsight.test_listing_insights_does_not_nplus1.48
'''
- 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",
@@ -5658,21 +5395,34 @@
"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: TestInsight.test_listing_insights_does_not_nplus1.50
+# name: TestInsight.test_listing_insights_does_not_nplus1.49
'''
- SELECT "posthog_organizationmembership"."id",
- "posthog_organizationmembership"."organization_id",
- "posthog_organizationmembership"."user_id",
- "posthog_organizationmembership"."level",
- "posthog_organizationmembership"."joined_at",
- "posthog_organizationmembership"."updated_at",
- "posthog_organizationmembership"."invited_by_id",
- "posthog_organization"."id",
+ SELECT "posthog_dashboard"."id" AS "id"
+ FROM "posthog_dashboard"
+ INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
+ WHERE (NOT ("posthog_dashboard"."deleted")
+ AND ("posthog_dashboard"."team_id" =
+ (SELECT U0."parent_team_id" AS "parent_team_id"
+ FROM "posthog_team" U0
+ WHERE U0."id" = 99999
+ LIMIT 1)
+ OR ("posthog_team"."parent_team_id" IS NULL
+ AND "posthog_dashboard"."team_id" = 99999))
+ AND "posthog_dashboard"."id" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.5
+ '''
+ SELECT "posthog_organization"."id",
"posthog_organization"."name",
"posthog_organization"."slug",
"posthog_organization"."logo_media_id",
@@ -5711,32 +5461,12 @@
"posthog_organization"."personalization",
"posthog_organization"."domain_whitelist",
"posthog_organization"."is_platform"
- FROM "posthog_organizationmembership"
- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
- WHERE "posthog_organizationmembership"."user_id" = 99999
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.51
- '''
- SELECT "posthog_dashboard"."id" AS "id"
- FROM "posthog_dashboard"
- INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND ("posthog_dashboard"."team_id" =
- (SELECT U0."parent_team_id" AS "parent_team_id"
- FROM "posthog_team" U0
- WHERE U0."id" = 99999
- LIMIT 1)
- OR ("posthog_team"."parent_team_id" IS NULL
- AND "posthog_dashboard"."team_id" = 99999))
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
+ FROM "posthog_organization"
+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.52
+# name: TestInsight.test_listing_insights_does_not_nplus1.50
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -5749,7 +5479,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.53
+# name: TestInsight.test_listing_insights_does_not_nplus1.51
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -5762,7 +5492,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.54
+# name: TestInsight.test_listing_insights_does_not_nplus1.52
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -5779,7 +5509,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -5795,7 +5524,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.55
+# name: TestInsight.test_listing_insights_does_not_nplus1.53
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -5894,7 +5623,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.56
+# name: TestInsight.test_listing_insights_does_not_nplus1.54
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -5940,7 +5669,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.57
+# name: TestInsight.test_listing_insights_does_not_nplus1.55
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -6039,7 +5768,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.58
+# name: TestInsight.test_listing_insights_does_not_nplus1.56
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -6064,7 +5793,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.59
+# name: TestInsight.test_listing_insights_does_not_nplus1.57
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -6082,6 +5811,64 @@
UPDATE
'''
# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.58
+ '''
+ SELECT "posthog_dashboardtile"."id",
+ "posthog_dashboardtile"."dashboard_id",
+ "posthog_dashboardtile"."insight_id",
+ "posthog_dashboardtile"."text_id",
+ "posthog_dashboardtile"."button_tile_id",
+ "posthog_dashboardtile"."widget_id",
+ "posthog_dashboardtile"."team_id",
+ "posthog_dashboardtile"."layouts",
+ "posthog_dashboardtile"."color",
+ "posthog_dashboardtile"."filters_hash",
+ "posthog_dashboardtile"."last_refresh",
+ "posthog_dashboardtile"."refreshing",
+ "posthog_dashboardtile"."refresh_attempt",
+ "posthog_dashboardtile"."filters_overrides",
+ "posthog_dashboardtile"."show_description",
+ "posthog_dashboardtile"."transparent_background",
+ "posthog_dashboardtile"."group_key",
+ "posthog_dashboardtile"."badge",
+ "posthog_dashboardtile"."deleted"
+ FROM "posthog_dashboardtile"
+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
+ WHERE (NOT ("posthog_dashboardtile"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL)
+ AND NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboardtile"."insight_id" = 99999)
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.59
+ '''
+ SELECT "posthog_dashboardtile"."id",
+ "posthog_dashboardtile"."dashboard_id",
+ "posthog_dashboardtile"."insight_id",
+ "posthog_dashboardtile"."text_id",
+ "posthog_dashboardtile"."button_tile_id",
+ "posthog_dashboardtile"."widget_id",
+ "posthog_dashboardtile"."team_id",
+ "posthog_dashboardtile"."layouts",
+ "posthog_dashboardtile"."color",
+ "posthog_dashboardtile"."filters_hash",
+ "posthog_dashboardtile"."last_refresh",
+ "posthog_dashboardtile"."refreshing",
+ "posthog_dashboardtile"."refresh_attempt",
+ "posthog_dashboardtile"."filters_overrides",
+ "posthog_dashboardtile"."show_description",
+ "posthog_dashboardtile"."transparent_background",
+ "posthog_dashboardtile"."group_key",
+ "posthog_dashboardtile"."badge",
+ "posthog_dashboardtile"."deleted"
+ FROM "posthog_dashboardtile"
+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
+ WHERE (NOT ("posthog_dashboardtile"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL)
+ AND NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboardtile"."insight_id" = 99999)
+ '''
+# ---
# name: TestInsight.test_listing_insights_does_not_nplus1.6
'''
SELECT "posthog_team"."id",
@@ -6184,102 +5971,44 @@
"posthog_organization"."updated_at",
"posthog_organization"."is_active",
"posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_team"
- INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
- WHERE "posthog_team"."id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.60
- '''
- SELECT "posthog_dashboardtile"."id",
- "posthog_dashboardtile"."dashboard_id",
- "posthog_dashboardtile"."insight_id",
- "posthog_dashboardtile"."text_id",
- "posthog_dashboardtile"."button_tile_id",
- "posthog_dashboardtile"."widget_id",
- "posthog_dashboardtile"."team_id",
- "posthog_dashboardtile"."layouts",
- "posthog_dashboardtile"."color",
- "posthog_dashboardtile"."filters_hash",
- "posthog_dashboardtile"."last_refresh",
- "posthog_dashboardtile"."refreshing",
- "posthog_dashboardtile"."refresh_attempt",
- "posthog_dashboardtile"."filters_overrides",
- "posthog_dashboardtile"."show_description",
- "posthog_dashboardtile"."transparent_background",
- "posthog_dashboardtile"."group_key",
- "posthog_dashboardtile"."badge",
- "posthog_dashboardtile"."deleted"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.61
- '''
- SELECT "posthog_dashboardtile"."id",
- "posthog_dashboardtile"."dashboard_id",
- "posthog_dashboardtile"."insight_id",
- "posthog_dashboardtile"."text_id",
- "posthog_dashboardtile"."button_tile_id",
- "posthog_dashboardtile"."widget_id",
- "posthog_dashboardtile"."team_id",
- "posthog_dashboardtile"."layouts",
- "posthog_dashboardtile"."color",
- "posthog_dashboardtile"."filters_hash",
- "posthog_dashboardtile"."last_refresh",
- "posthog_dashboardtile"."refreshing",
- "posthog_dashboardtile"."refresh_attempt",
- "posthog_dashboardtile"."filters_overrides",
- "posthog_dashboardtile"."show_description",
- "posthog_dashboardtile"."transparent_background",
- "posthog_dashboardtile"."group_key",
- "posthog_dashboardtile"."badge",
- "posthog_dashboardtile"."deleted"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_team"
+ INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
+ WHERE "posthog_team"."id" = 99999
+ LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.62
+# name: TestInsight.test_listing_insights_does_not_nplus1.60
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -6299,7 +6028,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.63
+# name: TestInsight.test_listing_insights_does_not_nplus1.61
'''
SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
"posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
@@ -6312,7 +6041,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.64
+# name: TestInsight.test_listing_insights_does_not_nplus1.62
'''
SELECT "posthog_teammarketinganalyticsconfig"."team_id",
"posthog_teammarketinganalyticsconfig"."attribution_window_days",
@@ -6328,7 +6057,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.65
+# name: TestInsight.test_listing_insights_does_not_nplus1.63
'''
SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
"customer_analytics_teamcustomeranalyticsconfig"."activity_event",
@@ -6345,51 +6074,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.66
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.67
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.68
+# name: TestInsight.test_listing_insights_does_not_nplus1.64
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -6398,69 +6083,14 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.69
+# name: TestInsight.test_listing_insights_does_not_nplus1.65
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboarditem"
WHERE NOT ("posthog_dashboarditem"."deleted")
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.7
- '''
- SELECT "posthog_organizationmembership"."id",
- "posthog_organizationmembership"."organization_id",
- "posthog_organizationmembership"."user_id",
- "posthog_organizationmembership"."level",
- "posthog_organizationmembership"."joined_at",
- "posthog_organizationmembership"."updated_at",
- "posthog_organizationmembership"."invited_by_id",
- "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organizationmembership"
- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_organizationmembership"."user_id" = 99999)
- LIMIT 21
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.70
+# name: TestInsight.test_listing_insights_does_not_nplus1.66
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -6506,7 +6136,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.71
+# name: TestInsight.test_listing_insights_does_not_nplus1.67
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -6552,7 +6182,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.72
+# name: TestInsight.test_listing_insights_does_not_nplus1.68
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -6691,7 +6321,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.73
+# name: TestInsight.test_listing_insights_does_not_nplus1.69
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -6746,7 +6376,62 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.74
+# name: TestInsight.test_listing_insights_does_not_nplus1.7
+ '''
+ SELECT "posthog_organizationmembership"."id",
+ "posthog_organizationmembership"."organization_id",
+ "posthog_organizationmembership"."user_id",
+ "posthog_organizationmembership"."level",
+ "posthog_organizationmembership"."joined_at",
+ "posthog_organizationmembership"."updated_at",
+ "posthog_organizationmembership"."invited_by_id",
+ "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_organizationmembership"
+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")
+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_organizationmembership"."user_id" = 99999)
+ LIMIT 21
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.70
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -6769,7 +6454,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.75
+# name: TestInsight.test_listing_insights_does_not_nplus1.71
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -6822,7 +6507,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.76
+# name: TestInsight.test_listing_insights_does_not_nplus1.72
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboarditem"
@@ -6831,7 +6516,7 @@
AND NOT ("posthog_dashboarditem"."deleted"))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.77
+# name: TestInsight.test_listing_insights_does_not_nplus1.73
'''
SELECT "posthog_dashboarditem"."id",
"posthog_dashboarditem"."name",
@@ -7018,7 +6703,7 @@
LIMIT 100
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.78
+# name: TestInsight.test_listing_insights_does_not_nplus1.74
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -7036,47 +6721,24 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.79
- '''
- SELECT "posthog_taggeditem"."id",
- "posthog_taggeditem"."tag_id",
- "posthog_taggeditem"."content_type_id",
- "posthog_taggeditem"."object_id",
- "posthog_taggeditem"."object_uuid",
- "posthog_taggeditem"."team_id"
- FROM "posthog_taggeditem"
- WHERE ("posthog_taggeditem"."content_type_id" = 99999
- AND "posthog_taggeditem"."object_id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.8
- '''
- SELECT "ee_accesscontrol"."id",
- "ee_accesscontrol"."team_id",
- "ee_accesscontrol"."access_level",
- "ee_accesscontrol"."resource",
- "ee_accesscontrol"."resource_id",
- "ee_accesscontrol"."organization_member_id",
- "ee_accesscontrol"."role_id",
- "ee_accesscontrol"."created_by_id",
- "ee_accesscontrol"."created_at",
- "ee_accesscontrol"."updated_at"
- FROM "ee_accesscontrol"
- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")
- WHERE (("ee_accesscontrol"."organization_member_id" IS NULL
- AND "ee_accesscontrol"."role_id" IS NULL
- AND "ee_accesscontrol"."team_id" = 99999)
- OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
- AND "posthog_organizationmembership"."user_id" = 99999
- AND "ee_accesscontrol"."role_id" IS NULL
- AND "ee_accesscontrol"."team_id" = 99999))
+# name: TestInsight.test_listing_insights_does_not_nplus1.75
+ '''
+ SELECT "posthog_taggeditem"."id",
+ "posthog_taggeditem"."tag_id",
+ "posthog_taggeditem"."content_type_id",
+ "posthog_taggeditem"."object_id",
+ "posthog_taggeditem"."object_uuid",
+ "posthog_taggeditem"."team_id"
+ FROM "posthog_taggeditem"
+ WHERE ("posthog_taggeditem"."content_type_id" = 99999
+ AND "posthog_taggeditem"."object_id" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.80
+# name: TestInsight.test_listing_insights_does_not_nplus1.76
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -7097,7 +6759,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.81
+# name: TestInsight.test_listing_insights_does_not_nplus1.77
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -7110,7 +6772,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.82
+# name: TestInsight.test_listing_insights_does_not_nplus1.78
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -7124,7 +6786,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.83
+# name: TestInsight.test_listing_insights_does_not_nplus1.79
'''
SELECT "posthog_team"."id" AS "id"
FROM "posthog_team"
@@ -7132,7 +6794,30 @@
AND "posthog_team"."receive_org_level_activity_logs")
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.84
+# name: TestInsight.test_listing_insights_does_not_nplus1.8
+ '''
+ SELECT "ee_accesscontrol"."id",
+ "ee_accesscontrol"."team_id",
+ "ee_accesscontrol"."access_level",
+ "ee_accesscontrol"."resource",
+ "ee_accesscontrol"."resource_id",
+ "ee_accesscontrol"."organization_member_id",
+ "ee_accesscontrol"."role_id",
+ "ee_accesscontrol"."created_by_id",
+ "ee_accesscontrol"."created_at",
+ "ee_accesscontrol"."updated_at"
+ FROM "ee_accesscontrol"
+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")
+ WHERE (("ee_accesscontrol"."organization_member_id" IS NULL
+ AND "ee_accesscontrol"."role_id" IS NULL
+ AND "ee_accesscontrol"."team_id" = 99999)
+ OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
+ AND "posthog_organizationmembership"."user_id" = 99999
+ AND "ee_accesscontrol"."role_id" IS NULL
+ AND "ee_accesscontrol"."team_id" = 99999))
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.80
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -7157,7 +6842,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.85
+# name: TestInsight.test_listing_insights_does_not_nplus1.81
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -7203,7 +6888,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.86
+# name: TestInsight.test_listing_insights_does_not_nplus1.82
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -7249,7 +6934,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.87
+# name: TestInsight.test_listing_insights_does_not_nplus1.83
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -7388,7 +7073,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.88
+# name: TestInsight.test_listing_insights_does_not_nplus1.84
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -7443,7 +7128,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.89
+# name: TestInsight.test_listing_insights_does_not_nplus1.85
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -7466,7 +7151,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.9
+# name: TestInsight.test_listing_insights_does_not_nplus1.86
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -7519,7 +7204,53 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.90
+# name: TestInsight.test_listing_insights_does_not_nplus1.87
+ '''
+ SELECT "posthog_dashboard"."id" AS "id"
+ FROM "posthog_dashboard"
+ INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
+ WHERE (NOT ("posthog_dashboard"."deleted")
+ AND ("posthog_dashboard"."team_id" =
+ (SELECT U0."parent_team_id" AS "parent_team_id"
+ FROM "posthog_team" U0
+ WHERE U0."id" = 99999
+ LIMIT 1)
+ OR ("posthog_team"."parent_team_id" IS NULL
+ AND "posthog_dashboard"."team_id" = 99999))
+ AND "posthog_dashboard"."id" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.88
+ '''
+ SELECT "posthog_dashboard"."id" AS "id",
+ "posthog_dashboard"."name" AS "name"
+ FROM "posthog_dashboard"
+ WHERE (NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboard"."id" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.89
+ '''
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_dashboardtile"
+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
+ WHERE (NOT ("posthog_dashboardtile"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL)
+ AND NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboardtile"."dashboard_id" = 99999
+ AND NOT ("posthog_dashboardtile"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL))
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.9
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -7572,53 +7303,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.91
- '''
- SELECT "posthog_dashboard"."id" AS "id"
- FROM "posthog_dashboard"
- INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND ("posthog_dashboard"."team_id" =
- (SELECT U0."parent_team_id" AS "parent_team_id"
- FROM "posthog_team" U0
- WHERE U0."id" = 99999
- LIMIT 1)
- OR ("posthog_team"."parent_team_id" IS NULL
- AND "posthog_dashboard"."team_id" = 99999))
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.92
- '''
- SELECT "posthog_dashboard"."id" AS "id",
- "posthog_dashboard"."name" AS "name"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.93
- '''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."dashboard_id" = 99999
- AND NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL))
- '''
-# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.94
+# name: TestInsight.test_listing_insights_does_not_nplus1.90
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -7635,7 +7320,6 @@
"posthog_dashboard"."breakdown_colors",
"posthog_dashboard"."data_color_theme_id",
"posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
"posthog_dashboard"."quick_filter_ids",
"posthog_dashboard"."customization",
"posthog_dashboard"."deprecated_tags",
@@ -7651,7 +7335,7 @@
5 /* ... */))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.95
+# name: TestInsight.test_listing_insights_does_not_nplus1.91
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -7750,7 +7434,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.96
+# name: TestInsight.test_listing_insights_does_not_nplus1.92
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -7796,7 +7480,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.97
+# name: TestInsight.test_listing_insights_does_not_nplus1.93
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -7895,7 +7579,7 @@
LIMIT 21
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.98
+# name: TestInsight.test_listing_insights_does_not_nplus1.94
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -7920,7 +7604,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestInsight.test_listing_insights_does_not_nplus1.99
+# name: TestInsight.test_listing_insights_does_not_nplus1.95
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -7938,3 +7622,94 @@
UPDATE
'''
# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.96
+ '''
+ SELECT "posthog_dashboardtile"."id",
+ "posthog_dashboardtile"."dashboard_id",
+ "posthog_dashboardtile"."insight_id",
+ "posthog_dashboardtile"."text_id",
+ "posthog_dashboardtile"."button_tile_id",
+ "posthog_dashboardtile"."widget_id",
+ "posthog_dashboardtile"."team_id",
+ "posthog_dashboardtile"."layouts",
+ "posthog_dashboardtile"."color",
+ "posthog_dashboardtile"."filters_hash",
+ "posthog_dashboardtile"."last_refresh",
+ "posthog_dashboardtile"."refreshing",
+ "posthog_dashboardtile"."refresh_attempt",
+ "posthog_dashboardtile"."filters_overrides",
+ "posthog_dashboardtile"."show_description",
+ "posthog_dashboardtile"."transparent_background",
+ "posthog_dashboardtile"."group_key",
+ "posthog_dashboardtile"."badge",
+ "posthog_dashboardtile"."deleted"
+ FROM "posthog_dashboardtile"
+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
+ WHERE (NOT ("posthog_dashboardtile"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL)
+ AND NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboardtile"."insight_id" = 99999)
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.97
+ '''
+ SELECT "posthog_dashboardtile"."id",
+ "posthog_dashboardtile"."dashboard_id",
+ "posthog_dashboardtile"."insight_id",
+ "posthog_dashboardtile"."text_id",
+ "posthog_dashboardtile"."button_tile_id",
+ "posthog_dashboardtile"."widget_id",
+ "posthog_dashboardtile"."team_id",
+ "posthog_dashboardtile"."layouts",
+ "posthog_dashboardtile"."color",
+ "posthog_dashboardtile"."filters_hash",
+ "posthog_dashboardtile"."last_refresh",
+ "posthog_dashboardtile"."refreshing",
+ "posthog_dashboardtile"."refresh_attempt",
+ "posthog_dashboardtile"."filters_overrides",
+ "posthog_dashboardtile"."show_description",
+ "posthog_dashboardtile"."transparent_background",
+ "posthog_dashboardtile"."group_key",
+ "posthog_dashboardtile"."badge",
+ "posthog_dashboardtile"."deleted"
+ FROM "posthog_dashboardtile"
+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
+ WHERE (NOT ("posthog_dashboardtile"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL)
+ AND NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboardtile"."insight_id" = 99999)
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.98
+ '''
+ SELECT "posthog_insightvariable"."id",
+ "posthog_insightvariable"."name",
+ "posthog_insightvariable"."code_name",
+ "posthog_insightvariable"."type",
+ "posthog_insightvariable"."default_value",
+ "posthog_insightvariable"."is_multi"
+ FROM "posthog_insightvariable"
+ INNER JOIN "posthog_team" ON ("posthog_insightvariable"."team_id" = "posthog_team"."id")
+ WHERE ("posthog_insightvariable"."team_id" =
+ (SELECT U0."parent_team_id" AS "parent_team_id"
+ FROM "posthog_team" U0
+ WHERE U0."id" = 99999
+ LIMIT 1)
+ OR ("posthog_team"."parent_team_id" IS NULL
+ AND "posthog_insightvariable"."team_id" = 99999))
+ ORDER BY "posthog_insightvariable"."name" ASC
+ '''
+# ---
+# name: TestInsight.test_listing_insights_does_not_nplus1.99
+ '''
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
diff --git a/products/product_analytics/backend/tests/api/test_insight.py b/products/product_analytics/backend/tests/api/test_insight.py
index 1e5ba385f6f9..4e94d4d050e8 100644
--- a/products/product_analytics/backend/tests/api/test_insight.py
+++ b/products/product_analytics/backend/tests/api/test_insight.py
@@ -15,7 +15,7 @@ from posthog.test.base import (
)
from unittest import mock
from unittest.case import skip
-from unittest.mock import ANY, PropertyMock, patch
+from unittest.mock import ANY, patch
from django.db import connection
from django.test import override_settings
@@ -1827,14 +1827,6 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):
self.assertEqual(response_data["name"], "insight new name")
self.assertEqual(sorted(response_data["tags"]), ["add", "tags", "these"])
self.assertEqual(response_data["created_by"]["distinct_id"], self.user.distinct_id)
- self.assertEqual(
- response_data["effective_restriction_level"],
- Dashboard.RestrictionLevel.EVERYONE_IN_PROJECT_CAN_EDIT,
- )
- self.assertEqual(
- response_data["effective_privilege_level"],
- Dashboard.PrivilegeLevel.CAN_EDIT,
- )
response = self.client.get(f"/api/projects/{self.team.id}/insights/{insight_id}")
@@ -4517,18 +4509,31 @@ class TestInsightBulkDelete(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest)
self.assertFalse(DashboardTile.objects_including_soft_deleted.get(id=tile.id).deleted)
def test_bulk_restore_skips_tiles_on_dashboards_the_user_cannot_edit(self) -> None:
- dashboard = Dashboard.objects.create(team=self.team, name="Dashboard")
- insight = self._create_insight()
+ self.organization.available_product_features = [
+ {"key": AvailableFeature.ACCESS_CONTROL, "name": AvailableFeature.ACCESS_CONTROL},
+ {"key": AvailableFeature.ROLE_BASED_ACCESS, "name": AvailableFeature.ROLE_BASED_ACCESS},
+ ]
+ self.organization.save()
+
+ creator = self._create_user("[email protected]", level=OrganizationMembership.Level.MEMBER)
+ dashboard = Dashboard.objects.create(team=self.team, name="Dashboard", created_by=creator)
+ insight = Insight.objects.create(team=self.team, name="My insight", saved=True, created_by=creator)
tile = DashboardTile.objects.create(insight=insight, dashboard=dashboard)
self.assertEqual(self._bulk_delete([insight.id]).status_code, status.HTTP_200_OK)
- # Simulate the requester only having view access to the dashboard the insight sits on.
- with patch(
- "posthog.user_permissions.UserDashboardPermissions.effective_privilege_level",
- new_callable=PropertyMock,
- return_value=Dashboard.PrivilegeLevel.CAN_VIEW,
- ):
- response = self._bulk_restore([insight.id])
+ # The restorer only has view access to the dashboard the insight sits on, and is not the
+ # insight's creator, so no creator bypass applies.
+ member = self._create_user("[email protected]", level=OrganizationMembership.Level.MEMBER)
+ AccessControl.objects.create(
+ team=self.team,
+ resource="dashboard",
+ resource_id=str(dashboard.id),
+ access_level="viewer",
+ organization_member=member.organization_memberships.first(),
+ role=None,
+ )
+ self.client.force_login(member)
+ response = self._bulk_restore([insight.id])
self.assertEqual(response.status_code, status.HTTP_200_OK, response.json())
self.assertEqual([item["id"] for item in response.json()["restored"]], [insight.id])
@@ -4536,6 +4541,48 @@ class TestInsightBulkDelete(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest)
# The insight comes back, but its tile on a dashboard the user can only view stays hidden.
self.assertTrue(DashboardTile.objects_including_soft_deleted.get(id=tile.id).deleted)
+ def test_bulk_restore_resolves_each_dashboard_against_its_own_team(self) -> None:
+ self.organization.available_product_features = [
+ {"key": AvailableFeature.ACCESS_CONTROL, "name": AvailableFeature.ACCESS_CONTROL},
+ {"key": AvailableFeature.ROLE_BASED_ACCESS, "name": AvailableFeature.ROLE_BASED_ACCESS},
+ ]
+ self.organization.save()
+
+ creator = self._create_user("[email protected]", level=OrganizationMembership.Level.MEMBER)
+ # A sibling environment in the same project owns the dashboard the insight sits on.
+ other_team = Team.objects.create(organization=self.organization, project=self.team.project)
+ dashboard = Dashboard.objects.create(team=other_team, name="Sibling dashboard", created_by=creator)
+ insight = Insight.objects.create(team=self.team, name="My insight", saved=True, created_by=creator)
+ tile = DashboardTile.objects.create(insight=insight, dashboard=dashboard)
+ self.assertEqual(self._bulk_delete([insight.id]).status_code, status.HTTP_200_OK)
+
+ member = self._create_user("[email protected]", level=OrganizationMembership.Level.MEMBER)
+ membership = member.organization_memberships.first()
+ # The requesting team's copy of the rule only grants view access...
+ AccessControl.objects.create(
+ team=self.team,
+ resource="dashboard",
+ resource_id=str(dashboard.id),
+ access_level="viewer",
+ organization_member=membership,
+ role=None,
+ )
+ # ...but the dashboard's own team grants edit access, which is the one that counts.
+ AccessControl.objects.create(
+ team=other_team,
+ resource="dashboard",
+ resource_id=str(dashboard.id),
+ access_level="editor",
+ organization_member=membership,
+ role=None,
+ )
+ self.client.force_login(member)
+ response = self._bulk_restore([insight.id])
+
+ self.assertEqual(response.status_code, status.HTTP_200_OK, response.json())
+ self.assertEqual([item["id"] for item in response.json()["restored"]], [insight.id])
+ self.assertFalse(DashboardTile.objects_including_soft_deleted.get(id=tile.id).deleted)
+
class TestInsightBulkSetTestAccountFilter(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):
def setUp(self) -> None:
diff --git a/products/product_analytics/frontend/generated/api.schemas.ts b/products/product_analytics/frontend/generated/api.schemas.ts
index 9481a71ae319..447ed5d3afed 100644
--- a/products/product_analytics/frontend/generated/api.schemas.ts
+++ b/products/product_analytics/frontend/generated/api.schemas.ts
@@ -8674,28 +8674,6 @@ export interface UserBasicApi {
role_at_organization?: RoleAtOrganizationEnumApi | BlankEnumApi | null
}
-/**
- * * `21` - Everyone in the project can edit
- * * `37` - Only those invited to this dashboard can edit
- */
-export type RestrictionLevelEnumApi = (typeof RestrictionLevelEnumApi)[keyof typeof RestrictionLevelEnumApi]
-
-export const RestrictionLevelEnumApi = {
- Number21: 21,
- Number37: 37,
-} as const
-
-/**
- * * `21` - Can view dashboard
- * * `37` - Can edit dashboard
- */
-export type PrivilegeLevelEnumApi = (typeof PrivilegeLevelEnumApi)[keyof typeof PrivilegeLevelEnumApi]
-
-export const PrivilegeLevelEnumApi = {
- Number21: 21,
- Number37: 37,
-} as const
-
/**
* Warnings attached to the query response that produced an insight's results.
*/
@@ -8950,8 +8928,6 @@ export interface InsightApi {
readonly last_modified_at: string
readonly last_modified_by: UserBasicApi
readonly is_sample: boolean
- readonly effective_restriction_level: RestrictionLevelEnumApi
- readonly effective_privilege_level: PrivilegeLevelEnumApi
/**
* The effective access level the user has for this object
* @nullable
@@ -9082,8 +9058,6 @@ export interface PatchedInsightApi {
readonly last_modified_at?: string
readonly last_modified_by?: UserBasicApi
readonly is_sample?: boolean
- readonly effective_restriction_level?: RestrictionLevelEnumApi
- readonly effective_privilege_level?: PrivilegeLevelEnumApi
/**
* The effective access level the user has for this object
* @nullable
diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json
index 5af4b2976f5c..42728376d1fc 100644
--- a/services/mcp/schema/generated-tool-definitions.json
+++ b/services/mcp/schema/generated-tool-definitions.json
@@ -3606,7 +3606,7 @@
}
},
"dashboard-update": {
- "description": "Resize, reposition, or update dashboard tiles. It can also update the dashboard name, description, pinned status, tags, filters, and restriction level 21. Legacy value 37 is deprecated and rejected by the API. After you create or add insight tiles, call dashboard-get to get their tile IDs, then pass `tiles` with each tile's `id` and a `layouts` object holding x, y, w, and h per breakpoint. This works for every tile type, including insight tiles. The desktop grid (`layouts.sm`) is 12 columns wide. Set each tile's width and height for its content and importance. Width can be any whole number from 1 to 12, subject to the tile's minimum size. Mixed rows such as 8-wide and 4-wide tiles can show hierarchy. A write replaces the tile's whole layout, so send a complete box, not just the value you want to change. Boxes are stored as sent and overlaps are not resolved, so plan the whole grid and send every tile you move in one request. Only set `layouts.sm`: the dashboard derives the mobile layout from the sm order and heights. Use dashboard-reorder-tiles only to repack the whole dashboard with preserved or uniform tile sizes. The same `tiles` array also updates a widget tile's own settings: add a nested `widget.id` from dashboard-get plus the fields to change (`config`, `name`, `description`). That is the same PATCH path the UI uses, but prefer dashboard-widgets-batch-update, which takes just a tile_id per widget. To group tiles, give each tile in the group the same `group_key`, and set the group's title in `group_titles` (a map from group key to title, which replaces the stored map). To mark a tile, set its `badge`: `winner` shows a crown, for example on the best tile in a group, and `cheeky-hog` shows a hedgehog on hover. Set `badge` or `group_key` to null to remove it. To add new widget tiles to this dashboard, use dashboard-widgets-batch-add instead. The returned tiles omit insight results to save context — use dashboard-insights-run to fetch the actual data for each insight.",
+ "description": "Resize, reposition, or update dashboard tiles. It can also update the dashboard name, description, pinned status, tags, and filters. After you create or add insight tiles, call dashboard-get to get their tile IDs, then pass `tiles` with each tile's `id` and a `layouts` object holding x, y, w, and h per breakpoint. This works for every tile type, including insight tiles. The desktop grid (`layouts.sm`) is 12 columns wide. Set each tile's width and height for its content and importance. Width can be any whole number from 1 to 12, subject to the tile's minimum size. Mixed rows such as 8-wide and 4-wide tiles can show hierarchy. A write replaces the tile's whole layout, so send a complete box, not just the value you want to change. Boxes are stored as sent and overlaps are not resolved, so plan the whole grid and send every tile you move in one request. Only set `layouts.sm`: the dashboard derives the mobile layout from the sm order and heights. Use dashboard-reorder-tiles only to repack the whole dashboard with preserved or uniform tile sizes. The same `tiles` array also updates a widget tile's own settings: add a nested `widget.id` from dashboard-get plus the fields to change (`config`, `name`, `description`). That is the same PATCH path the UI uses, but prefer dashboard-widgets-batch-update, which takes just a tile_id per widget. To group tiles, give each tile in the group the same `group_key`, and set the group's title in `group_titles` (a map from group key to title, which replaces the stored map). To mark a tile, set its `badge`: `winner` shows a crown, for example on the best tile in a group, and `cheeky-hog` shows a hedgehog on hover. Set `badge` or `group_key` to null to remove it. To add new widget tiles to this dashboard, use dashboard-widgets-batch-add instead. The returned tiles omit insight results to save context — use dashboard-insights-run to fetch the actual data for each insight.",
"category": "Dashboards",
"feature": "dashboards",
"summary": "Update dashboard",
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index 5d092c923a8a..de836de2ca12 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -3621,7 +3621,7 @@
}
},
"dashboard-update": {
- "description": "Resize, reposition, or update dashboard tiles. It can also update the dashboard name, description, pinned status, tags, filters, and restriction level 21. Legacy value 37 is deprecated and rejected by the API. After you create or add insight tiles, call dashboard-get to get their tile IDs, then pass `tiles` with each tile's `id` and a `layouts` object holding x, y, w, and h per breakpoint. This works for every tile type, including insight tiles. The desktop grid (`layouts.sm`) is 12 columns wide. Set each tile's width and height for its content and importance. Width can be any whole number from 1 to 12, subject to the tile's minimum size. Mixed rows such as 8-wide and 4-wide tiles can show hierarchy. A write replaces the tile's whole layout, so send a complete box, not just the value you want to change. Boxes are stored as sent and overlaps are not resolved, so plan the whole grid and send every tile you move in one request. Only set `layouts.sm`: the dashboard derives the mobile layout from the sm order and heights. Use dashboard-reorder-tiles only to repack the whole dashboard with preserved or uniform tile sizes. The same `tiles` array also updates a widget tile's own settings: add a nested `widget.id` from dashboard-get plus the fields to change (`config`, `name`, `description`). That is the same PATCH path the UI uses, but prefer dashboard-widgets-batch-update, which takes just a tile_id per widget. To group tiles, give each tile in the group the same `group_key`, and set the group's title in `group_titles` (a map from group key to title, which replaces the stored map). To mark a tile, set its `badge`: `winner` shows a crown, for example on the best tile in a group, and `cheeky-hog` shows a hedgehog on hover. Set `badge` or `group_key` to null to remove it. To add new widget tiles to this dashboard, use dashboard-widgets-batch-add instead. The returned tiles omit insight results to save context — use dashboard-insights-run to fetch the actual data for each insight.",
+ "description": "Resize, reposition, or update dashboard tiles. It can also update the dashboard name, description, pinned status, tags, and filters. After you create or add insight tiles, call dashboard-get to get their tile IDs, then pass `tiles` with each tile's `id` and a `layouts` object holding x, y, w, and h per breakpoint. This works for every tile type, including insight tiles. The desktop grid (`layouts.sm`) is 12 columns wide. Set each tile's width and height for its content and importance. Width can be any whole number from 1 to 12, subject to the tile's minimum size. Mixed rows such as 8-wide and 4-wide tiles can show hierarchy. A write replaces the tile's whole layout, so send a complete box, not just the value you want to change. Boxes are stored as sent and overlaps are not resolved, so plan the whole grid and send every tile you move in one request. Only set `layouts.sm`: the dashboard derives the mobile layout from the sm order and heights. Use dashboard-reorder-tiles only to repack the whole dashboard with preserved or uniform tile sizes. The same `tiles` array also updates a widget tile's own settings: add a nested `widget.id` from dashboard-get plus the fields to change (`config`, `name`, `description`). That is the same PATCH path the UI uses, but prefer dashboard-widgets-batch-update, which takes just a tile_id per widget. To group tiles, give each tile in the group the same `group_key`, and set the group's title in `group_titles` (a map from group key to title, which replaces the stored map). To mark a tile, set its `badge`: `winner` shows a crown, for example on the best tile in a group, and `cheeky-hog` shows a hedgehog on hover. Set `badge` or `group_key` to null to remove it. To add new widget tiles to this dashboard, use dashboard-widgets-batch-add instead. The returned tiles omit insight results to save context — use dashboard-insights-run to fetch the actual data for each insight.",
"category": "Dashboards",
"feature": "dashboards",
"summary": "Update dashboard",
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index d3c763a812c4..c7acb4f9508b 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -11227,30 +11227,6 @@ export namespace Schemas {
deleted?: boolean | null;
}
- /**
- * * `21` - Everyone in the project can edit
- * * `37` - Only those invited to this dashboard can edit
- */
- export type RestrictionLevelEnum = typeof RestrictionLevelEnum[keyof typeof RestrictionLevelEnum];
-
-
- export const RestrictionLevelEnum = {
- Number21: 21,
- Number37: 37,
- } as const;
-
- /**
- * * `21` - Can view dashboard
- * * `37` - Can edit dashboard
- */
- export type PrivilegeLevelEnum = typeof PrivilegeLevelEnum[keyof typeof PrivilegeLevelEnum];
-
-
- export const PrivilegeLevelEnum = {
- Number21: 21,
- Number37: 37,
- } as const;
-
/**
* Warnings attached to the query response that produced an insight's results.
*/
@@ -11375,8 +11351,6 @@ export namespace Schemas {
readonly last_modified_at: string;
readonly last_modified_by: UserBasic;
readonly is_sample: boolean;
- readonly effective_restriction_level: RestrictionLevelEnum;
- readonly effective_privilege_level: PrivilegeLevelEnum;
/**
* The effective access level the user has for this object
* @nullable
@@ -28009,19 +27983,11 @@ export namespace Schemas {
*/
data_color_theme_id?: number | null;
tags?: unknown[];
- /** Only restriction level 21 is accepted on create and update. Legacy value 37 is deprecated and rejected.
- *
- * * `21` - Everyone in the project can edit
- * * `37` - Only those invited to this dashboard can edit */
- restriction_level?: RestrictionLevelEnum;
- readonly effective_restriction_level: RestrictionLevelEnum;
- readonly effective_privilege_level: PrivilegeLevelEnum;
/**
* The effective access level the user has for this object
* @nullable
*/
readonly user_access_level: string | null;
- readonly access_control_version: string;
/** @nullable */
last_refresh?: string | null;
/** @nullable */
@@ -28108,19 +28074,11 @@ export namespace Schemas {
readonly deleted: boolean;
readonly creation_mode: DashboardCreationModeEnum;
tags?: unknown[];
- /** Only restriction level 21 is accepted on create and update. Legacy value 37 is deprecated and rejected.
- *
- * * `21` - Everyone in the project can edit
- * * `37` - Only those invited to this dashboard can edit */
- readonly restriction_level: RestrictionLevelEnum;
- readonly effective_restriction_level: RestrictionLevelEnum;
- readonly effective_privilege_level: PrivilegeLevelEnum;
/**
* The effective access level the user has for this object
* @nullable
*/
readonly user_access_level: string | null;
- readonly access_control_version: string;
/** @nullable */
readonly last_refresh: string | null;
readonly team_id: number;
@@ -28611,142 +28569,6 @@ export namespace Schemas {
error: string | null;
}
- export type DashboardWriteOpenApiFilters = { [key: string]: unknown };
-
- /**
- * @nullable
- */
- export type DashboardWriteOpenApiVariables = { [key: string]: unknown } | null;
-
- /**
- * @nullable
- */
- export type DashboardWriteOpenApiPersistedFilters = { [key: string]: unknown } | null;
-
- /**
- * @nullable
- */
- export type DashboardWriteOpenApiPersistedVariables = { [key: string]: unknown } | null;
-
- /**
- * Titles for tile groups, keyed by the tiles' group_key. The dashboard shows a title above its group. A write replaces the whole map. Send an empty object or null to remove all group titles.
- * @nullable
- */
- export type DashboardWriteOpenApiGroupTitles = {[key: string]: string} | null;
-
- export type DashboardWriteOpenApiTilesItem = { [key: string]: unknown };
-
- /**
- * Serializer mixin that handles tags for objects.
- */
- export interface DashboardWriteOpenApi {
- readonly id: number;
- /**
- * @maxLength 400
- * @nullable
- */
- name?: string | null;
- description?: string;
- pinned?: boolean;
- readonly created_at: string;
- readonly created_by: UserBasic;
- /** @nullable */
- readonly last_accessed_at: string | null;
- /** @nullable */
- readonly last_viewed_at: string | null;
- /**
- * Path of the project-tree folder this dashboard is filed under in the file system, e.g. 'Unfiled/Dashboards'. An empty string means the project root; null means the dashboard has no file system entry. The dashboard's own name is not part of the path.
- * @nullable
- */
- readonly folder: string | null;
- /**
- * Id of this dashboard's file system entry, or null when it has none. Together with `file_system_path` this is everything a caller needs to move the dashboard between folders, so a list page does not have to look the entry up separately.
- * @nullable
- */
- readonly file_system_id: string | null;
- /**
- * Full path of this dashboard's file system entry, e.g. 'Unfiled/Dashboards/Revenue'. Unlike `folder` this keeps the dashboard's own name as the last segment, which is what a move needs in order to compute the destination path. Null when it has no entry.
- * @nullable
- */
- readonly file_system_path: string | null;
- readonly is_shared: boolean;
- deleted?: boolean;
- readonly creation_mode: DashboardCreationModeEnum;
- readonly filters: DashboardWriteOpenApiFilters;
- /** @nullable */
- readonly variables: DashboardWriteOpenApiVariables;
- /**
- * Colors pinned to specific breakdown values across the dashboard's tiles. A list of entries, not an object keyed by breakdown value. Send an empty list to clear them.
- * @nullable
- */
- breakdown_colors?: BreakdownColorConfig[] | null;
- /**
- * ID of the color theme used for chart visualizations.
- * @nullable
- */
- data_color_theme_id?: number | null;
- tags?: unknown[];
- /**
- * Only restriction level 21 is accepted on create and update. Legacy value 37 is deprecated and rejected.
- * @minimum 21
- * @maximum 21
- */
- restriction_level?: number;
- readonly effective_restriction_level: RestrictionLevelEnum;
- readonly effective_privilege_level: PrivilegeLevelEnum;
- /**
- * The effective access level the user has for this object
- * @nullable
- */
- readonly user_access_level: string | null;
- readonly access_control_version: string;
- /** @nullable */
- last_refresh?: string | null;
- /** @nullable */
- readonly persisted_filters: DashboardWriteOpenApiPersistedFilters;
- /** @nullable */
- readonly persisted_variables: DashboardWriteOpenApiPersistedVariables;
- readonly team_id: number;
- /**
- * List of quick filter IDs associated with this dashboard
- * @nullable
- */
- quick_filter_ids?: string[] | null;
- /** Dashboard display settings. */
- readonly customization: DashboardCustomization;
- /** Named tile density preset. Use tight, condensed, standard, relaxed, or wide.
- *
- * * `tight` - tight
- * * `condensed` - condensed
- * * `standard` - standard
- * * `relaxed` - relaxed
- * * `wide` - wide */
- grid_spacing?: TileSpacingEnum;
- /** How tiles rearrange after a move or resize. vertical stacks tiles upward, horizontal stacks tiles to the left, and stable preserves positions while moving colliding tiles.
- *
- * * `vertical` - vertical
- * * `horizontal` - horizontal
- * * `stable` - stable */
- layout_compaction?: LayoutCompactionEnum;
- /**
- * Titles for tile groups, keyed by the tiles' group_key. The dashboard shows a title above its group. A write replaces the whole map. Send an empty object or null to remove all group titles.
- * @nullable
- */
- group_titles?: DashboardWriteOpenApiGroupTitles;
- /** @nullable */
- readonly tiles: readonly DashboardWriteOpenApiTilesItem[] | null;
- /** Template key to create the dashboard from a predefined template. */
- use_template?: string;
- /**
- * ID of an existing dashboard to duplicate.
- * @nullable
- */
- use_dashboard?: number | null;
- /** When deleting, also delete insights that are only on this dashboard. */
- delete_insights?: boolean;
- _create_in_folder?: string;
- }
-
export interface DataCatalogCertification {
readonly id: string;
/**
@@ -83608,8 +83430,6 @@ export namespace Schemas {
readonly last_modified_at?: string;
readonly last_modified_by?: UserBasic;
readonly is_sample?: boolean;
- readonly effective_restriction_level?: RestrictionLevelEnum;
- readonly effective_privilege_level?: PrivilegeLevelEnum;
/**
* The effective access level the user has for this object
* @nullable
@@ -84639,12 +84459,6 @@ export namespace Schemas {
*/
data_color_theme_id?: number | null;
tags?: string[];
- /**
- * Only restriction level 21 is accepted on create and update. Legacy value 37 is deprecated and rejected.
- * @minimum 21
- * @maximum 21
- */
- restriction_level?: number;
/**
* List of quick filter IDs associated with this dashboard.
* @nullable
diff --git a/services/mcp/src/generated/dashboards/api.ts b/services/mcp/src/generated/dashboards/api.ts
index 5a179bf7864f..b01ca0964d7f 100644
--- a/services/mcp/src/generated/dashboards/api.ts
+++ b/services/mcp/src/generated/dashboards/api.ts
@@ -113,9 +113,6 @@ export const DashboardsCreateQueryParams = () => zod.object({
export const dashboardsCreateBodyNameMax = 400
export const dashboardsCreateBodyBreakdownColorsItemColorTokenRegExp = new RegExp('^preset-[1-9][0-9]\*$')
-export const dashboardsCreateBodyRestrictionLevelMin = 21
-export const dashboardsCreateBodyRestrictionLevelMax = 21
-
export const dashboardsCreateBodyGroupTitlesMaxOne = 200
export const dashboardsCreateBodyDeleteInsightsDefault = false
@@ -167,14 +164,6 @@ export const DashboardsCreateBody = () => zod
),
data_color_theme_id: zod.number().nullish().describe('ID of the color theme used for chart visualizations.'),
tags: zod.array(zod.unknown()).optional(),
- restriction_level: zod
- .number()
- .min(dashboardsCreateBodyRestrictionLevelMin)
- .max(dashboardsCreateBodyRestrictionLevelMax)
- .optional()
- .describe(
- 'Only restriction level 21 is accepted on create and update. Legacy value 37 is deprecated and rejected.'
- ),
quick_filter_ids: zod
.array(zod.string())
.nullish()
@@ -266,9 +255,6 @@ export const DashboardsPartialUpdateQueryParams = () => zod.object({
export const dashboardsPartialUpdateBodyNameMax = 400
export const dashboardsPartialUpdateBodyBreakdownColorsItemColorTokenRegExp = new RegExp('^preset-[1-9][0-9]\*$')
-export const dashboardsPartialUpdateBodyRestrictionLevelMin = 21
-export const dashboardsPartialUpdateBodyRestrictionLevelMax = 21
-
export const dashboardsPartialUpdateBodyGroupTitlesMaxOne = 200
export const dashboardsPartialUpdateBodyTilesItemLayoutsOneSmOneXMin = 0
@@ -420,14 +406,6 @@ export const DashboardsPartialUpdateBody = () => zod
),
data_color_theme_id: zod.number().nullish().describe('ID of the color theme used for chart visualizations.'),
tags: zod.array(zod.string()).optional(),
- restriction_level: zod
- .number()
- .min(dashboardsPartialUpdateBodyRestrictionLevelMin)
- .max(dashboardsPartialUpdateBodyRestrictionLevelMax)
- .optional()
- .describe(
- 'Only restriction level 21 is accepted on create and update. Legacy value 37 is deprecated and rejected.'
- ),
quick_filter_ids: zod
.array(zod.string())
.nullish()
diff --git a/services/mcp/src/tools/generated/dashboards.ts b/services/mcp/src/tools/generated/dashboards.ts
index eba7eab67d59..77120e89d030 100644
--- a/services/mcp/src/tools/generated/dashboards.ts
+++ b/services/mcp/src/tools/generated/dashboards.ts
@@ -20,13 +20,7 @@ import type { Context, ToolBase, ZodObjectAny } from '@/tools/types'
const DashboardCreateSchema = () => {
const DashboardsCreateBody = orvalSchemas.DashboardsCreateBody()
const DashboardsCreateQueryParams = orvalSchemas.DashboardsCreateQueryParams()
- return DashboardsCreateQueryParams.omit({ format: true })
- .extend(DashboardsCreateBody.shape)
- .extend({
- restriction_level: DashboardsCreateBody.shape['restriction_level'].describe(
- 'Set to 21 for everyone in the project to edit. Legacy value 37 is deprecated and rejected by the API.'
- ),
- })
+ return DashboardsCreateQueryParams.omit({ format: true }).extend(DashboardsCreateBody.shape)
}
const dashboardCreate = (): ToolBase<
@@ -56,9 +50,6 @@ const dashboardCreate = (): ToolBase<
if (params.tags !== undefined) {
body['tags'] = params.tags
}
- if (params.restriction_level !== undefined) {
- body['restriction_level'] = params.restriction_level
- }
if (params.quick_filter_ids !== undefined) {
body['quick_filter_ids'] = params.quick_filter_ids
}
@@ -90,11 +81,7 @@ const dashboardCreate = (): ToolBase<
})
const filtered = stripNullFields(
omitResponseFields(result, [
- 'effective_restriction_level',
- 'effective_privilege_level',
'user_access_level',
- 'access_control_version',
- 'restriction_level',
'creation_mode',
'deleted',
'breakdown_colors',
@@ -115,8 +102,6 @@ const dashboardCreate = (): ToolBase<
'tiles.*.insight.filters_hash',
'tiles.*.insight.dashboards',
'tiles.*.insight.dashboard_tiles',
- 'tiles.*.insight.effective_restriction_level',
- 'tiles.*.insight.effective_privilege_level',
'tiles.*.insight.user_access_level',
'tiles.*.insight.filters',
'tiles.*.insight.is_sample',
@@ -277,11 +262,7 @@ const dashboardGet = (): ToolBase<
})
const filtered = stripNullFields(
omitResponseFields(result, [
- 'effective_restriction_level',
- 'effective_privilege_level',
'user_access_level',
- 'access_control_version',
- 'restriction_level',
'creation_mode',
'deleted',
'breakdown_colors',
@@ -302,8 +283,6 @@ const dashboardGet = (): ToolBase<
'tiles.*.insight.filters_hash',
'tiles.*.insight.dashboards',
'tiles.*.insight.dashboard_tiles',
- 'tiles.*.insight.effective_restriction_level',
- 'tiles.*.insight.effective_privilege_level',
'tiles.*.insight.user_access_level',
'tiles.*.insight.filters',
'tiles.*.insight.is_sample',
@@ -574,12 +553,7 @@ const DashboardUpdateSchema = () => {
return DashboardsPartialUpdateParams.omit({ project_id: true })
.extend(DashboardsPartialUpdateQueryParams.omit({ format: true }).shape)
.extend(DashboardsPartialUpdateBody.shape)
- .extend({
- id: z.preprocess(castStringToInt, DashboardsPartialUpdateParams.shape['id']),
- restriction_level: DashboardsPartialUpdateBody.shape['restriction_level'].describe(
- 'Set to 21 for everyone in the project to edit. Legacy value 37 is deprecated and rejected by the API.'
- ),
- })
+ .extend({ id: z.preprocess(castStringToInt, DashboardsPartialUpdateParams.shape['id']) })
}
const dashboardUpdate = (): ToolBase<
@@ -612,9 +586,6 @@ const dashboardUpdate = (): ToolBase<
if (params.tags !== undefined) {
body['tags'] = params.tags
}
- if (params.restriction_level !== undefined) {
- body['restriction_level'] = params.restriction_level
- }
if (params.quick_filter_ids !== undefined) {
body['quick_filter_ids'] = params.quick_filter_ids
}
@@ -649,11 +620,7 @@ const dashboardUpdate = (): ToolBase<
})
const filtered = stripNullFields(
omitResponseFields(result, [
- 'effective_restriction_level',
- 'effective_privilege_level',
'user_access_level',
- 'access_control_version',
- 'restriction_level',
'creation_mode',
'deleted',
'breakdown_colors',
@@ -674,8 +641,6 @@ const dashboardUpdate = (): ToolBase<
'tiles.*.insight.filters_hash',
'tiles.*.insight.dashboards',
'tiles.*.insight.dashboard_tiles',
- 'tiles.*.insight.effective_restriction_level',
- 'tiles.*.insight.effective_privilege_level',
'tiles.*.insight.user_access_level',
'tiles.*.insight.filters',
'tiles.*.insight.is_sample',
diff --git a/services/mcp/tests/tools/dashboards.integration.test.ts b/services/mcp/tests/tools/dashboards.integration.test.ts
index f220a9467351..55da39eca0e2 100644
--- a/services/mcp/tests/tools/dashboards.integration.test.ts
+++ b/services/mcp/tests/tools/dashboards.integration.test.ts
@@ -270,8 +270,6 @@ describe('Dashboards', { concurrent: false }, () => {
'filters_hash',
'dashboards',
'dashboard_tiles',
- 'effective_restriction_level',
- 'effective_privilege_level',
'user_access_level',
'filters',
'is_sample',
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/dashboard-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/dashboard-create.json
index 4c6b334f6896..877b152288f9 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/dashboard-create.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/dashboard-create.json
@@ -148,12 +148,6 @@
],
"description": "List of quick filter IDs associated with this dashboard"
},
- "restriction_level": {
- "description": "Set to 21 for everyone in the project to edit. Legacy value 37 is deprecated and rejected by the API.",
- "maximum": 21,
- "minimum": 21,
- "type": "number"
- },
"tags": {
"items": {},
"type": "array"
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/dashboard-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/dashboard-update.json
index bf74d68a4818..0b64985162b6 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/dashboard-update.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/dashboard-update.json
@@ -182,12 +182,6 @@
],
"description": "List of quick filter IDs associated with this dashboard."
},
- "restriction_level": {
- "description": "Set to 21 for everyone in the project to edit. Legacy value 37 is deprecated and rejected by the API.",
- "maximum": 21,
- "minimum": 21,
- "type": "number"
- },
"tags": {
"items": {
"type": "string"