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(devex): upgrade django to 6.1 (#123953)

Julian Bezf84c2ca45d16
diff --git a/posthog/admin/admins/user_admin.py b/posthog/admin/admins/user_admin.py
index f6f7dd0f7de7..9d441276e34e 100644
--- a/posthog/admin/admins/user_admin.py
+++ b/posthog/admin/admins/user_admin.py
@@ -4,6 +4,7 @@ from collections.abc import Iterable
from typing import Any, cast
from django.contrib import admin, messages
+from django.contrib.admin import ActionLocation
from django.contrib.admin.models import DELETION, LogEntry
from django.contrib.admin.views.main import ChangeList
from django.contrib.auth.admin import UserAdmin as DjangoUserAdmin
@@ -11,6 +12,7 @@ from django.contrib.auth.forms import (
ReadOnlyPasswordHashWidget as DjangoReadOnlyPasswordHashWidget,
UserChangeForm as DjangoUserChangeForm,
)
+from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX, identify_hasher
from django.core.exceptions import ValidationError
from django.db.models import CASCADE, PROTECT, RESTRICT, Model
from django.db.models.deletion import get_candidate_relations_to_delete
@@ -23,10 +25,7 @@ from django.urls import reverse
from django.utils.html import format_html
from django.utils.http import urlencode
from django.utils.safestring import mark_safe
-from django.utils.translation import (
- gettext,
- gettext_lazy as _,
-)
+from django.utils.translation import gettext_lazy as _
from django_otp.plugins.otp_totp.models import TOTPDevice
@@ -52,9 +51,6 @@ from posthog.models.webauthn_credential import WebauthnCredential
from posthog.session.activity import revoke_other_sessions
from posthog.tasks.email import send_password_reset, send_two_factor_reset_email
-# Django's default widget masks salt/hash but still shows their first few characters; keep those out of the admin entirely.
-_HIDDEN_SUMMARY_LABELS = {"salt", "hash", "checksum"}
-
# Every relation is counted with its own capped query, so this bounds how much of a table the
# confirmation page reads. The exact figure past the cap doesn't change the operator's decision.
DELETION_SUMMARY_COUNT_CAP = 100
@@ -75,10 +71,19 @@ class UserChangeList(ChangeList):
class ReadOnlyPasswordHashWidget(DjangoReadOnlyPasswordHashWidget):
+ # Django's widget shows the first characters of the salt and hash. Show only the algorithm.
+ template_name = "admin/posthog/user/read_only_password_hash.html"
+
def get_context(self, name: str, value: str | None, attrs: dict[str, Any] | None) -> dict[str, Any]:
context = super().get_context(name, value, attrs)
- hidden_labels = {gettext(label) for label in _HIDDEN_SUMMARY_LABELS}
- context["summary"] = [entry for entry in context["summary"] if entry["label"] not in hidden_labels]
+ context["has_password"] = False
+ context["algorithm"] = None
+ if value and not value.startswith(UNUSABLE_PASSWORD_PREFIX):
+ context["has_password"] = True
+ try:
+ context["algorithm"] = identify_hasher(value).algorithm
+ except ValueError:
+ pass
return context
@@ -380,8 +385,10 @@ class UserAdmin(DjangoUserAdmin):
impersonated = get_impersonated_user(request)
return impersonated is not None and obj.pk == impersonated.pk
- def get_actions(self, request: HttpRequest, *args: Any, **kwargs: Any) -> dict[str, Any]:
- actions = super().get_actions(request, *args, **kwargs)
+ def get_actions(
+ self, request: HttpRequest, action_location: ActionLocation = ActionLocation.CHANGE_LIST
+ ) -> dict[str, Any]:
+ actions = super().get_actions(request, action_location=action_location)
# Bulk delete has nowhere to ask for a reason, and it would collect the cascade for every
# selected account into one page.
actions.pop("delete_selected", None)
diff --git a/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr b/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr
index 2ca626f95177..8c33f0378af5 100644
--- a/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr
+++ b/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr
@@ -183,10 +183,10 @@
AND "posthog_subscription"."dashboard_id" = 99999
AND NOT (EXISTS
(SELECT 1 AS "a"
- FROM "posthog_subscription_dashboard_export_insights" U1
- INNER JOIN "posthog_dashboarditem" U2 ON (U1."insight_id" = U2."id")
- WHERE (NOT U2."deleted"
- AND U1."subscription_id" = ("posthog_subscription"."id"))
+ FROM "posthog_subscription_dashboard_export_insights" "U1"
+ INNER JOIN "posthog_dashboarditem" "U2" ON ("U1"."insight_id" = "U2"."id")
+ WHERE (NOT "U2"."deleted"
+ AND "U1"."subscription_id" = ("posthog_subscription"."id"))
LIMIT 1)))
LIMIT 1
'''
@@ -401,9 +401,9 @@
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
+ (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))
@@ -915,79 +915,79 @@
"posthog_dashboard"."tags",
"posthog_dashboard"."share_token",
"posthog_dashboard"."is_shared",
- recent_dashboard_views."viewed_at" AS "last_viewed_at",
+ "recent_dashboard_views"."viewed_at" AS "last_viewed_at",
("posthog_dashboard"."id")::varchar AS "_ref_id",
- (SELECT U0."path" AS "path"
- FROM "posthog_filesystem" U0
- WHERE ((U0."surface" IS NULL
- OR U0."surface" = 'web')
- AND U0."ref" = ("posthog_dashboard"."id")::varchar
- AND U0."team_id" = ("posthog_dashboard"."team_id")
- AND U0."type" = 'dashboard'
- AND NOT (U0."shortcut"
- AND U0."shortcut" IS NOT NULL))
- ORDER BY U0."id" ASC
+ (SELECT "U0"."path" AS "path"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
+ ORDER BY "U0"."id" ASC
LIMIT 1) AS "_folder_path",
- (SELECT U0."id" AS "id"
- FROM "posthog_filesystem" U0
- WHERE ((U0."surface" IS NULL
- OR U0."surface" = 'web')
- AND U0."ref" = ("posthog_dashboard"."id")::varchar
- AND U0."team_id" = ("posthog_dashboard"."team_id")
- AND U0."type" = 'dashboard'
- AND NOT (U0."shortcut"
- AND U0."shortcut" IS NOT NULL))
+ (SELECT "U0"."id" AS "id"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
ORDER BY 1 ASC
LIMIT 1) AS "_folder_id",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in"
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in"
FROM "posthog_dashboard"
INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
- LEFT OUTER JOIN "posthog_filesystemviewlog" recent_dashboard_views ON ("posthog_team"."id" = recent_dashboard_views."team_id"
- AND ((recent_dashboard_views."user_id" = 99999
- AND recent_dashboard_views."type" = 'dashboard'
- AND recent_dashboard_views."ref" = ("posthog_dashboard"."id")::varchar)))
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboard"."created_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_filesystemviewlog" "recent_dashboard_views" ON ("posthog_team"."id" = "recent_dashboard_views"."team_id"
+ AND (("recent_dashboard_views"."user_id" = 99999
+ AND "recent_dashboard_views"."type" = 'dashboard'
+ AND "recent_dashboard_views"."ref" = ("posthog_dashboard"."id")::varchar)))
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboard"."created_by_id" = "T6"."id")
WHERE ("posthog_team"."project_id" = 99999
AND NOT ("posthog_dashboard"."deleted")
AND "posthog_dashboard"."id" = 99999)
@@ -1195,9 +1195,9 @@
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
+ (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))
@@ -1393,46 +1393,46 @@
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
"posthog_user"."email_opt_in",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in",
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in",
"posthog_text"."id",
"posthog_text"."body",
"posthog_text"."agent_context",
@@ -1458,97 +1458,97 @@
"posthog_dashboardwidget"."last_modified_at",
"posthog_dashboardwidget"."last_modified_by_id",
"posthog_dashboardwidget"."team_id",
- T10."id",
- T10."password",
- T10."last_login",
- T10."first_name",
- T10."last_name",
- T10."is_staff",
- T10."date_joined",
- T10."uuid",
- T10."current_organization_id",
- T10."current_team_id",
- T10."email",
- T10."pending_email",
- T10."distinct_id",
- T10."is_email_verified",
- T10."credentials_reviewed_at",
- T10."requested_password_reset_at",
- T10."requested_2fa_reset_at",
- T10."has_seen_product_intro_for",
- T10."strapi_id",
- T10."is_active",
- T10."role_at_organization",
- T10."theme_mode",
- T10."partial_notification_settings",
- T10."anonymize_data",
- T10."allow_impersonation",
- T10."toolbar_mode",
- T10."hedgehog_config",
- T10."allow_sidebar_suggestions",
- T10."shortcut_position",
- T10."passkeys_enabled_for_2fa",
- T10."hide_mcp_hints",
- T10."ui_configuration",
- T10."onboarding_skipped_at",
- T10."onboarding_skipped_reason",
- T10."onboarding_skipped_organization_id",
- T10."onboarding_delegated_to_invite_id",
- T10."onboarding_delegated_to_organization_id",
- T10."onboarding_delegation_accepted_at",
- T10."events_column_config",
- T10."email_opt_in",
- T11."id",
- T11."password",
- T11."last_login",
- T11."first_name",
- T11."last_name",
- T11."is_staff",
- T11."date_joined",
- T11."uuid",
- T11."current_organization_id",
- T11."current_team_id",
- T11."email",
- T11."pending_email",
- T11."distinct_id",
- T11."is_email_verified",
- T11."credentials_reviewed_at",
- T11."requested_password_reset_at",
- T11."requested_2fa_reset_at",
- T11."has_seen_product_intro_for",
- T11."strapi_id",
- T11."is_active",
- T11."role_at_organization",
- T11."theme_mode",
- T11."partial_notification_settings",
- T11."anonymize_data",
- T11."allow_impersonation",
- T11."toolbar_mode",
- T11."hedgehog_config",
- T11."allow_sidebar_suggestions",
- T11."shortcut_position",
- T11."passkeys_enabled_for_2fa",
- T11."hide_mcp_hints",
- T11."ui_configuration",
- T11."onboarding_skipped_at",
- T11."onboarding_skipped_reason",
- T11."onboarding_skipped_organization_id",
- T11."onboarding_delegated_to_invite_id",
- T11."onboarding_delegated_to_organization_id",
- T11."onboarding_delegation_accepted_at",
- T11."events_column_config",
- T11."email_opt_in"
+ "T10"."id",
+ "T10"."password",
+ "T10"."last_login",
+ "T10"."first_name",
+ "T10"."last_name",
+ "T10"."is_staff",
+ "T10"."date_joined",
+ "T10"."uuid",
+ "T10"."current_organization_id",
+ "T10"."current_team_id",
+ "T10"."email",
+ "T10"."pending_email",
+ "T10"."distinct_id",
+ "T10"."is_email_verified",
+ "T10"."credentials_reviewed_at",
+ "T10"."requested_password_reset_at",
+ "T10"."requested_2fa_reset_at",
+ "T10"."has_seen_product_intro_for",
+ "T10"."strapi_id",
+ "T10"."is_active",
+ "T10"."role_at_organization",
+ "T10"."theme_mode",
+ "T10"."partial_notification_settings",
+ "T10"."anonymize_data",
+ "T10"."allow_impersonation",
+ "T10"."toolbar_mode",
+ "T10"."hedgehog_config",
+ "T10"."allow_sidebar_suggestions",
+ "T10"."shortcut_position",
+ "T10"."passkeys_enabled_for_2fa",
+ "T10"."hide_mcp_hints",
+ "T10"."ui_configuration",
+ "T10"."onboarding_skipped_at",
+ "T10"."onboarding_skipped_reason",
+ "T10"."onboarding_skipped_organization_id",
+ "T10"."onboarding_delegated_to_invite_id",
+ "T10"."onboarding_delegated_to_organization_id",
+ "T10"."onboarding_delegation_accepted_at",
+ "T10"."events_column_config",
+ "T10"."email_opt_in",
+ "T11"."id",
+ "T11"."password",
+ "T11"."last_login",
+ "T11"."first_name",
+ "T11"."last_name",
+ "T11"."is_staff",
+ "T11"."date_joined",
+ "T11"."uuid",
+ "T11"."current_organization_id",
+ "T11"."current_team_id",
+ "T11"."email",
+ "T11"."pending_email",
+ "T11"."distinct_id",
+ "T11"."is_email_verified",
+ "T11"."credentials_reviewed_at",
+ "T11"."requested_password_reset_at",
+ "T11"."requested_2fa_reset_at",
+ "T11"."has_seen_product_intro_for",
+ "T11"."strapi_id",
+ "T11"."is_active",
+ "T11"."role_at_organization",
+ "T11"."theme_mode",
+ "T11"."partial_notification_settings",
+ "T11"."anonymize_data",
+ "T11"."allow_impersonation",
+ "T11"."toolbar_mode",
+ "T11"."hedgehog_config",
+ "T11"."allow_sidebar_suggestions",
+ "T11"."shortcut_position",
+ "T11"."passkeys_enabled_for_2fa",
+ "T11"."hide_mcp_hints",
+ "T11"."ui_configuration",
+ "T11"."onboarding_skipped_at",
+ "T11"."onboarding_skipped_reason",
+ "T11"."onboarding_skipped_organization_id",
+ "T11"."onboarding_delegated_to_invite_id",
+ "T11"."onboarding_delegated_to_organization_id",
+ "T11"."onboarding_delegation_accepted_at",
+ "T11"."events_column_config",
+ "T11"."email_opt_in"
FROM "posthog_dashboardtile"
INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."id")
LEFT OUTER JOIN "posthog_team" ON ("posthog_dashboarditem"."team_id" = "posthog_team"."id")
LEFT OUTER JOIN "posthog_user" ON ("posthog_dashboarditem"."created_by_id" = "posthog_user"."id")
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboarditem"."last_modified_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboarditem"."last_modified_by_id" = "T6"."id")
LEFT OUTER JOIN "posthog_text" ON ("posthog_dashboardtile"."text_id" = "posthog_text"."id")
LEFT OUTER JOIN "posthog_buttontile" ON ("posthog_dashboardtile"."button_tile_id" = "posthog_buttontile"."id")
LEFT OUTER JOIN "posthog_dashboardwidget" ON ("posthog_dashboardtile"."widget_id" = "posthog_dashboardwidget"."id")
- LEFT OUTER JOIN "posthog_user" T10 ON ("posthog_dashboardwidget"."created_by_id" = T10."id")
- LEFT OUTER JOIN "posthog_user" T11 ON ("posthog_dashboardwidget"."last_modified_by_id" = T11."id")
+ LEFT OUTER JOIN "posthog_user" "T10" ON ("posthog_dashboardwidget"."created_by_id" = "T10"."id")
+ LEFT OUTER JOIN "posthog_user" "T11" ON ("posthog_dashboardwidget"."last_modified_by_id" = "T11"."id")
WHERE (NOT ("posthog_dashboardtile"."deleted"
AND "posthog_dashboardtile"."deleted" IS NOT NULL)
AND NOT ("posthog_dashboard"."deleted")
@@ -2156,9 +2156,9 @@
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
+ (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))
@@ -2408,10 +2408,10 @@
AND "posthog_subscription"."dashboard_id" = 99999
AND NOT (EXISTS
(SELECT 1 AS "a"
- FROM "posthog_subscription_dashboard_export_insights" U1
- INNER JOIN "posthog_dashboarditem" U2 ON (U1."insight_id" = U2."id")
- WHERE (NOT U2."deleted"
- AND U1."subscription_id" = ("posthog_subscription"."id"))
+ FROM "posthog_subscription_dashboard_export_insights" "U1"
+ INNER JOIN "posthog_dashboarditem" "U2" ON ("U1"."insight_id" = "U2"."id")
+ WHERE (NOT "U2"."deleted"
+ AND "U1"."subscription_id" = ("posthog_subscription"."id"))
LIMIT 1)))
LIMIT 1
'''
@@ -2626,9 +2626,9 @@
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
+ (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))
@@ -3125,79 +3125,79 @@
"posthog_dashboard"."tags",
"posthog_dashboard"."share_token",
"posthog_dashboard"."is_shared",
- recent_dashboard_views."viewed_at" AS "last_viewed_at",
+ "recent_dashboard_views"."viewed_at" AS "last_viewed_at",
("posthog_dashboard"."id")::varchar AS "_ref_id",
- (SELECT U0."path" AS "path"
- FROM "posthog_filesystem" U0
- WHERE ((U0."surface" IS NULL
- OR U0."surface" = 'web')
- AND U0."ref" = ("posthog_dashboard"."id")::varchar
- AND U0."team_id" = ("posthog_dashboard"."team_id")
- AND U0."type" = 'dashboard'
- AND NOT (U0."shortcut"
- AND U0."shortcut" IS NOT NULL))
- ORDER BY U0."id" ASC
+ (SELECT "U0"."path" AS "path"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
+ ORDER BY "U0"."id" ASC
LIMIT 1) AS "_folder_path",
- (SELECT U0."id" AS "id"
- FROM "posthog_filesystem" U0
- WHERE ((U0."surface" IS NULL
- OR U0."surface" = 'web')
- AND U0."ref" = ("posthog_dashboard"."id")::varchar
- AND U0."team_id" = ("posthog_dashboard"."team_id")
- AND U0."type" = 'dashboard'
- AND NOT (U0."shortcut"
- AND U0."shortcut" IS NOT NULL))
+ (SELECT "U0"."id" AS "id"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
ORDER BY 1 ASC
LIMIT 1) AS "_folder_id",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in"
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in"
FROM "posthog_dashboard"
INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
- LEFT OUTER JOIN "posthog_filesystemviewlog" recent_dashboard_views ON ("posthog_team"."id" = recent_dashboard_views."team_id"
- AND ((recent_dashboard_views."user_id" = 99999
- AND recent_dashboard_views."type" = 'dashboard'
- AND recent_dashboard_views."ref" = ("posthog_dashboard"."id")::varchar)))
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboard"."created_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_filesystemviewlog" "recent_dashboard_views" ON ("posthog_team"."id" = "recent_dashboard_views"."team_id"
+ AND (("recent_dashboard_views"."user_id" = 99999
+ AND "recent_dashboard_views"."type" = 'dashboard'
+ AND "recent_dashboard_views"."ref" = ("posthog_dashboard"."id")::varchar)))
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboard"."created_by_id" = "T6"."id")
WHERE ("posthog_team"."project_id" = 99999
AND NOT ("posthog_dashboard"."deleted")
AND "posthog_dashboard"."id" = 99999)
@@ -3421,9 +3421,9 @@
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
+ (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))
@@ -3619,46 +3619,46 @@
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
"posthog_user"."email_opt_in",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in",
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in",
"posthog_text"."id",
"posthog_text"."body",
"posthog_text"."agent_context",
@@ -3684,97 +3684,97 @@
"posthog_dashboardwidget"."last_modified_at",
"posthog_dashboardwidget"."last_modified_by_id",
"posthog_dashboardwidget"."team_id",
- T10."id",
- T10."password",
- T10."last_login",
- T10."first_name",
- T10."last_name",
- T10."is_staff",
- T10."date_joined",
- T10."uuid",
- T10."current_organization_id",
- T10."current_team_id",
- T10."email",
- T10."pending_email",
- T10."distinct_id",
- T10."is_email_verified",
- T10."credentials_reviewed_at",
- T10."requested_password_reset_at",
- T10."requested_2fa_reset_at",
- T10."has_seen_product_intro_for",
- T10."strapi_id",
- T10."is_active",
- T10."role_at_organization",
- T10."theme_mode",
- T10."partial_notification_settings",
- T10."anonymize_data",
- T10."allow_impersonation",
- T10."toolbar_mode",
- T10."hedgehog_config",
- T10."allow_sidebar_suggestions",
- T10."shortcut_position",
- T10."passkeys_enabled_for_2fa",
- T10."hide_mcp_hints",
- T10."ui_configuration",
- T10."onboarding_skipped_at",
- T10."onboarding_skipped_reason",
- T10."onboarding_skipped_organization_id",
- T10."onboarding_delegated_to_invite_id",
- T10."onboarding_delegated_to_organization_id",
- T10."onboarding_delegation_accepted_at",
- T10."events_column_config",
- T10."email_opt_in",
- T11."id",
- T11."password",
- T11."last_login",
- T11."first_name",
- T11."last_name",
- T11."is_staff",
- T11."date_joined",
- T11."uuid",
- T11."current_organization_id",
- T11."current_team_id",
- T11."email",
- T11."pending_email",
- T11."distinct_id",
- T11."is_email_verified",
- T11."credentials_reviewed_at",
- T11."requested_password_reset_at",
- T11."requested_2fa_reset_at",
- T11."has_seen_product_intro_for",
- T11."strapi_id",
- T11."is_active",
- T11."role_at_organization",
- T11."theme_mode",
- T11."partial_notification_settings",
- T11."anonymize_data",
- T11."allow_impersonation",
- T11."toolbar_mode",
- T11."hedgehog_config",
- T11."allow_sidebar_suggestions",
- T11."shortcut_position",
- T11."passkeys_enabled_for_2fa",
- T11."hide_mcp_hints",
- T11."ui_configuration",
- T11."onboarding_skipped_at",
- T11."onboarding_skipped_reason",
- T11."onboarding_skipped_organization_id",
- T11."onboarding_delegated_to_invite_id",
- T11."onboarding_delegated_to_organization_id",
- T11."onboarding_delegation_accepted_at",
- T11."events_column_config",
- T11."email_opt_in"
+ "T10"."id",
+ "T10"."password",
+ "T10"."last_login",
+ "T10"."first_name",
+ "T10"."last_name",
+ "T10"."is_staff",
+ "T10"."date_joined",
+ "T10"."uuid",
+ "T10"."current_organization_id",
+ "T10"."current_team_id",
+ "T10"."email",
+ "T10"."pending_email",
+ "T10"."distinct_id",
+ "T10"."is_email_verified",
+ "T10"."credentials_reviewed_at",
+ "T10"."requested_password_reset_at",
+ "T10"."requested_2fa_reset_at",
+ "T10"."has_seen_product_intro_for",
+ "T10"."strapi_id",
+ "T10"."is_active",
+ "T10"."role_at_organization",
+ "T10"."theme_mode",
+ "T10"."partial_notification_settings",
+ "T10"."anonymize_data",
+ "T10"."allow_impersonation",
+ "T10"."toolbar_mode",
+ "T10"."hedgehog_config",
+ "T10"."allow_sidebar_suggestions",
+ "T10"."shortcut_position",
+ "T10"."passkeys_enabled_for_2fa",
+ "T10"."hide_mcp_hints",
+ "T10"."ui_configuration",
+ "T10"."onboarding_skipped_at",
+ "T10"."onboarding_skipped_reason",
+ "T10"."onboarding_skipped_organization_id",
+ "T10"."onboarding_delegated_to_invite_id",
+ "T10"."onboarding_delegated_to_organization_id",
+ "T10"."onboarding_delegation_accepted_at",
+ "T10"."events_column_config",
+ "T10"."email_opt_in",
+ "T11"."id",
+ "T11"."password",
+ "T11"."last_login",
+ "T11"."first_name",
+ "T11"."last_name",
+ "T11"."is_staff",
+ "T11"."date_joined",
+ "T11"."uuid",
+ "T11"."current_organization_id",
+ "T11"."current_team_id",
+ "T11"."email",
+ "T11"."pending_email",
+ "T11"."distinct_id",
+ "T11"."is_email_verified",
+ "T11"."credentials_reviewed_at",
+ "T11"."requested_password_reset_at",
+ "T11"."requested_2fa_reset_at",
+ "T11"."has_seen_product_intro_for",
+ "T11"."strapi_id",
+ "T11"."is_active",
+ "T11"."role_at_organization",
+ "T11"."theme_mode",
+ "T11"."partial_notification_settings",
+ "T11"."anonymize_data",
+ "T11"."allow_impersonation",
+ "T11"."toolbar_mode",
+ "T11"."hedgehog_config",
+ "T11"."allow_sidebar_suggestions",
+ "T11"."shortcut_position",
+ "T11"."passkeys_enabled_for_2fa",
+ "T11"."hide_mcp_hints",
+ "T11"."ui_configuration",
+ "T11"."onboarding_skipped_at",
+ "T11"."onboarding_skipped_reason",
+ "T11"."onboarding_skipped_organization_id",
+ "T11"."onboarding_delegated_to_invite_id",
+ "T11"."onboarding_delegated_to_organization_id",
+ "T11"."onboarding_delegation_accepted_at",
+ "T11"."events_column_config",
+ "T11"."email_opt_in"
FROM "posthog_dashboardtile"
INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."id")
LEFT OUTER JOIN "posthog_team" ON ("posthog_dashboarditem"."team_id" = "posthog_team"."id")
LEFT OUTER JOIN "posthog_user" ON ("posthog_dashboarditem"."created_by_id" = "posthog_user"."id")
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboarditem"."last_modified_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboarditem"."last_modified_by_id" = "T6"."id")
LEFT OUTER JOIN "posthog_text" ON ("posthog_dashboardtile"."text_id" = "posthog_text"."id")
LEFT OUTER JOIN "posthog_buttontile" ON ("posthog_dashboardtile"."button_tile_id" = "posthog_buttontile"."id")
LEFT OUTER JOIN "posthog_dashboardwidget" ON ("posthog_dashboardtile"."widget_id" = "posthog_dashboardwidget"."id")
- LEFT OUTER JOIN "posthog_user" T10 ON ("posthog_dashboardwidget"."created_by_id" = T10."id")
- LEFT OUTER JOIN "posthog_user" T11 ON ("posthog_dashboardwidget"."last_modified_by_id" = T11."id")
+ LEFT OUTER JOIN "posthog_user" "T10" ON ("posthog_dashboardwidget"."created_by_id" = "T10"."id")
+ LEFT OUTER JOIN "posthog_user" "T11" ON ("posthog_dashboardwidget"."last_modified_by_id" = "T11"."id")
WHERE (NOT ("posthog_dashboardtile"."deleted"
AND "posthog_dashboardtile"."deleted" IS NOT NULL)
AND NOT ("posthog_dashboard"."deleted")
@@ -3988,9 +3988,9 @@
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
+ (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))
@@ -4324,46 +4324,46 @@
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
"posthog_user"."email_opt_in",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in",
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in",
"posthog_text"."id",
"posthog_text"."body",
"posthog_text"."agent_context",
@@ -4389,97 +4389,97 @@
"posthog_dashboardwidget"."last_modified_at",
"posthog_dashboardwidget"."last_modified_by_id",
"posthog_dashboardwidget"."team_id",
- T10."id",
- T10."password",
- T10."last_login",
- T10."first_name",
- T10."last_name",
- T10."is_staff",
- T10."date_joined",
- T10."uuid",
- T10."current_organization_id",
- T10."current_team_id",
- T10."email",
- T10."pending_email",
- T10."distinct_id",
- T10."is_email_verified",
- T10."credentials_reviewed_at",
- T10."requested_password_reset_at",
- T10."requested_2fa_reset_at",
- T10."has_seen_product_intro_for",
- T10."strapi_id",
- T10."is_active",
- T10."role_at_organization",
- T10."theme_mode",
- T10."partial_notification_settings",
- T10."anonymize_data",
- T10."allow_impersonation",
- T10."toolbar_mode",
- T10."hedgehog_config",
- T10."allow_sidebar_suggestions",
- T10."shortcut_position",
- T10."passkeys_enabled_for_2fa",
- T10."hide_mcp_hints",
- T10."ui_configuration",
- T10."onboarding_skipped_at",
- T10."onboarding_skipped_reason",
- T10."onboarding_skipped_organization_id",
- T10."onboarding_delegated_to_invite_id",
- T10."onboarding_delegated_to_organization_id",
- T10."onboarding_delegation_accepted_at",
- T10."events_column_config",
- T10."email_opt_in",
- T11."id",
- T11."password",
- T11."last_login",
- T11."first_name",
- T11."last_name",
- T11."is_staff",
- T11."date_joined",
- T11."uuid",
- T11."current_organization_id",
- T11."current_team_id",
- T11."email",
- T11."pending_email",
- T11."distinct_id",
- T11."is_email_verified",
- T11."credentials_reviewed_at",
- T11."requested_password_reset_at",
- T11."requested_2fa_reset_at",
- T11."has_seen_product_intro_for",
- T11."strapi_id",
- T11."is_active",
- T11."role_at_organization",
- T11."theme_mode",
- T11."partial_notification_settings",
- T11."anonymize_data",
- T11."allow_impersonation",
- T11."toolbar_mode",
- T11."hedgehog_config",
- T11."allow_sidebar_suggestions",
- T11."shortcut_position",
- T11."passkeys_enabled_for_2fa",
- T11."hide_mcp_hints",
- T11."ui_configuration",
- T11."onboarding_skipped_at",
- T11."onboarding_skipped_reason",
- T11."onboarding_skipped_organization_id",
- T11."onboarding_delegated_to_invite_id",
- T11."onboarding_delegated_to_organization_id",
- T11."onboarding_delegation_accepted_at",
- T11."events_column_config",
- T11."email_opt_in"
+ "T10"."id",
+ "T10"."password",
+ "T10"."last_login",
+ "T10"."first_name",
+ "T10"."last_name",
+ "T10"."is_staff",
+ "T10"."date_joined",
+ "T10"."uuid",
+ "T10"."current_organization_id",
+ "T10"."current_team_id",
+ "T10"."email",
+ "T10"."pending_email",
+ "T10"."distinct_id",
+ "T10"."is_email_verified",
+ "T10"."credentials_reviewed_at",
+ "T10"."requested_password_reset_at",
+ "T10"."requested_2fa_reset_at",
+ "T10"."has_seen_product_intro_for",
+ "T10"."strapi_id",
+ "T10"."is_active",
+ "T10"."role_at_organization",
+ "T10"."theme_mode",
+ "T10"."partial_notification_settings",
+ "T10"."anonymize_data",
+ "T10"."allow_impersonation",
+ "T10"."toolbar_mode",
+ "T10"."hedgehog_config",
+ "T10"."allow_sidebar_suggestions",
+ "T10"."shortcut_position",
+ "T10"."passkeys_enabled_for_2fa",
+ "T10"."hide_mcp_hints",
+ "T10"."ui_configuration",
+ "T10"."onboarding_skipped_at",
+ "T10"."onboarding_skipped_reason",
+ "T10"."onboarding_skipped_organization_id",
+ "T10"."onboarding_delegated_to_invite_id",
+ "T10"."onboarding_delegated_to_organization_id",
+ "T10"."onboarding_delegation_accepted_at",
+ "T10"."events_column_config",
+ "T10"."email_opt_in",
+ "T11"."id",
+ "T11"."password",
+ "T11"."last_login",
+ "T11"."first_name",
+ "T11"."last_name",
+ "T11"."is_staff",
+ "T11"."date_joined",
+ "T11"."uuid",
+ "T11"."current_organization_id",
+ "T11"."current_team_id",
+ "T11"."email",
+ "T11"."pending_email",
+ "T11"."distinct_id",
+ "T11"."is_email_verified",
+ "T11"."credentials_reviewed_at",
+ "T11"."requested_password_reset_at",
+ "T11"."requested_2fa_reset_at",
+ "T11"."has_seen_product_intro_for",
+ "T11"."strapi_id",
+ "T11"."is_active",
+ "T11"."role_at_organization",
+ "T11"."theme_mode",
+ "T11"."partial_notification_settings",
+ "T11"."anonymize_data",
+ "T11"."allow_impersonation",
+ "T11"."toolbar_mode",
+ "T11"."hedgehog_config",
+ "T11"."allow_sidebar_suggestions",
+ "T11"."shortcut_position",
+ "T11"."passkeys_enabled_for_2fa",
+ "T11"."hide_mcp_hints",
+ "T11"."ui_configuration",
+ "T11"."onboarding_skipped_at",
+ "T11"."onboarding_skipped_reason",
+ "T11"."onboarding_skipped_organization_id",
+ "T11"."onboarding_delegated_to_invite_id",
+ "T11"."onboarding_delegated_to_organization_id",
+ "T11"."onboarding_delegation_accepted_at",
+ "T11"."events_column_config",
+ "T11"."email_opt_in"
FROM "posthog_dashboardtile"
INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."id")
LEFT OUTER JOIN "posthog_team" ON ("posthog_dashboarditem"."team_id" = "posthog_team"."id")
LEFT OUTER JOIN "posthog_user" ON ("posthog_dashboarditem"."created_by_id" = "posthog_user"."id")
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboarditem"."last_modified_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboarditem"."last_modified_by_id" = "T6"."id")
LEFT OUTER JOIN "posthog_text" ON ("posthog_dashboardtile"."text_id" = "posthog_text"."id")
LEFT OUTER JOIN "posthog_buttontile" ON ("posthog_dashboardtile"."button_tile_id" = "posthog_buttontile"."id")
LEFT OUTER JOIN "posthog_dashboardwidget" ON ("posthog_dashboardtile"."widget_id" = "posthog_dashboardwidget"."id")
- LEFT OUTER JOIN "posthog_user" T10 ON ("posthog_dashboardwidget"."created_by_id" = T10."id")
- LEFT OUTER JOIN "posthog_user" T11 ON ("posthog_dashboardwidget"."last_modified_by_id" = T11."id")
+ LEFT OUTER JOIN "posthog_user" "T10" ON ("posthog_dashboardwidget"."created_by_id" = "T10"."id")
+ LEFT OUTER JOIN "posthog_user" "T11" ON ("posthog_dashboardwidget"."last_modified_by_id" = "T11"."id")
WHERE (NOT ("posthog_dashboardtile"."deleted"
AND "posthog_dashboardtile"."deleted" IS NOT NULL)
AND NOT ("posthog_dashboard"."deleted")
@@ -4974,79 +4974,79 @@
"posthog_dashboard"."tags",
"posthog_dashboard"."share_token",
"posthog_dashboard"."is_shared",
- recent_dashboard_views."viewed_at" AS "last_viewed_at",
+ "recent_dashboard_views"."viewed_at" AS "last_viewed_at",
("posthog_dashboard"."id")::varchar AS "_ref_id",
- (SELECT U0."path" AS "path"
- FROM "posthog_filesystem" U0
- WHERE ((U0."surface" IS NULL
- OR U0."surface" = 'web')
- AND U0."ref" = ("posthog_dashboard"."id")::varchar
- AND U0."team_id" = ("posthog_dashboard"."team_id")
- AND U0."type" = 'dashboard'
- AND NOT (U0."shortcut"
- AND U0."shortcut" IS NOT NULL))
- ORDER BY U0."id" ASC
+ (SELECT "U0"."path" AS "path"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
+ ORDER BY "U0"."id" ASC
LIMIT 1) AS "_folder_path",
- (SELECT U0."id" AS "id"
- FROM "posthog_filesystem" U0
- WHERE ((U0."surface" IS NULL
- OR U0."surface" = 'web')
- AND U0."ref" = ("posthog_dashboard"."id")::varchar
- AND U0."team_id" = ("posthog_dashboard"."team_id")
- AND U0."type" = 'dashboard'
- AND NOT (U0."shortcut"
- AND U0."shortcut" IS NOT NULL))
+ (SELECT "U0"."id" AS "id"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
ORDER BY 1 ASC
LIMIT 1) AS "_folder_id",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in"
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in"
FROM "posthog_dashboard"
INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
- LEFT OUTER JOIN "posthog_filesystemviewlog" recent_dashboard_views ON ("posthog_team"."id" = recent_dashboard_views."team_id"
- AND ((recent_dashboard_views."user_id" = 99999
- AND recent_dashboard_views."type" = 'dashboard'
- AND recent_dashboard_views."ref" = ("posthog_dashboard"."id")::varchar)))
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboard"."created_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_filesystemviewlog" "recent_dashboard_views" ON ("posthog_team"."id" = "recent_dashboard_views"."team_id"
+ AND (("recent_dashboard_views"."user_id" = 99999
+ AND "recent_dashboard_views"."type" = 'dashboard'
+ AND "recent_dashboard_views"."ref" = ("posthog_dashboard"."id")::varchar)))
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboard"."created_by_id" = "T6"."id")
WHERE ("posthog_team"."project_id" = 99999
AND NOT ("posthog_dashboard"."deleted")
AND "posthog_dashboard"."id" = 99999)
@@ -5254,9 +5254,9 @@
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
+ (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))
@@ -5452,46 +5452,46 @@
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
"posthog_user"."email_opt_in",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in",
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in",
"posthog_text"."id",
"posthog_text"."body",
"posthog_text"."agent_context",
@@ -5517,97 +5517,97 @@
"posthog_dashboardwidget"."last_modified_at",
"posthog_dashboardwidget"."last_modified_by_id",
"posthog_dashboardwidget"."team_id",
- T10."id",
- T10."password",
- T10."last_login",
- T10."first_name",
- T10."last_name",
- T10."is_staff",
- T10."date_joined",
- T10."uuid",
- T10."current_organization_id",
- T10."current_team_id",
- T10."email",
- T10."pending_email",
- T10."distinct_id",
- T10."is_email_verified",
- T10."credentials_reviewed_at",
- T10."requested_password_reset_at",
- T10."requested_2fa_reset_at",
- T10."has_seen_product_intro_for",
- T10."strapi_id",
- T10."is_active",
- T10."role_at_organization",
- T10."theme_mode",
- T10."partial_notification_settings",
- T10."anonymize_data",
- T10."allow_impersonation",
- T10."toolbar_mode",
- T10."hedgehog_config",
- T10."allow_sidebar_suggestions",
- T10."shortcut_position",
- T10."passkeys_enabled_for_2fa",
- T10."hide_mcp_hints",
- T10."ui_configuration",
- T10."onboarding_skipped_at",
- T10."onboarding_skipped_reason",
- T10."onboarding_skipped_organization_id",
- T10."onboarding_delegated_to_invite_id",
- T10."onboarding_delegated_to_organization_id",
- T10."onboarding_delegation_accepted_at",
- T10."events_column_config",
- T10."email_opt_in",
- T11."id",
- T11."password",
- T11."last_login",
- T11."first_name",
- T11."last_name",
- T11."is_staff",
- T11."date_joined",
- T11."uuid",
- T11."current_organization_id",
- T11."current_team_id",
- T11."email",
- T11."pending_email",
- T11."distinct_id",
- T11."is_email_verified",
- T11."credentials_reviewed_at",
- T11."requested_password_reset_at",
- T11."requested_2fa_reset_at",
- T11."has_seen_product_intro_for",
- T11."strapi_id",
- T11."is_active",
- T11."role_at_organization",
- T11."theme_mode",
- T11."partial_notification_settings",
- T11."anonymize_data",
- T11."allow_impersonation",
- T11."toolbar_mode",
- T11."hedgehog_config",
- T11."allow_sidebar_suggestions",
- T11."shortcut_position",
- T11."passkeys_enabled_for_2fa",
- T11."hide_mcp_hints",
- T11."ui_configuration",
- T11."onboarding_skipped_at",
- T11."onboarding_skipped_reason",
- T11."onboarding_skipped_organization_id",
- T11."onboarding_delegated_to_invite_id",
- T11."onboarding_delegated_to_organization_id",
- T11."onboarding_delegation_accepted_at",
- T11."events_column_config",
- T11."email_opt_in"
+ "T10"."id",
+ "T10"."password",
+ "T10"."last_login",
+ "T10"."first_name",
+ "T10"."last_name",
+ "T10"."is_staff",
+ "T10"."date_joined",
+ "T10"."uuid",
+ "T10"."current_organization_id",
+ "T10"."current_team_id",
+ "T10"."email",
+ "T10"."pending_email",
+ "T10"."distinct_id",
+ "T10"."is_email_verified",
+ "T10"."credentials_reviewed_at",
+ "T10"."requested_password_reset_at",
+ "T10"."requested_2fa_reset_at",
+ "T10"."has_seen_product_intro_for",
+ "T10"."strapi_id",
+ "T10"."is_active",
+ "T10"."role_at_organization",
+ "T10"."theme_mode",
+ "T10"."partial_notification_settings",
+ "T10"."anonymize_data",
+ "T10"."allow_impersonation",
+ "T10"."toolbar_mode",
+ "T10"."hedgehog_config",
+ "T10"."allow_sidebar_suggestions",
+ "T10"."shortcut_position",
+ "T10"."passkeys_enabled_for_2fa",
+ "T10"."hide_mcp_hints",
+ "T10"."ui_configuration",
+ "T10"."onboarding_skipped_at",
+ "T10"."onboarding_skipped_reason",
+ "T10"."onboarding_skipped_organization_id",
+ "T10"."onboarding_delegated_to_invite_id",
+ "T10"."onboarding_delegated_to_organization_id",
+ "T10"."onboarding_delegation_accepted_at",
+ "T10"."events_column_config",
+ "T10"."email_opt_in",
+ "T11"."id",
+ "T11"."password",
+ "T11"."last_login",
+ "T11"."first_name",
+ "T11"."last_name",
+ "T11"."is_staff",
+ "T11"."date_joined",
+ "T11"."uuid",
+ "T11"."current_organization_id",
+ "T11"."current_team_id",
+ "T11"."email",
+ "T11"."pending_email",
+ "T11"."distinct_id",
+ "T11"."is_email_verified",
+ "T11"."credentials_reviewed_at",
+ "T11"."requested_password_reset_at",
+ "T11"."requested_2fa_reset_at",
+ "T11"."has_seen_product_intro_for",
+ "T11"."strapi_id",
+ "T11"."is_active",
+ "T11"."role_at_organization",
+ "T11"."theme_mode",
+ "T11"."partial_notification_settings",
+ "T11"."anonymize_data",
+ "T11"."allow_impersonation",
+ "T11"."toolbar_mode",
+ "T11"."hedgehog_config",
+ "T11"."allow_sidebar_suggestions",
+ "T11"."shortcut_position",
+ "T11"."passkeys_enabled_for_2fa",
+ "T11"."hide_mcp_hints",
+ "T11"."ui_configuration",
+ "T11"."onboarding_skipped_at",
+ "T11"."onboarding_skipped_reason",
+ "T11"."onboarding_skipped_organization_id",
+ "T11"."onboarding_delegated_to_invite_id",
+ "T11"."onboarding_delegated_to_organization_id",
+ "T11"."onboarding_delegation_accepted_at",
+ "T11"."events_column_config",
+ "T11"."email_opt_in"
FROM "posthog_dashboardtile"
INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."id")
LEFT OUTER JOIN "posthog_team" ON ("posthog_dashboarditem"."team_id" = "posthog_team"."id")
LEFT OUTER JOIN "posthog_user" ON ("posthog_dashboarditem"."created_by_id" = "posthog_user"."id")
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboarditem"."last_modified_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboarditem"."last_modified_by_id" = "T6"."id")
LEFT OUTER JOIN "posthog_text" ON ("posthog_dashboardtile"."text_id" = "posthog_text"."id")
LEFT OUTER JOIN "posthog_buttontile" ON ("posthog_dashboardtile"."button_tile_id" = "posthog_buttontile"."id")
LEFT OUTER JOIN "posthog_dashboardwidget" ON ("posthog_dashboardtile"."widget_id" = "posthog_dashboardwidget"."id")
- LEFT OUTER JOIN "posthog_user" T10 ON ("posthog_dashboardwidget"."created_by_id" = T10."id")
- LEFT OUTER JOIN "posthog_user" T11 ON ("posthog_dashboardwidget"."last_modified_by_id" = T11."id")
+ LEFT OUTER JOIN "posthog_user" "T10" ON ("posthog_dashboardwidget"."created_by_id" = "T10"."id")
+ LEFT OUTER JOIN "posthog_user" "T11" ON ("posthog_dashboardwidget"."last_modified_by_id" = "T11"."id")
WHERE (NOT ("posthog_dashboardtile"."deleted"
AND "posthog_dashboardtile"."deleted" IS NOT NULL)
AND NOT ("posthog_dashboard"."deleted")
@@ -6045,9 +6045,9 @@
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
+ (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))
@@ -6334,10 +6334,10 @@
AND "posthog_subscription"."dashboard_id" = 99999
AND NOT (EXISTS
(SELECT 1 AS "a"
- FROM "posthog_subscription_dashboard_export_insights" U1
- INNER JOIN "posthog_dashboarditem" U2 ON (U1."insight_id" = U2."id")
- WHERE (NOT U2."deleted"
- AND U1."subscription_id" = ("posthog_subscription"."id"))
+ FROM "posthog_subscription_dashboard_export_insights" "U1"
+ INNER JOIN "posthog_dashboarditem" "U2" ON ("U1"."insight_id" = "U2"."id")
+ WHERE (NOT "U2"."deleted"
+ AND "U1"."subscription_id" = ("posthog_subscription"."id"))
LIMIT 1)))
LIMIT 1
'''
@@ -6552,9 +6552,9 @@
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
+ (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))
@@ -7078,79 +7078,79 @@
"posthog_dashboard"."tags",
"posthog_dashboard"."share_token",
"posthog_dashboard"."is_shared",
- recent_dashboard_views."viewed_at" AS "last_viewed_at",
+ "recent_dashboard_views"."viewed_at" AS "last_viewed_at",
("posthog_dashboard"."id")::varchar AS "_ref_id",
- (SELECT U0."path" AS "path"
- FROM "posthog_filesystem" U0
- WHERE ((U0."surface" IS NULL
- OR U0."surface" = 'web')
- AND U0."ref" = ("posthog_dashboard"."id")::varchar
- AND U0."team_id" = ("posthog_dashboard"."team_id")
- AND U0."type" = 'dashboard'
- AND NOT (U0."shortcut"
- AND U0."shortcut" IS NOT NULL))
- ORDER BY U0."id" ASC
+ (SELECT "U0"."path" AS "path"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
+ ORDER BY "U0"."id" ASC
LIMIT 1) AS "_folder_path",
- (SELECT U0."id" AS "id"
- FROM "posthog_filesystem" U0
- WHERE ((U0."surface" IS NULL
- OR U0."surface" = 'web')
- AND U0."ref" = ("posthog_dashboard"."id")::varchar
- AND U0."team_id" = ("posthog_dashboard"."team_id")
- AND U0."type" = 'dashboard'
- AND NOT (U0."shortcut"
- AND U0."shortcut" IS NOT NULL))
+ (SELECT "U0"."id" AS "id"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
ORDER BY 1 ASC
LIMIT 1) AS "_folder_id",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in"
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in"
FROM "posthog_dashboard"
INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
- LEFT OUTER JOIN "posthog_filesystemviewlog" recent_dashboard_views ON ("posthog_team"."id" = recent_dashboard_views."team_id"
- AND ((recent_dashboard_views."user_id" = 99999
- AND recent_dashboard_views."type" = 'dashboard'
- AND recent_dashboard_views."ref" = ("posthog_dashboard"."id")::varchar)))
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboard"."created_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_filesystemviewlog" "recent_dashboard_views" ON ("posthog_team"."id" = "recent_dashboard_views"."team_id"
+ AND (("recent_dashboard_views"."user_id" = 99999
+ AND "recent_dashboard_views"."type" = 'dashboard'
+ AND "recent_dashboard_views"."ref" = ("posthog_dashboard"."id")::varchar)))
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboard"."created_by_id" = "T6"."id")
WHERE ("posthog_team"."project_id" = 99999
AND NOT ("posthog_dashboard"."deleted")
AND "posthog_dashboard"."id" = 99999)
@@ -7358,9 +7358,9 @@
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
+ (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))
@@ -7374,9 +7374,9 @@
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
+ (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))
@@ -7572,46 +7572,46 @@
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
"posthog_user"."email_opt_in",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in",
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in",
"posthog_text"."id",
"posthog_text"."body",
"posthog_text"."agent_context",
@@ -7637,97 +7637,97 @@
"posthog_dashboardwidget"."last_modified_at",
"posthog_dashboardwidget"."last_modified_by_id",
"posthog_dashboardwidget"."team_id",
- T10."id",
- T10."password",
- T10."last_login",
- T10."first_name",
- T10."last_name",
- T10."is_staff",
- T10."date_joined",
- T10."uuid",
- T10."current_organization_id",
- T10."current_team_id",
- T10."email",
- T10."pending_email",
- T10."distinct_id",
- T10."is_email_verified",
- T10."credentials_reviewed_at",
- T10."requested_password_reset_at",
- T10."requested_2fa_reset_at",
- T10."has_seen_product_intro_for",
- T10."strapi_id",
- T10."is_active",
- T10."role_at_organization",
- T10."theme_mode",
- T10."partial_notification_settings",
- T10."anonymize_data",
- T10."allow_impersonation",
- T10."toolbar_mode",
- T10."hedgehog_config",
- T10."allow_sidebar_suggestions",
- T10."shortcut_position",
- T10."passkeys_enabled_for_2fa",
- T10."hide_mcp_hints",
- T10."ui_configuration",
- T10."onboarding_skipped_at",
- T10."onboarding_skipped_reason",
- T10."onboarding_skipped_organization_id",
- T10."onboarding_delegated_to_invite_id",
- T10."onboarding_delegated_to_organization_id",
- T10."onboarding_delegation_accepted_at",
- T10."events_column_config",
- T10."email_opt_in",
- T11."id",
- T11."password",
- T11."last_login",
- T11."first_name",
- T11."last_name",
- T11."is_staff",
- T11."date_joined",
- T11."uuid",
- T11."current_organization_id",
- T11."current_team_id",
- T11."email",
- T11."pending_email",
- T11."distinct_id",
- T11."is_email_verified",
- T11."credentials_reviewed_at",
- T11."requested_password_reset_at",
- T11."requested_2fa_reset_at",
- T11."has_seen_product_intro_for",
- T11."strapi_id",
- T11."is_active",
- T11."role_at_organization",
- T11."theme_mode",
- T11."partial_notification_settings",
- T11."anonymize_data",
- T11."allow_impersonation",
- T11."toolbar_mode",
- T11."hedgehog_config",
- T11."allow_sidebar_suggestions",
- T11."shortcut_position",
- T11."passkeys_enabled_for_2fa",
- T11."hide_mcp_hints",
- T11."ui_configuration",
- T11."onboarding_skipped_at",
- T11."onboarding_skipped_reason",
- T11."onboarding_skipped_organization_id",
- T11."onboarding_delegated_to_invite_id",
- T11."onboarding_delegated_to_organization_id",
- T11."onboarding_delegation_accepted_at",
- T11."events_column_config",
- T11."email_opt_in"
+ "T10"."id",
+ "T10"."password",
+ "T10"."last_login",
+ "T10"."first_name",
+ "T10"."last_name",
+ "T10"."is_staff",
+ "T10"."date_joined",
+ "T10"."uuid",
+ "T10"."current_organization_id",
+ "T10"."current_team_id",
+ "T10"."email",
+ "T10"."pending_email",
+ "T10"."distinct_id",
+ "T10"."is_email_verified",
+ "T10"."credentials_reviewed_at",
+ "T10"."requested_password_reset_at",
+ "T10"."requested_2fa_reset_at",
+ "T10"."has_seen_product_intro_for",
+ "T10"."strapi_id",
+ "T10"."is_active",
+ "T10"."role_at_organization",
+ "T10"."theme_mode",
+ "T10"."partial_notification_settings",
+ "T10"."anonymize_data",
+ "T10"."allow_impersonation",
+ "T10"."toolbar_mode",
+ "T10"."hedgehog_config",
+ "T10"."allow_sidebar_suggestions",
+ "T10"."shortcut_position",
+ "T10"."passkeys_enabled_for_2fa",
+ "T10"."hide_mcp_hints",
+ "T10"."ui_configuration",
+ "T10"."onboarding_skipped_at",
+ "T10"."onboarding_skipped_reason",
+ "T10"."onboarding_skipped_organization_id",
+ "T10"."onboarding_delegated_to_invite_id",
+ "T10"."onboarding_delegated_to_organization_id",
+ "T10"."onboarding_delegation_accepted_at",
+ "T10"."events_column_config",
+ "T10"."email_opt_in",
+ "T11"."id",
+ "T11"."password",
+ "T11"."last_login",
+ "T11"."first_name",
+ "T11"."last_name",
+ "T11"."is_staff",
+ "T11"."date_joined",
+ "T11"."uuid",
+ "T11"."current_organization_id",
+ "T11"."current_team_id",
+ "T11"."email",
+ "T11"."pending_email",
+ "T11"."distinct_id",
+ "T11"."is_email_verified",
+ "T11"."credentials_reviewed_at",
+ "T11"."requested_password_reset_at",
+ "T11"."requested_2fa_reset_at",
+ "T11"."has_seen_product_intro_for",
+ "T11"."strapi_id",
+ "T11"."is_active",
+ "T11"."role_at_organization",
+ "T11"."theme_mode",
+ "T11"."partial_notification_settings",
+ "T11"."anonymize_data",
+ "T11"."allow_impersonation",
+ "T11"."toolbar_mode",
+ "T11"."hedgehog_config",
+ "T11"."allow_sidebar_suggestions",
+ "T11"."shortcut_position",
+ "T11"."passkeys_enabled_for_2fa",
+ "T11"."hide_mcp_hints",
+ "T11"."ui_configuration",
+ "T11"."onboarding_skipped_at",
+ "T11"."onboarding_skipped_reason",
+ "T11"."onboarding_skipped_organization_id",
+ "T11"."onboarding_delegated_to_invite_id",
+ "T11"."onboarding_delegated_to_organization_id",
+ "T11"."onboarding_delegation_accepted_at",
+ "T11"."events_column_config",
+ "T11"."email_opt_in"
FROM "posthog_dashboardtile"
INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."id")
LEFT OUTER JOIN "posthog_team" ON ("posthog_dashboarditem"."team_id" = "posthog_team"."id")
LEFT OUTER JOIN "posthog_user" ON ("posthog_dashboarditem"."created_by_id" = "posthog_user"."id")
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboarditem"."last_modified_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboarditem"."last_modified_by_id" = "T6"."id")
LEFT OUTER JOIN "posthog_text" ON ("posthog_dashboardtile"."text_id" = "posthog_text"."id")
LEFT OUTER JOIN "posthog_buttontile" ON ("posthog_dashboardtile"."button_tile_id" = "posthog_buttontile"."id")
LEFT OUTER JOIN "posthog_dashboardwidget" ON ("posthog_dashboardtile"."widget_id" = "posthog_dashboardwidget"."id")
- LEFT OUTER JOIN "posthog_user" T10 ON ("posthog_dashboardwidget"."created_by_id" = T10."id")
- LEFT OUTER JOIN "posthog_user" T11 ON ("posthog_dashboardwidget"."last_modified_by_id" = T11."id")
+ LEFT OUTER JOIN "posthog_user" "T10" ON ("posthog_dashboardwidget"."created_by_id" = "T10"."id")
+ LEFT OUTER JOIN "posthog_user" "T11" ON ("posthog_dashboardwidget"."last_modified_by_id" = "T11"."id")
WHERE (NOT ("posthog_dashboardtile"."deleted"
AND "posthog_dashboardtile"."deleted" IS NOT NULL)
AND NOT ("posthog_dashboard"."deleted")
@@ -8411,9 +8411,9 @@
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
+ (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))
@@ -9046,9 +9046,9 @@
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
+ (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))
@@ -9664,9 +9664,9 @@
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
+ (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))
@@ -10120,9 +10120,9 @@
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
+ (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))
@@ -10706,9 +10706,9 @@
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
+ (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))
@@ -11154,10 +11154,10 @@
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)))
+ 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'))
@@ -11186,79 +11186,79 @@
"posthog_dashboard"."tags",
"posthog_dashboard"."share_token",
"posthog_dashboard"."is_shared",
- recent_dashboard_views."viewed_at" AS "last_viewed_at",
+ "recent_dashboard_views"."viewed_at" AS "last_viewed_at",
("posthog_dashboard"."id")::varchar AS "_ref_id",
- (SELECT U0."path" AS "path"
- FROM "posthog_filesystem" U0
- WHERE ((U0."surface" IS NULL
- OR U0."surface" = 'web')
- AND U0."ref" = ("posthog_dashboard"."id")::varchar
- AND U0."team_id" = ("posthog_dashboard"."team_id")
- AND U0."type" = 'dashboard'
- AND NOT (U0."shortcut"
- AND U0."shortcut" IS NOT NULL))
- ORDER BY U0."id" ASC
+ (SELECT "U0"."path" AS "path"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
+ ORDER BY "U0"."id" ASC
LIMIT 1) AS "_folder_path",
- (SELECT U0."id" AS "id"
- FROM "posthog_filesystem" U0
- WHERE ((U0."surface" IS NULL
- OR U0."surface" = 'web')
- AND U0."ref" = ("posthog_dashboard"."id")::varchar
- AND U0."team_id" = ("posthog_dashboard"."team_id")
- AND U0."type" = 'dashboard'
- AND NOT (U0."shortcut"
- AND U0."shortcut" IS NOT NULL))
+ (SELECT "U0"."id" AS "id"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
ORDER BY 1 ASC
LIMIT 1) AS "_folder_id",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in"
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in"
FROM "posthog_dashboard"
INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
- LEFT OUTER JOIN "posthog_filesystemviewlog" recent_dashboard_views ON ("posthog_team"."id" = recent_dashboard_views."team_id"
- AND ((recent_dashboard_views."user_id" = 99999
- AND recent_dashboard_views."type" = 'dashboard'
- AND recent_dashboard_views."ref" = ("posthog_dashboard"."id")::varchar)))
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboard"."created_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_filesystemviewlog" "recent_dashboard_views" ON ("posthog_team"."id" = "recent_dashboard_views"."team_id"
+ AND (("recent_dashboard_views"."user_id" = 99999
+ AND "recent_dashboard_views"."type" = 'dashboard'
+ AND "recent_dashboard_views"."ref" = ("posthog_dashboard"."id")::varchar)))
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboard"."created_by_id" = "T6"."id")
WHERE ("posthog_team"."project_id" = 99999
AND NOT ("posthog_dashboard"."deleted")
AND NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))
@@ -11691,9 +11691,9 @@
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
+ (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))
@@ -11970,9 +11970,9 @@
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
+ (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))
@@ -12168,46 +12168,46 @@
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
"posthog_user"."email_opt_in",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in",
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in",
"posthog_text"."id",
"posthog_text"."body",
"posthog_text"."agent_context",
@@ -12233,97 +12233,97 @@
"posthog_dashboardwidget"."last_modified_at",
"posthog_dashboardwidget"."last_modified_by_id",
"posthog_dashboardwidget"."team_id",
- T10."id",
- T10."password",
- T10."last_login",
- T10."first_name",
- T10."last_name",
- T10."is_staff",
- T10."date_joined",
- T10."uuid",
- T10."current_organization_id",
- T10."current_team_id",
- T10."email",
- T10."pending_email",
- T10."distinct_id",
- T10."is_email_verified",
- T10."credentials_reviewed_at",
- T10."requested_password_reset_at",
- T10."requested_2fa_reset_at",
- T10."has_seen_product_intro_for",
- T10."strapi_id",
- T10."is_active",
- T10."role_at_organization",
- T10."theme_mode",
- T10."partial_notification_settings",
- T10."anonymize_data",
- T10."allow_impersonation",
- T10."toolbar_mode",
- T10."hedgehog_config",
- T10."allow_sidebar_suggestions",
- T10."shortcut_position",
- T10."passkeys_enabled_for_2fa",
- T10."hide_mcp_hints",
- T10."ui_configuration",
- T10."onboarding_skipped_at",
- T10."onboarding_skipped_reason",
- T10."onboarding_skipped_organization_id",
- T10."onboarding_delegated_to_invite_id",
- T10."onboarding_delegated_to_organization_id",
- T10."onboarding_delegation_accepted_at",
- T10."events_column_config",
- T10."email_opt_in",
- T11."id",
- T11."password",
- T11."last_login",
- T11."first_name",
- T11."last_name",
- T11."is_staff",
- T11."date_joined",
- T11."uuid",
- T11."current_organization_id",
- T11."current_team_id",
- T11."email",
- T11."pending_email",
- T11."distinct_id",
- T11."is_email_verified",
- T11."credentials_reviewed_at",
- T11."requested_password_reset_at",
- T11."requested_2fa_reset_at",
- T11."has_seen_product_intro_for",
- T11."strapi_id",
- T11."is_active",
- T11."role_at_organization",
- T11."theme_mode",
- T11."partial_notification_settings",
- T11."anonymize_data",
- T11."allow_impersonation",
- T11."toolbar_mode",
- T11."hedgehog_config",
- T11."allow_sidebar_suggestions",
- T11."shortcut_position",
- T11."passkeys_enabled_for_2fa",
- T11."hide_mcp_hints",
- T11."ui_configuration",
- T11."onboarding_skipped_at",
- T11."onboarding_skipped_reason",
- T11."onboarding_skipped_organization_id",
- T11."onboarding_delegated_to_invite_id",
- T11."onboarding_delegated_to_organization_id",
- T11."onboarding_delegation_accepted_at",
- T11."events_column_config",
- T11."email_opt_in"
+ "T10"."id",
+ "T10"."password",
+ "T10"."last_login",
+ "T10"."first_name",
+ "T10"."last_name",
+ "T10"."is_staff",
+ "T10"."date_joined",
+ "T10"."uuid",
+ "T10"."current_organization_id",
+ "T10"."current_team_id",
+ "T10"."email",
+ "T10"."pending_email",
+ "T10"."distinct_id",
+ "T10"."is_email_verified",
+ "T10"."credentials_reviewed_at",
+ "T10"."requested_password_reset_at",
+ "T10"."requested_2fa_reset_at",
+ "T10"."has_seen_product_intro_for",
+ "T10"."strapi_id",
+ "T10"."is_active",
+ "T10"."role_at_organization",
+ "T10"."theme_mode",
+ "T10"."partial_notification_settings",
+ "T10"."anonymize_data",
+ "T10"."allow_impersonation",
+ "T10"."toolbar_mode",
+ "T10"."hedgehog_config",
+ "T10"."allow_sidebar_suggestions",
+ "T10"."shortcut_position",
+ "T10"."passkeys_enabled_for_2fa",
+ "T10"."hide_mcp_hints",
+ "T10"."ui_configuration",
+ "T10"."onboarding_skipped_at",
+ "T10"."onboarding_skipped_reason",
+ "T10"."onboarding_skipped_organization_id",
+ "T10"."onboarding_delegated_to_invite_id",
+ "T10"."onboarding_delegated_to_organization_id",
+ "T10"."onboarding_delegation_accepted_at",
+ "T10"."events_column_config",
+ "T10"."email_opt_in",
+ "T11"."id",
+ "T11"."password",
+ "T11"."last_login",
+ "T11"."first_name",
+ "T11"."last_name",
+ "T11"."is_staff",
+ "T11"."date_joined",
+ "T11"."uuid",
+ "T11"."current_organization_id",
+ "T11"."current_team_id",
+ "T11"."email",
+ "T11"."pending_email",
+ "T11"."distinct_id",
+ "T11"."is_email_verified",
+ "T11"."credentials_reviewed_at",
+ "T11"."requested_password_reset_at",
+ "T11"."requested_2fa_reset_at",
+ "T11"."has_seen_product_intro_for",
+ "T11"."strapi_id",
+ "T11"."is_active",
+ "T11"."role_at_organization",
+ "T11"."theme_mode",
+ "T11"."partial_notification_settings",
+ "T11"."anonymize_data",
+ "T11"."allow_impersonation",
+ "T11"."toolbar_mode",
+ "T11"."hedgehog_config",
+ "T11"."allow_sidebar_suggestions",
+ "T11"."shortcut_position",
+ "T11"."passkeys_enabled_for_2fa",
+ "T11"."hide_mcp_hints",
+ "T11"."ui_configuration",
+ "T11"."onboarding_skipped_at",
+ "T11"."onboarding_skipped_reason",
+ "T11"."onboarding_skipped_organization_id",
+ "T11"."onboarding_delegated_to_invite_id",
+ "T11"."onboarding_delegated_to_organization_id",
+ "T11"."onboarding_delegation_accepted_at",
+ "T11"."events_column_config",
+ "T11"."email_opt_in"
FROM "posthog_dashboardtile"
INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."id")
LEFT OUTER JOIN "posthog_team" ON ("posthog_dashboarditem"."team_id" = "posthog_team"."id")
LEFT OUTER JOIN "posthog_user" ON ("posthog_dashboarditem"."created_by_id" = "posthog_user"."id")
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboarditem"."last_modified_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboarditem"."last_modified_by_id" = "T6"."id")
LEFT OUTER JOIN "posthog_text" ON ("posthog_dashboardtile"."text_id" = "posthog_text"."id")
LEFT OUTER JOIN "posthog_buttontile" ON ("posthog_dashboardtile"."button_tile_id" = "posthog_buttontile"."id")
LEFT OUTER JOIN "posthog_dashboardwidget" ON ("posthog_dashboardtile"."widget_id" = "posthog_dashboardwidget"."id")
- LEFT OUTER JOIN "posthog_user" T10 ON ("posthog_dashboardwidget"."created_by_id" = T10."id")
- LEFT OUTER JOIN "posthog_user" T11 ON ("posthog_dashboardwidget"."last_modified_by_id" = T11."id")
+ LEFT OUTER JOIN "posthog_user" "T10" ON ("posthog_dashboardwidget"."created_by_id" = "T10"."id")
+ LEFT OUTER JOIN "posthog_user" "T11" ON ("posthog_dashboardwidget"."last_modified_by_id" = "T11"."id")
WHERE (NOT ("posthog_dashboardtile"."deleted"
AND "posthog_dashboardtile"."deleted" IS NOT NULL)
AND NOT ("posthog_dashboard"."deleted")
@@ -12729,9 +12729,9 @@
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
+ (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))
@@ -13324,9 +13324,9 @@
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
+ (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))
@@ -13836,9 +13836,9 @@
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
+ (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))
@@ -14424,9 +14424,9 @@
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
+ (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))
@@ -14878,9 +14878,9 @@
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
+ (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))
@@ -15468,9 +15468,9 @@
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
+ (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))
@@ -15911,10 +15911,10 @@
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)))
+ 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'))
@@ -15943,79 +15943,79 @@
"posthog_dashboard"."tags",
"posthog_dashboard"."share_token",
"posthog_dashboard"."is_shared",
- recent_dashboard_views."viewed_at" AS "last_viewed_at",
+ "recent_dashboard_views"."viewed_at" AS "last_viewed_at",
("posthog_dashboard"."id")::varchar AS "_ref_id",
- (SELECT U0."path" AS "path"
- FROM "posthog_filesystem" U0
- WHERE ((U0."surface" IS NULL
- OR U0."surface" = 'web')
- AND U0."ref" = ("posthog_dashboard"."id")::varchar
- AND U0."team_id" = ("posthog_dashboard"."team_id")
- AND U0."type" = 'dashboard'
- AND NOT (U0."shortcut"
- AND U0."shortcut" IS NOT NULL))
- ORDER BY U0."id" ASC
+ (SELECT "U0"."path" AS "path"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
+ ORDER BY "U0"."id" ASC
LIMIT 1) AS "_folder_path",
- (SELECT U0."id" AS "id"
- FROM "posthog_filesystem" U0
- WHERE ((U0."surface" IS NULL
- OR U0."surface" = 'web')
- AND U0."ref" = ("posthog_dashboard"."id")::varchar
- AND U0."team_id" = ("posthog_dashboard"."team_id")
- AND U0."type" = 'dashboard'
- AND NOT (U0."shortcut"
- AND U0."shortcut" IS NOT NULL))
+ (SELECT "U0"."id" AS "id"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
ORDER BY 1 ASC
LIMIT 1) AS "_folder_id",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in"
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in"
FROM "posthog_dashboard"
INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
- LEFT OUTER JOIN "posthog_filesystemviewlog" recent_dashboard_views ON ("posthog_team"."id" = recent_dashboard_views."team_id"
- AND ((recent_dashboard_views."user_id" = 99999
- AND recent_dashboard_views."type" = 'dashboard'
- AND recent_dashboard_views."ref" = ("posthog_dashboard"."id")::varchar)))
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboard"."created_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_filesystemviewlog" "recent_dashboard_views" ON ("posthog_team"."id" = "recent_dashboard_views"."team_id"
+ AND (("recent_dashboard_views"."user_id" = 99999
+ AND "recent_dashboard_views"."type" = 'dashboard'
+ AND "recent_dashboard_views"."ref" = ("posthog_dashboard"."id")::varchar)))
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboard"."created_by_id" = "T6"."id")
WHERE ("posthog_team"."project_id" = 99999
AND NOT ("posthog_dashboard"."deleted")
AND NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))
@@ -16449,9 +16449,9 @@
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
+ (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))
@@ -16724,9 +16724,9 @@
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
+ (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))
@@ -16938,46 +16938,46 @@
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
"posthog_user"."email_opt_in",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in",
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in",
"posthog_text"."id",
"posthog_text"."body",
"posthog_text"."agent_context",
@@ -17003,97 +17003,97 @@
"posthog_dashboardwidget"."last_modified_at",
"posthog_dashboardwidget"."last_modified_by_id",
"posthog_dashboardwidget"."team_id",
- T10."id",
- T10."password",
- T10."last_login",
- T10."first_name",
- T10."last_name",
- T10."is_staff",
- T10."date_joined",
- T10."uuid",
- T10."current_organization_id",
- T10."current_team_id",
- T10."email",
- T10."pending_email",
- T10."distinct_id",
- T10."is_email_verified",
- T10."credentials_reviewed_at",
- T10."requested_password_reset_at",
- T10."requested_2fa_reset_at",
- T10."has_seen_product_intro_for",
- T10."strapi_id",
- T10."is_active",
- T10."role_at_organization",
- T10."theme_mode",
- T10."partial_notification_settings",
- T10."anonymize_data",
- T10."allow_impersonation",
- T10."toolbar_mode",
- T10."hedgehog_config",
- T10."allow_sidebar_suggestions",
- T10."shortcut_position",
- T10."passkeys_enabled_for_2fa",
- T10."hide_mcp_hints",
- T10."ui_configuration",
- T10."onboarding_skipped_at",
- T10."onboarding_skipped_reason",
- T10."onboarding_skipped_organization_id",
- T10."onboarding_delegated_to_invite_id",
- T10."onboarding_delegated_to_organization_id",
- T10."onboarding_delegation_accepted_at",
- T10."events_column_config",
- T10."email_opt_in",
- T11."id",
- T11."password",
- T11."last_login",
- T11."first_name",
- T11."last_name",
- T11."is_staff",
- T11."date_joined",
- T11."uuid",
- T11."current_organization_id",
- T11."current_team_id",
- T11."email",
- T11."pending_email",
- T11."distinct_id",
- T11."is_email_verified",
- T11."credentials_reviewed_at",
- T11."requested_password_reset_at",
- T11."requested_2fa_reset_at",
- T11."has_seen_product_intro_for",
- T11."strapi_id",
- T11."is_active",
- T11."role_at_organization",
- T11."theme_mode",
- T11."partial_notification_settings",
- T11."anonymize_data",
- T11."allow_impersonation",
- T11."toolbar_mode",
- T11."hedgehog_config",
- T11."allow_sidebar_suggestions",
- T11."shortcut_position",
- T11."passkeys_enabled_for_2fa",
- T11."hide_mcp_hints",
- T11."ui_configuration",
- T11."onboarding_skipped_at",
- T11."onboarding_skipped_reason",
- T11."onboarding_skipped_organization_id",
- T11."onboarding_delegated_to_invite_id",
- T11."onboarding_delegated_to_organization_id",
- T11."onboarding_delegation_accepted_at",
- T11."events_column_config",
- T11."email_opt_in"
+ "T10"."id",
+ "T10"."password",
+ "T10"."last_login",
+ "T10"."first_name",
+ "T10"."last_name",
+ "T10"."is_staff",
+ "T10"."date_joined",
+ "T10"."uuid",
+ "T10"."current_organization_id",
+ "T10"."current_team_id",
+ "T10"."email",
+ "T10"."pending_email",
+ "T10"."distinct_id",
+ "T10"."is_email_verified",
+ "T10"."credentials_reviewed_at",
+ "T10"."requested_password_reset_at",
+ "T10"."requested_2fa_reset_at",
+ "T10"."has_seen_product_intro_for",
+ "T10"."strapi_id",
+ "T10"."is_active",
+ "T10"."role_at_organization",
+ "T10"."theme_mode",
+ "T10"."partial_notification_settings",
+ "T10"."anonymize_data",
+ "T10"."allow_impersonation",
+ "T10"."toolbar_mode",
+ "T10"."hedgehog_config",
+ "T10"."allow_sidebar_suggestions",
+ "T10"."shortcut_position",
+ "T10"."passkeys_enabled_for_2fa",
+ "T10"."hide_mcp_hints",
+ "T10"."ui_configuration",
+ "T10"."onboarding_skipped_at",
+ "T10"."onboarding_skipped_reason",
+ "T10"."onboarding_skipped_organization_id",
+ "T10"."onboarding_delegated_to_invite_id",
+ "T10"."onboarding_delegated_to_organization_id",
+ "T10"."onboarding_delegation_accepted_at",
+ "T10"."events_column_config",
+ "T10"."email_opt_in",
+ "T11"."id",
+ "T11"."password",
+ "T11"."last_login",
+ "T11"."first_name",
+ "T11"."last_name",
+ "T11"."is_staff",
+ "T11"."date_joined",
+ "T11"."uuid",
+ "T11"."current_organization_id",
+ "T11"."current_team_id",
+ "T11"."email",
+ "T11"."pending_email",
+ "T11"."distinct_id",
+ "T11"."is_email_verified",
+ "T11"."credentials_reviewed_at",
+ "T11"."requested_password_reset_at",
+ "T11"."requested_2fa_reset_at",
+ "T11"."has_seen_product_intro_for",
+ "T11"."strapi_id",
+ "T11"."is_active",
+ "T11"."role_at_organization",
+ "T11"."theme_mode",
+ "T11"."partial_notification_settings",
+ "T11"."anonymize_data",
+ "T11"."allow_impersonation",
+ "T11"."toolbar_mode",
+ "T11"."hedgehog_config",
+ "T11"."allow_sidebar_suggestions",
+ "T11"."shortcut_position",
+ "T11"."passkeys_enabled_for_2fa",
+ "T11"."hide_mcp_hints",
+ "T11"."ui_configuration",
+ "T11"."onboarding_skipped_at",
+ "T11"."onboarding_skipped_reason",
+ "T11"."onboarding_skipped_organization_id",
+ "T11"."onboarding_delegated_to_invite_id",
+ "T11"."onboarding_delegated_to_organization_id",
+ "T11"."onboarding_delegation_accepted_at",
+ "T11"."events_column_config",
+ "T11"."email_opt_in"
FROM "posthog_dashboardtile"
INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."id")
LEFT OUTER JOIN "posthog_team" ON ("posthog_dashboarditem"."team_id" = "posthog_team"."id")
LEFT OUTER JOIN "posthog_user" ON ("posthog_dashboarditem"."created_by_id" = "posthog_user"."id")
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboarditem"."last_modified_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboarditem"."last_modified_by_id" = "T6"."id")
LEFT OUTER JOIN "posthog_text" ON ("posthog_dashboardtile"."text_id" = "posthog_text"."id")
LEFT OUTER JOIN "posthog_buttontile" ON ("posthog_dashboardtile"."button_tile_id" = "posthog_buttontile"."id")
LEFT OUTER JOIN "posthog_dashboardwidget" ON ("posthog_dashboardtile"."widget_id" = "posthog_dashboardwidget"."id")
- LEFT OUTER JOIN "posthog_user" T10 ON ("posthog_dashboardwidget"."created_by_id" = T10."id")
- LEFT OUTER JOIN "posthog_user" T11 ON ("posthog_dashboardwidget"."last_modified_by_id" = T11."id")
+ LEFT OUTER JOIN "posthog_user" "T10" ON ("posthog_dashboardwidget"."created_by_id" = "T10"."id")
+ LEFT OUTER JOIN "posthog_user" "T11" ON ("posthog_dashboardwidget"."last_modified_by_id" = "T11"."id")
WHERE (NOT ("posthog_dashboardtile"."deleted"
AND "posthog_dashboardtile"."deleted" IS NOT NULL)
AND NOT ("posthog_dashboard"."deleted")
@@ -17483,9 +17483,9 @@
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
+ (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))
@@ -18088,9 +18088,9 @@
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
+ (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))
@@ -18534,9 +18534,9 @@
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
+ (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))
@@ -19116,9 +19116,9 @@
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
+ (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))
@@ -19558,9 +19558,9 @@
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
+ (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))
@@ -20140,9 +20140,9 @@
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
+ (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))
@@ -20593,10 +20593,10 @@
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)))
+ 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'))
@@ -20625,79 +20625,79 @@
"posthog_dashboard"."tags",
"posthog_dashboard"."share_token",
"posthog_dashboard"."is_shared",
- recent_dashboard_views."viewed_at" AS "last_viewed_at",
+ "recent_dashboard_views"."viewed_at" AS "last_viewed_at",
("posthog_dashboard"."id")::varchar AS "_ref_id",
- (SELECT U0."path" AS "path"
- FROM "posthog_filesystem" U0
- WHERE ((U0."surface" IS NULL
- OR U0."surface" = 'web')
- AND U0."ref" = ("posthog_dashboard"."id")::varchar
- AND U0."team_id" = ("posthog_dashboard"."team_id")
- AND U0."type" = 'dashboard'
- AND NOT (U0."shortcut"
- AND U0."shortcut" IS NOT NULL))
- ORDER BY U0."id" ASC
+ (SELECT "U0"."path" AS "path"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
+ ORDER BY "U0"."id" ASC
LIMIT 1) AS "_folder_path",
- (SELECT U0."id" AS "id"
- FROM "posthog_filesystem" U0
- WHERE ((U0."surface" IS NULL
- OR U0."surface" = 'web')
- AND U0."ref" = ("posthog_dashboard"."id")::varchar
- AND U0."team_id" = ("posthog_dashboard"."team_id")
- AND U0."type" = 'dashboard'
- AND NOT (U0."shortcut"
- AND U0."shortcut" IS NOT NULL))
+ (SELECT "U0"."id" AS "id"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
ORDER BY 1 ASC
LIMIT 1) AS "_folder_id",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in"
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in"
FROM "posthog_dashboard"
INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
- LEFT OUTER JOIN "posthog_filesystemviewlog" recent_dashboard_views ON ("posthog_team"."id" = recent_dashboard_views."team_id"
- AND ((recent_dashboard_views."user_id" = 99999
- AND recent_dashboard_views."type" = 'dashboard'
- AND recent_dashboard_views."ref" = ("posthog_dashboard"."id")::varchar)))
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboard"."created_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_filesystemviewlog" "recent_dashboard_views" ON ("posthog_team"."id" = "recent_dashboard_views"."team_id"
+ AND (("recent_dashboard_views"."user_id" = 99999
+ AND "recent_dashboard_views"."type" = 'dashboard'
+ AND "recent_dashboard_views"."ref" = ("posthog_dashboard"."id")::varchar)))
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboard"."created_by_id" = "T6"."id")
WHERE ("posthog_team"."project_id" = 99999
AND NOT ("posthog_dashboard"."deleted")
AND NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))
@@ -21218,9 +21218,9 @@
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
+ (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))
@@ -21528,9 +21528,9 @@
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
+ (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))
@@ -21726,46 +21726,46 @@
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
"posthog_user"."email_opt_in",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in",
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in",
"posthog_text"."id",
"posthog_text"."body",
"posthog_text"."agent_context",
@@ -21791,97 +21791,97 @@
"posthog_dashboardwidget"."last_modified_at",
"posthog_dashboardwidget"."last_modified_by_id",
"posthog_dashboardwidget"."team_id",
- T10."id",
- T10."password",
- T10."last_login",
- T10."first_name",
- T10."last_name",
- T10."is_staff",
- T10."date_joined",
- T10."uuid",
- T10."current_organization_id",
- T10."current_team_id",
- T10."email",
- T10."pending_email",
- T10."distinct_id",
- T10."is_email_verified",
- T10."credentials_reviewed_at",
- T10."requested_password_reset_at",
- T10."requested_2fa_reset_at",
- T10."has_seen_product_intro_for",
- T10."strapi_id",
- T10."is_active",
- T10."role_at_organization",
- T10."theme_mode",
- T10."partial_notification_settings",
- T10."anonymize_data",
- T10."allow_impersonation",
- T10."toolbar_mode",
- T10."hedgehog_config",
- T10."allow_sidebar_suggestions",
- T10."shortcut_position",
- T10."passkeys_enabled_for_2fa",
- T10."hide_mcp_hints",
- T10."ui_configuration",
- T10."onboarding_skipped_at",
- T10."onboarding_skipped_reason",
- T10."onboarding_skipped_organization_id",
- T10."onboarding_delegated_to_invite_id",
- T10."onboarding_delegated_to_organization_id",
- T10."onboarding_delegation_accepted_at",
- T10."events_column_config",
- T10."email_opt_in",
- T11."id",
- T11."password",
- T11."last_login",
- T11."first_name",
- T11."last_name",
- T11."is_staff",
- T11."date_joined",
- T11."uuid",
- T11."current_organization_id",
- T11."current_team_id",
- T11."email",
- T11."pending_email",
- T11."distinct_id",
- T11."is_email_verified",
- T11."credentials_reviewed_at",
- T11."requested_password_reset_at",
- T11."requested_2fa_reset_at",
- T11."has_seen_product_intro_for",
- T11."strapi_id",
- T11."is_active",
- T11."role_at_organization",
- T11."theme_mode",
- T11."partial_notification_settings",
- T11."anonymize_data",
- T11."allow_impersonation",
- T11."toolbar_mode",
- T11."hedgehog_config",
- T11."allow_sidebar_suggestions",
- T11."shortcut_position",
- T11."passkeys_enabled_for_2fa",
- T11."hide_mcp_hints",
- T11."ui_configuration",
- T11."onboarding_skipped_at",
- T11."onboarding_skipped_reason",
- T11."onboarding_skipped_organization_id",
- T11."onboarding_delegated_to_invite_id",
- T11."onboarding_delegated_to_organization_id",
- T11."onboarding_delegation_accepted_at",
- T11."events_column_config",
- T11."email_opt_in"
+ "T10"."id",
+ "T10"."password",
+ "T10"."last_login",
+ "T10"."first_name",
+ "T10"."last_name",
+ "T10"."is_staff",
+ "T10"."date_joined",
+ "T10"."uuid",
+ "T10"."current_organization_id",
+ "T10"."current_team_id",
+ "T10"."email",
+ "T10"."pending_email",
+ "T10"."distinct_id",
+ "T10"."is_email_verified",
+ "T10"."credentials_reviewed_at",
+ "T10"."requested_password_reset_at",
+ "T10"."requested_2fa_reset_at",
+ "T10"."has_seen_product_intro_for",
+ "T10"."strapi_id",
+ "T10"."is_active",
+ "T10"."role_at_organization",
+ "T10"."theme_mode",
+ "T10"."partial_notification_settings",
+ "T10"."anonymize_data",
+ "T10"."allow_impersonation",
+ "T10"."toolbar_mode",
+ "T10"."hedgehog_config",
+ "T10"."allow_sidebar_suggestions",
+ "T10"."shortcut_position",
+ "T10"."passkeys_enabled_for_2fa",
+ "T10"."hide_mcp_hints",
+ "T10"."ui_configuration",
+ "T10"."onboarding_skipped_at",
+ "T10"."onboarding_skipped_reason",
+ "T10"."onboarding_skipped_organization_id",
+ "T10"."onboarding_delegated_to_invite_id",
+ "T10"."onboarding_delegated_to_organization_id",
+ "T10"."onboarding_delegation_accepted_at",
+ "T10"."events_column_config",
+ "T10"."email_opt_in",
+ "T11"."id",
+ "T11"."password",
+ "T11"."last_login",
+ "T11"."first_name",
+ "T11"."last_name",
+ "T11"."is_staff",
+ "T11"."date_joined",
+ "T11"."uuid",
+ "T11"."current_organization_id",
+ "T11"."current_team_id",
+ "T11"."email",
+ "T11"."pending_email",
+ "T11"."distinct_id",
+ "T11"."is_email_verified",
+ "T11"."credentials_reviewed_at",
+ "T11"."requested_password_reset_at",
+ "T11"."requested_2fa_reset_at",
+ "T11"."has_seen_product_intro_for",
+ "T11"."strapi_id",
+ "T11"."is_active",
+ "T11"."role_at_organization",
+ "T11"."theme_mode",
+ "T11"."partial_notification_settings",
+ "T11"."anonymize_data",
+ "T11"."allow_impersonation",
+ "T11"."toolbar_mode",
+ "T11"."hedgehog_config",
+ "T11"."allow_sidebar_suggestions",
+ "T11"."shortcut_position",
+ "T11"."passkeys_enabled_for_2fa",
+ "T11"."hide_mcp_hints",
+ "T11"."ui_configuration",
+ "T11"."onboarding_skipped_at",
+ "T11"."onboarding_skipped_reason",
+ "T11"."onboarding_skipped_organization_id",
+ "T11"."onboarding_delegated_to_invite_id",
+ "T11"."onboarding_delegated_to_organization_id",
+ "T11"."onboarding_delegation_accepted_at",
+ "T11"."events_column_config",
+ "T11"."email_opt_in"
FROM "posthog_dashboardtile"
INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."id")
LEFT OUTER JOIN "posthog_team" ON ("posthog_dashboarditem"."team_id" = "posthog_team"."id")
LEFT OUTER JOIN "posthog_user" ON ("posthog_dashboarditem"."created_by_id" = "posthog_user"."id")
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboarditem"."last_modified_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboarditem"."last_modified_by_id" = "T6"."id")
LEFT OUTER JOIN "posthog_text" ON ("posthog_dashboardtile"."text_id" = "posthog_text"."id")
LEFT OUTER JOIN "posthog_buttontile" ON ("posthog_dashboardtile"."button_tile_id" = "posthog_buttontile"."id")
LEFT OUTER JOIN "posthog_dashboardwidget" ON ("posthog_dashboardtile"."widget_id" = "posthog_dashboardwidget"."id")
- LEFT OUTER JOIN "posthog_user" T10 ON ("posthog_dashboardwidget"."created_by_id" = T10."id")
- LEFT OUTER JOIN "posthog_user" T11 ON ("posthog_dashboardwidget"."last_modified_by_id" = T11."id")
+ LEFT OUTER JOIN "posthog_user" "T10" ON ("posthog_dashboardwidget"."created_by_id" = "T10"."id")
+ LEFT OUTER JOIN "posthog_user" "T11" ON ("posthog_dashboardwidget"."last_modified_by_id" = "T11"."id")
WHERE (NOT ("posthog_dashboardtile"."deleted"
AND "posthog_dashboardtile"."deleted" IS NOT NULL)
AND NOT ("posthog_dashboard"."deleted")
@@ -22288,9 +22288,9 @@
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
+ (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))
@@ -22927,9 +22927,9 @@
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
+ (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))
@@ -23457,9 +23457,9 @@
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
+ (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))
@@ -24040,9 +24040,9 @@
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
+ (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))
@@ -24476,9 +24476,9 @@
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
+ (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))
@@ -25069,9 +25069,9 @@
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
+ (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))
@@ -25515,10 +25515,10 @@
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)))
+ 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'))
@@ -25547,79 +25547,79 @@
"posthog_dashboard"."tags",
"posthog_dashboard"."share_token",
"posthog_dashboard"."is_shared",
- recent_dashboard_views."viewed_at" AS "last_viewed_at",
+ "recent_dashboard_views"."viewed_at" AS "last_viewed_at",
("posthog_dashboard"."id")::varchar AS "_ref_id",
- (SELECT U0."path" AS "path"
- FROM "posthog_filesystem" U0
- WHERE ((U0."surface" IS NULL
- OR U0."surface" = 'web')
- AND U0."ref" = ("posthog_dashboard"."id")::varchar
- AND U0."team_id" = ("posthog_dashboard"."team_id")
- AND U0."type" = 'dashboard'
- AND NOT (U0."shortcut"
- AND U0."shortcut" IS NOT NULL))
- ORDER BY U0."id" ASC
+ (SELECT "U0"."path" AS "path"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
+ ORDER BY "U0"."id" ASC
LIMIT 1) AS "_folder_path",
- (SELECT U0."id" AS "id"
- FROM "posthog_filesystem" U0
- WHERE ((U0."surface" IS NULL
- OR U0."surface" = 'web')
- AND U0."ref" = ("posthog_dashboard"."id")::varchar
- AND U0."team_id" = ("posthog_dashboard"."team_id")
- AND U0."type" = 'dashboard'
- AND NOT (U0."shortcut"
- AND U0."shortcut" IS NOT NULL))
+ (SELECT "U0"."id" AS "id"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
ORDER BY 1 ASC
LIMIT 1) AS "_folder_id",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in"
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in"
FROM "posthog_dashboard"
INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
- LEFT OUTER JOIN "posthog_filesystemviewlog" recent_dashboard_views ON ("posthog_team"."id" = recent_dashboard_views."team_id"
- AND ((recent_dashboard_views."user_id" = 99999
- AND recent_dashboard_views."type" = 'dashboard'
- AND recent_dashboard_views."ref" = ("posthog_dashboard"."id")::varchar)))
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboard"."created_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_filesystemviewlog" "recent_dashboard_views" ON ("posthog_team"."id" = "recent_dashboard_views"."team_id"
+ AND (("recent_dashboard_views"."user_id" = 99999
+ AND "recent_dashboard_views"."type" = 'dashboard'
+ AND "recent_dashboard_views"."ref" = ("posthog_dashboard"."id")::varchar)))
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboard"."created_by_id" = "T6"."id")
WHERE ("posthog_team"."project_id" = 99999
AND NOT ("posthog_dashboard"."deleted")
AND NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))
@@ -26055,9 +26055,9 @@
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
+ (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))
@@ -26327,9 +26327,9 @@
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
+ (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))
@@ -26525,46 +26525,46 @@
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
"posthog_user"."email_opt_in",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in",
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in",
"posthog_text"."id",
"posthog_text"."body",
"posthog_text"."agent_context",
@@ -26590,97 +26590,97 @@
"posthog_dashboardwidget"."last_modified_at",
"posthog_dashboardwidget"."last_modified_by_id",
"posthog_dashboardwidget"."team_id",
- T10."id",
- T10."password",
- T10."last_login",
- T10."first_name",
- T10."last_name",
- T10."is_staff",
- T10."date_joined",
- T10."uuid",
- T10."current_organization_id",
- T10."current_team_id",
- T10."email",
- T10."pending_email",
- T10."distinct_id",
- T10."is_email_verified",
- T10."credentials_reviewed_at",
- T10."requested_password_reset_at",
- T10."requested_2fa_reset_at",
- T10."has_seen_product_intro_for",
- T10."strapi_id",
- T10."is_active",
- T10."role_at_organization",
- T10."theme_mode",
- T10."partial_notification_settings",
- T10."anonymize_data",
- T10."allow_impersonation",
- T10."toolbar_mode",
- T10."hedgehog_config",
- T10."allow_sidebar_suggestions",
- T10."shortcut_position",
- T10."passkeys_enabled_for_2fa",
- T10."hide_mcp_hints",
- T10."ui_configuration",
- T10."onboarding_skipped_at",
- T10."onboarding_skipped_reason",
- T10."onboarding_skipped_organization_id",
- T10."onboarding_delegated_to_invite_id",
- T10."onboarding_delegated_to_organization_id",
- T10."onboarding_delegation_accepted_at",
- T10."events_column_config",
- T10."email_opt_in",
- T11."id",
- T11."password",
- T11."last_login",
- T11."first_name",
- T11."last_name",
- T11."is_staff",
- T11."date_joined",
- T11."uuid",
- T11."current_organization_id",
- T11."current_team_id",
- T11."email",
- T11."pending_email",
- T11."distinct_id",
- T11."is_email_verified",
- T11."credentials_reviewed_at",
- T11."requested_password_reset_at",
- T11."requested_2fa_reset_at",
- T11."has_seen_product_intro_for",
- T11."strapi_id",
- T11."is_active",
- T11."role_at_organization",
- T11."theme_mode",
- T11."partial_notification_settings",
- T11."anonymize_data",
- T11."allow_impersonation",
- T11."toolbar_mode",
- T11."hedgehog_config",
- T11."allow_sidebar_suggestions",
- T11."shortcut_position",
- T11."passkeys_enabled_for_2fa",
- T11."hide_mcp_hints",
- T11."ui_configuration",
- T11."onboarding_skipped_at",
- T11."onboarding_skipped_reason",
- T11."onboarding_skipped_organization_id",
- T11."onboarding_delegated_to_invite_id",
- T11."onboarding_delegated_to_organization_id",
- T11."onboarding_delegation_accepted_at",
- T11."events_column_config",
- T11."email_opt_in"
+ "T10"."id",
+ "T10"."password",
+ "T10"."last_login",
+ "T10"."first_name",
+ "T10"."last_name",
+ "T10"."is_staff",
+ "T10"."date_joined",
+ "T10"."uuid",
+ "T10"."current_organization_id",
+ "T10"."current_team_id",
+ "T10"."email",
+ "T10"."pending_email",
+ "T10"."distinct_id",
+ "T10"."is_email_verified",
+ "T10"."credentials_reviewed_at",
+ "T10"."requested_password_reset_at",
+ "T10"."requested_2fa_reset_at",
+ "T10"."has_seen_product_intro_for",
+ "T10"."strapi_id",
+ "T10"."is_active",
+ "T10"."role_at_organization",
+ "T10"."theme_mode",
+ "T10"."partial_notification_settings",
+ "T10"."anonymize_data",
+ "T10"."allow_impersonation",
+ "T10"."toolbar_mode",
+ "T10"."hedgehog_config",
+ "T10"."allow_sidebar_suggestions",
+ "T10"."shortcut_position",
+ "T10"."passkeys_enabled_for_2fa",
+ "T10"."hide_mcp_hints",
+ "T10"."ui_configuration",
+ "T10"."onboarding_skipped_at",
+ "T10"."onboarding_skipped_reason",
+ "T10"."onboarding_skipped_organization_id",
+ "T10"."onboarding_delegated_to_invite_id",
+ "T10"."onboarding_delegated_to_organization_id",
+ "T10"."onboarding_delegation_accepted_at",
+ "T10"."events_column_config",
+ "T10"."email_opt_in",
+ "T11"."id",
+ "T11"."password",
+ "T11"."last_login",
+ "T11"."first_name",
+ "T11"."last_name",
+ "T11"."is_staff",
+ "T11"."date_joined",
+ "T11"."uuid",
+ "T11"."current_organization_id",
+ "T11"."current_team_id",
+ "T11"."email",
+ "T11"."pending_email",
+ "T11"."distinct_id",
+ "T11"."is_email_verified",
+ "T11"."credentials_reviewed_at",
+ "T11"."requested_password_reset_at",
+ "T11"."requested_2fa_reset_at",
+ "T11"."has_seen_product_intro_for",
+ "T11"."strapi_id",
+ "T11"."is_active",
+ "T11"."role_at_organization",
+ "T11"."theme_mode",
+ "T11"."partial_notification_settings",
+ "T11"."anonymize_data",
+ "T11"."allow_impersonation",
+ "T11"."toolbar_mode",
+ "T11"."hedgehog_config",
+ "T11"."allow_sidebar_suggestions",
+ "T11"."shortcut_position",
+ "T11"."passkeys_enabled_for_2fa",
+ "T11"."hide_mcp_hints",
+ "T11"."ui_configuration",
+ "T11"."onboarding_skipped_at",
+ "T11"."onboarding_skipped_reason",
+ "T11"."onboarding_skipped_organization_id",
+ "T11"."onboarding_delegated_to_invite_id",
+ "T11"."onboarding_delegated_to_organization_id",
+ "T11"."onboarding_delegation_accepted_at",
+ "T11"."events_column_config",
+ "T11"."email_opt_in"
FROM "posthog_dashboardtile"
INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."id")
LEFT OUTER JOIN "posthog_team" ON ("posthog_dashboarditem"."team_id" = "posthog_team"."id")
LEFT OUTER JOIN "posthog_user" ON ("posthog_dashboarditem"."created_by_id" = "posthog_user"."id")
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboarditem"."last_modified_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboarditem"."last_modified_by_id" = "T6"."id")
LEFT OUTER JOIN "posthog_text" ON ("posthog_dashboardtile"."text_id" = "posthog_text"."id")
LEFT OUTER JOIN "posthog_buttontile" ON ("posthog_dashboardtile"."button_tile_id" = "posthog_buttontile"."id")
LEFT OUTER JOIN "posthog_dashboardwidget" ON ("posthog_dashboardtile"."widget_id" = "posthog_dashboardwidget"."id")
- LEFT OUTER JOIN "posthog_user" T10 ON ("posthog_dashboardwidget"."created_by_id" = T10."id")
- LEFT OUTER JOIN "posthog_user" T11 ON ("posthog_dashboardwidget"."last_modified_by_id" = T11."id")
+ LEFT OUTER JOIN "posthog_user" "T10" ON ("posthog_dashboardwidget"."created_by_id" = "T10"."id")
+ LEFT OUTER JOIN "posthog_user" "T11" ON ("posthog_dashboardwidget"."last_modified_by_id" = "T11"."id")
WHERE (NOT ("posthog_dashboardtile"."deleted"
AND "posthog_dashboardtile"."deleted" IS NOT NULL)
AND NOT ("posthog_dashboard"."deleted")
@@ -27078,9 +27078,9 @@
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
+ (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))
@@ -27708,9 +27708,9 @@
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
+ (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))
@@ -28187,9 +28187,9 @@
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
+ (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))
@@ -28894,9 +28894,9 @@
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
+ (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))
@@ -29405,9 +29405,9 @@
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
+ (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))
@@ -30027,9 +30027,9 @@
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
+ (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))
@@ -30189,10 +30189,10 @@
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)))
+ 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'))
@@ -30472,10 +30472,10 @@
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)))
+ 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'))
@@ -30504,79 +30504,79 @@
"posthog_dashboard"."tags",
"posthog_dashboard"."share_token",
"posthog_dashboard"."is_shared",
- recent_dashboard_views."viewed_at" AS "last_viewed_at",
+ "recent_dashboard_views"."viewed_at" AS "last_viewed_at",
("posthog_dashboard"."id")::varchar AS "_ref_id",
- (SELECT U0."path" AS "path"
- FROM "posthog_filesystem" U0
- WHERE ((U0."surface" IS NULL
- OR U0."surface" = 'web')
- AND U0."ref" = ("posthog_dashboard"."id")::varchar
- AND U0."team_id" = ("posthog_dashboard"."team_id")
- AND U0."type" = 'dashboard'
- AND NOT (U0."shortcut"
- AND U0."shortcut" IS NOT NULL))
- ORDER BY U0."id" ASC
+ (SELECT "U0"."path" AS "path"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
+ ORDER BY "U0"."id" ASC
LIMIT 1) AS "_folder_path",
- (SELECT U0."id" AS "id"
- FROM "posthog_filesystem" U0
- WHERE ((U0."surface" IS NULL
- OR U0."surface" = 'web')
- AND U0."ref" = ("posthog_dashboard"."id")::varchar
- AND U0."team_id" = ("posthog_dashboard"."team_id")
- AND U0."type" = 'dashboard'
- AND NOT (U0."shortcut"
- AND U0."shortcut" IS NOT NULL))
+ (SELECT "U0"."id" AS "id"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
ORDER BY 1 ASC
LIMIT 1) AS "_folder_id",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in"
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in"
FROM "posthog_dashboard"
INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
- LEFT OUTER JOIN "posthog_filesystemviewlog" recent_dashboard_views ON ("posthog_team"."id" = recent_dashboard_views."team_id"
- AND ((recent_dashboard_views."user_id" = 99999
- AND recent_dashboard_views."type" = 'dashboard'
- AND recent_dashboard_views."ref" = ("posthog_dashboard"."id")::varchar)))
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboard"."created_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_filesystemviewlog" "recent_dashboard_views" ON ("posthog_team"."id" = "recent_dashboard_views"."team_id"
+ AND (("recent_dashboard_views"."user_id" = 99999
+ AND "recent_dashboard_views"."type" = 'dashboard'
+ AND "recent_dashboard_views"."ref" = ("posthog_dashboard"."id")::varchar)))
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboard"."created_by_id" = "T6"."id")
WHERE ("posthog_team"."project_id" = 99999
AND NOT ("posthog_dashboard"."deleted")
AND NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))
@@ -31034,9 +31034,9 @@
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
+ (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))
@@ -31333,9 +31333,9 @@
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
+ (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))
@@ -31531,46 +31531,46 @@
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
"posthog_user"."email_opt_in",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in",
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in",
"posthog_text"."id",
"posthog_text"."body",
"posthog_text"."agent_context",
@@ -31596,97 +31596,97 @@
"posthog_dashboardwidget"."last_modified_at",
"posthog_dashboardwidget"."last_modified_by_id",
"posthog_dashboardwidget"."team_id",
- T10."id",
- T10."password",
- T10."last_login",
- T10."first_name",
- T10."last_name",
- T10."is_staff",
- T10."date_joined",
- T10."uuid",
- T10."current_organization_id",
- T10."current_team_id",
- T10."email",
- T10."pending_email",
- T10."distinct_id",
- T10."is_email_verified",
- T10."credentials_reviewed_at",
- T10."requested_password_reset_at",
- T10."requested_2fa_reset_at",
- T10."has_seen_product_intro_for",
- T10."strapi_id",
- T10."is_active",
- T10."role_at_organization",
- T10."theme_mode",
- T10."partial_notification_settings",
- T10."anonymize_data",
- T10."allow_impersonation",
- T10."toolbar_mode",
- T10."hedgehog_config",
- T10."allow_sidebar_suggestions",
- T10."shortcut_position",
- T10."passkeys_enabled_for_2fa",
- T10."hide_mcp_hints",
- T10."ui_configuration",
- T10."onboarding_skipped_at",
- T10."onboarding_skipped_reason",
- T10."onboarding_skipped_organization_id",
- T10."onboarding_delegated_to_invite_id",
- T10."onboarding_delegated_to_organization_id",
- T10."onboarding_delegation_accepted_at",
- T10."events_column_config",
- T10."email_opt_in",
- T11."id",
- T11."password",
- T11."last_login",
- T11."first_name",
- T11."last_name",
- T11."is_staff",
- T11."date_joined",
- T11."uuid",
- T11."current_organization_id",
- T11."current_team_id",
- T11."email",
- T11."pending_email",
- T11."distinct_id",
- T11."is_email_verified",
- T11."credentials_reviewed_at",
- T11."requested_password_reset_at",
- T11."requested_2fa_reset_at",
- T11."has_seen_product_intro_for",
- T11."strapi_id",
- T11."is_active",
- T11."role_at_organization",
- T11."theme_mode",
- T11."partial_notification_settings",
- T11."anonymize_data",
- T11."allow_impersonation",
- T11."toolbar_mode",
- T11."hedgehog_config",
- T11."allow_sidebar_suggestions",
- T11."shortcut_position",
- T11."passkeys_enabled_for_2fa",
- T11."hide_mcp_hints",
- T11."ui_configuration",
- T11."onboarding_skipped_at",
- T11."onboarding_skipped_reason",
- T11."onboarding_skipped_organization_id",
- T11."onboarding_delegated_to_invite_id",
- T11."onboarding_delegated_to_organization_id",
- T11."onboarding_delegation_accepted_at",
- T11."events_column_config",
- T11."email_opt_in"
+ "T10"."id",
+ "T10"."password",
+ "T10"."last_login",
+ "T10"."first_name",
+ "T10"."last_name",
+ "T10"."is_staff",
+ "T10"."date_joined",
+ "T10"."uuid",
+ "T10"."current_organization_id",
+ "T10"."current_team_id",
+ "T10"."email",
+ "T10"."pending_email",
+ "T10"."distinct_id",
+ "T10"."is_email_verified",
+ "T10"."credentials_reviewed_at",
+ "T10"."requested_password_reset_at",
+ "T10"."requested_2fa_reset_at",
+ "T10"."has_seen_product_intro_for",
+ "T10"."strapi_id",
+ "T10"."is_active",
+ "T10"."role_at_organization",
+ "T10"."theme_mode",
+ "T10"."partial_notification_settings",
+ "T10"."anonymize_data",
+ "T10"."allow_impersonation",
+ "T10"."toolbar_mode",
+ "T10"."hedgehog_config",
+ "T10"."allow_sidebar_suggestions",
+ "T10"."shortcut_position",
+ "T10"."passkeys_enabled_for_2fa",
+ "T10"."hide_mcp_hints",
+ "T10"."ui_configuration",
+ "T10"."onboarding_skipped_at",
+ "T10"."onboarding_skipped_reason",
+ "T10"."onboarding_skipped_organization_id",
+ "T10"."onboarding_delegated_to_invite_id",
+ "T10"."onboarding_delegated_to_organization_id",
+ "T10"."onboarding_delegation_accepted_at",
+ "T10"."events_column_config",
+ "T10"."email_opt_in",
+ "T11"."id",
+ "T11"."password",
+ "T11"."last_login",
+ "T11"."first_name",
+ "T11"."last_name",
+ "T11"."is_staff",
+ "T11"."date_joined",
+ "T11"."uuid",
+ "T11"."current_organization_id",
+ "T11"."current_team_id",
+ "T11"."email",
+ "T11"."pending_email",
+ "T11"."distinct_id",
+ "T11"."is_email_verified",
+ "T11"."credentials_reviewed_at",
+ "T11"."requested_password_reset_at",
+ "T11"."requested_2fa_reset_at",
+ "T11"."has_seen_product_intro_for",
+ "T11"."strapi_id",
+ "T11"."is_active",
+ "T11"."role_at_organization",
+ "T11"."theme_mode",
+ "T11"."partial_notification_settings",
+ "T11"."anonymize_data",
+ "T11"."allow_impersonation",
+ "T11"."toolbar_mode",
+ "T11"."hedgehog_config",
+ "T11"."allow_sidebar_suggestions",
+ "T11"."shortcut_position",
+ "T11"."passkeys_enabled_for_2fa",
+ "T11"."hide_mcp_hints",
+ "T11"."ui_configuration",
+ "T11"."onboarding_skipped_at",
+ "T11"."onboarding_skipped_reason",
+ "T11"."onboarding_skipped_organization_id",
+ "T11"."onboarding_delegated_to_invite_id",
+ "T11"."onboarding_delegated_to_organization_id",
+ "T11"."onboarding_delegation_accepted_at",
+ "T11"."events_column_config",
+ "T11"."email_opt_in"
FROM "posthog_dashboardtile"
INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."id")
LEFT OUTER JOIN "posthog_team" ON ("posthog_dashboarditem"."team_id" = "posthog_team"."id")
LEFT OUTER JOIN "posthog_user" ON ("posthog_dashboarditem"."created_by_id" = "posthog_user"."id")
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboarditem"."last_modified_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboarditem"."last_modified_by_id" = "T6"."id")
LEFT OUTER JOIN "posthog_text" ON ("posthog_dashboardtile"."text_id" = "posthog_text"."id")
LEFT OUTER JOIN "posthog_buttontile" ON ("posthog_dashboardtile"."button_tile_id" = "posthog_buttontile"."id")
LEFT OUTER JOIN "posthog_dashboardwidget" ON ("posthog_dashboardtile"."widget_id" = "posthog_dashboardwidget"."id")
- LEFT OUTER JOIN "posthog_user" T10 ON ("posthog_dashboardwidget"."created_by_id" = T10."id")
- LEFT OUTER JOIN "posthog_user" T11 ON ("posthog_dashboardwidget"."last_modified_by_id" = T11."id")
+ LEFT OUTER JOIN "posthog_user" "T10" ON ("posthog_dashboardwidget"."created_by_id" = "T10"."id")
+ LEFT OUTER JOIN "posthog_user" "T11" ON ("posthog_dashboardwidget"."last_modified_by_id" = "T11"."id")
WHERE (NOT ("posthog_dashboardtile"."deleted"
AND "posthog_dashboardtile"."deleted" IS NOT NULL)
AND NOT ("posthog_dashboard"."deleted")
@@ -32091,9 +32091,9 @@
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
+ (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))
@@ -32675,9 +32675,9 @@
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
+ (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))
@@ -33003,9 +33003,9 @@
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
+ (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))
@@ -33201,46 +33201,46 @@
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
"posthog_user"."email_opt_in",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in",
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in",
"posthog_text"."id",
"posthog_text"."body",
"posthog_text"."agent_context",
@@ -33266,97 +33266,97 @@
"posthog_dashboardwidget"."last_modified_at",
"posthog_dashboardwidget"."last_modified_by_id",
"posthog_dashboardwidget"."team_id",
- T10."id",
- T10."password",
- T10."last_login",
- T10."first_name",
- T10."last_name",
- T10."is_staff",
- T10."date_joined",
- T10."uuid",
- T10."current_organization_id",
- T10."current_team_id",
- T10."email",
- T10."pending_email",
- T10."distinct_id",
- T10."is_email_verified",
- T10."credentials_reviewed_at",
- T10."requested_password_reset_at",
- T10."requested_2fa_reset_at",
- T10."has_seen_product_intro_for",
- T10."strapi_id",
- T10."is_active",
- T10."role_at_organization",
- T10."theme_mode",
- T10."partial_notification_settings",
- T10."anonymize_data",
- T10."allow_impersonation",
- T10."toolbar_mode",
- T10."hedgehog_config",
- T10."allow_sidebar_suggestions",
- T10."shortcut_position",
- T10."passkeys_enabled_for_2fa",
- T10."hide_mcp_hints",
- T10."ui_configuration",
- T10."onboarding_skipped_at",
- T10."onboarding_skipped_reason",
- T10."onboarding_skipped_organization_id",
- T10."onboarding_delegated_to_invite_id",
- T10."onboarding_delegated_to_organization_id",
- T10."onboarding_delegation_accepted_at",
- T10."events_column_config",
- T10."email_opt_in",
- T11."id",
- T11."password",
- T11."last_login",
- T11."first_name",
- T11."last_name",
- T11."is_staff",
- T11."date_joined",
- T11."uuid",
- T11."current_organization_id",
- T11."current_team_id",
- T11."email",
- T11."pending_email",
- T11."distinct_id",
- T11."is_email_verified",
- T11."credentials_reviewed_at",
- T11."requested_password_reset_at",
- T11."requested_2fa_reset_at",
- T11."has_seen_product_intro_for",
- T11."strapi_id",
- T11."is_active",
- T11."role_at_organization",
- T11."theme_mode",
- T11."partial_notification_settings",
- T11."anonymize_data",
- T11."allow_impersonation",
- T11."toolbar_mode",
- T11."hedgehog_config",
- T11."allow_sidebar_suggestions",
- T11."shortcut_position",
- T11."passkeys_enabled_for_2fa",
- T11."hide_mcp_hints",
- T11."ui_configuration",
- T11."onboarding_skipped_at",
- T11."onboarding_skipped_reason",
- T11."onboarding_skipped_organization_id",
- T11."onboarding_delegated_to_invite_id",
- T11."onboarding_delegated_to_organization_id",
- T11."onboarding_delegation_accepted_at",
- T11."events_column_config",
- T11."email_opt_in"
+ "T10"."id",
+ "T10"."password",
+ "T10"."last_login",
+ "T10"."first_name",
+ "T10"."last_name",
+ "T10"."is_staff",
+ "T10"."date_joined",
+ "T10"."uuid",
+ "T10"."current_organization_id",
+ "T10"."current_team_id",
+ "T10"."email",
+ "T10"."pending_email",
+ "T10"."distinct_id",
+ "T10"."is_email_verified",
+ "T10"."credentials_reviewed_at",
+ "T10"."requested_password_reset_at",
+ "T10"."requested_2fa_reset_at",
+ "T10"."has_seen_product_intro_for",
+ "T10"."strapi_id",
+ "T10"."is_active",
+ "T10"."role_at_organization",
+ "T10"."theme_mode",
+ "T10"."partial_notification_settings",
+ "T10"."anonymize_data",
+ "T10"."allow_impersonation",
+ "T10"."toolbar_mode",
+ "T10"."hedgehog_config",
+ "T10"."allow_sidebar_suggestions",
+ "T10"."shortcut_position",
+ "T10"."passkeys_enabled_for_2fa",
+ "T10"."hide_mcp_hints",
+ "T10"."ui_configuration",
+ "T10"."onboarding_skipped_at",
+ "T10"."onboarding_skipped_reason",
+ "T10"."onboarding_skipped_organization_id",
+ "T10"."onboarding_delegated_to_invite_id",
+ "T10"."onboarding_delegated_to_organization_id",
+ "T10"."onboarding_delegation_accepted_at",
+ "T10"."events_column_config",
+ "T10"."email_opt_in",
+ "T11"."id",
+ "T11"."password",
+ "T11"."last_login",
+ "T11"."first_name",
+ "T11"."last_name",
+ "T11"."is_staff",
+ "T11"."date_joined",
+ "T11"."uuid",
+ "T11"."current_organization_id",
+ "T11"."current_team_id",
+ "T11"."email",
+ "T11"."pending_email",
+ "T11"."distinct_id",
+ "T11"."is_email_verified",
+ "T11"."credentials_reviewed_at",
+ "T11"."requested_password_reset_at",
+ "T11"."requested_2fa_reset_at",
+ "T11"."has_seen_product_intro_for",
+ "T11"."strapi_id",
+ "T11"."is_active",
+ "T11"."role_at_organization",
+ "T11"."theme_mode",
+ "T11"."partial_notification_settings",
+ "T11"."anonymize_data",
+ "T11"."allow_impersonation",
+ "T11"."toolbar_mode",
+ "T11"."hedgehog_config",
+ "T11"."allow_sidebar_suggestions",
+ "T11"."shortcut_position",
+ "T11"."passkeys_enabled_for_2fa",
+ "T11"."hide_mcp_hints",
+ "T11"."ui_configuration",
+ "T11"."onboarding_skipped_at",
+ "T11"."onboarding_skipped_reason",
+ "T11"."onboarding_skipped_organization_id",
+ "T11"."onboarding_delegated_to_invite_id",
+ "T11"."onboarding_delegated_to_organization_id",
+ "T11"."onboarding_delegation_accepted_at",
+ "T11"."events_column_config",
+ "T11"."email_opt_in"
FROM "posthog_dashboardtile"
INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."id")
LEFT OUTER JOIN "posthog_team" ON ("posthog_dashboarditem"."team_id" = "posthog_team"."id")
LEFT OUTER JOIN "posthog_user" ON ("posthog_dashboarditem"."created_by_id" = "posthog_user"."id")
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboarditem"."last_modified_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboarditem"."last_modified_by_id" = "T6"."id")
LEFT OUTER JOIN "posthog_text" ON ("posthog_dashboardtile"."text_id" = "posthog_text"."id")
LEFT OUTER JOIN "posthog_buttontile" ON ("posthog_dashboardtile"."button_tile_id" = "posthog_buttontile"."id")
LEFT OUTER JOIN "posthog_dashboardwidget" ON ("posthog_dashboardtile"."widget_id" = "posthog_dashboardwidget"."id")
- LEFT OUTER JOIN "posthog_user" T10 ON ("posthog_dashboardwidget"."created_by_id" = T10."id")
- LEFT OUTER JOIN "posthog_user" T11 ON ("posthog_dashboardwidget"."last_modified_by_id" = T11."id")
+ LEFT OUTER JOIN "posthog_user" "T10" ON ("posthog_dashboardwidget"."created_by_id" = "T10"."id")
+ LEFT OUTER JOIN "posthog_user" "T11" ON ("posthog_dashboardwidget"."last_modified_by_id" = "T11"."id")
WHERE (NOT ("posthog_dashboardtile"."deleted"
AND "posthog_dashboardtile"."deleted" IS NOT NULL)
AND NOT ("posthog_dashboard"."deleted")
@@ -33741,79 +33741,79 @@
"posthog_dashboard"."tags",
"posthog_dashboard"."share_token",
"posthog_dashboard"."is_shared",
- recent_dashboard_views."viewed_at" AS "last_viewed_at",
+ "recent_dashboard_views"."viewed_at" AS "last_viewed_at",
("posthog_dashboard"."id")::varchar AS "_ref_id",
- (SELECT U0."path" AS "path"
- FROM "posthog_filesystem" U0
- WHERE ((U0."surface" IS NULL
- OR U0."surface" = 'web')
- AND U0."ref" = ("posthog_dashboard"."id")::varchar
- AND U0."team_id" = ("posthog_dashboard"."team_id")
- AND U0."type" = 'dashboard'
- AND NOT (U0."shortcut"
- AND U0."shortcut" IS NOT NULL))
- ORDER BY U0."id" ASC
+ (SELECT "U0"."path" AS "path"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
+ ORDER BY "U0"."id" ASC
LIMIT 1) AS "_folder_path",
- (SELECT U0."id" AS "id"
- FROM "posthog_filesystem" U0
- WHERE ((U0."surface" IS NULL
- OR U0."surface" = 'web')
- AND U0."ref" = ("posthog_dashboard"."id")::varchar
- AND U0."team_id" = ("posthog_dashboard"."team_id")
- AND U0."type" = 'dashboard'
- AND NOT (U0."shortcut"
- AND U0."shortcut" IS NOT NULL))
+ (SELECT "U0"."id" AS "id"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
ORDER BY 1 ASC
LIMIT 1) AS "_folder_id",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in"
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in"
FROM "posthog_dashboard"
INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
- LEFT OUTER JOIN "posthog_filesystemviewlog" recent_dashboard_views ON ("posthog_team"."id" = recent_dashboard_views."team_id"
- AND ((recent_dashboard_views."user_id" = 99999
- AND recent_dashboard_views."type" = 'dashboard'
- AND recent_dashboard_views."ref" = ("posthog_dashboard"."id")::varchar)))
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboard"."created_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_filesystemviewlog" "recent_dashboard_views" ON ("posthog_team"."id" = "recent_dashboard_views"."team_id"
+ AND (("recent_dashboard_views"."user_id" = 99999
+ AND "recent_dashboard_views"."type" = 'dashboard'
+ AND "recent_dashboard_views"."ref" = ("posthog_dashboard"."id")::varchar)))
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboard"."created_by_id" = "T6"."id")
WHERE ("posthog_team"."project_id" = 99999
AND NOT ("posthog_dashboard"."deleted")
AND "posthog_dashboard"."id" = 99999)
@@ -34068,9 +34068,9 @@
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
+ (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))
@@ -34404,46 +34404,46 @@
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
"posthog_user"."email_opt_in",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in",
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in",
"posthog_text"."id",
"posthog_text"."body",
"posthog_text"."agent_context",
@@ -34469,97 +34469,97 @@
"posthog_dashboardwidget"."last_modified_at",
"posthog_dashboardwidget"."last_modified_by_id",
"posthog_dashboardwidget"."team_id",
- T10."id",
- T10."password",
- T10."last_login",
- T10."first_name",
- T10."last_name",
- T10."is_staff",
- T10."date_joined",
- T10."uuid",
- T10."current_organization_id",
- T10."current_team_id",
- T10."email",
- T10."pending_email",
- T10."distinct_id",
- T10."is_email_verified",
- T10."credentials_reviewed_at",
- T10."requested_password_reset_at",
- T10."requested_2fa_reset_at",
- T10."has_seen_product_intro_for",
- T10."strapi_id",
- T10."is_active",
- T10."role_at_organization",
- T10."theme_mode",
- T10."partial_notification_settings",
- T10."anonymize_data",
- T10."allow_impersonation",
- T10."toolbar_mode",
- T10."hedgehog_config",
- T10."allow_sidebar_suggestions",
- T10."shortcut_position",
- T10."passkeys_enabled_for_2fa",
- T10."hide_mcp_hints",
- T10."ui_configuration",
- T10."onboarding_skipped_at",
- T10."onboarding_skipped_reason",
- T10."onboarding_skipped_organization_id",
- T10."onboarding_delegated_to_invite_id",
- T10."onboarding_delegated_to_organization_id",
- T10."onboarding_delegation_accepted_at",
- T10."events_column_config",
- T10."email_opt_in",
- T11."id",
- T11."password",
- T11."last_login",
- T11."first_name",
- T11."last_name",
- T11."is_staff",
- T11."date_joined",
- T11."uuid",
- T11."current_organization_id",
- T11."current_team_id",
- T11."email",
- T11."pending_email",
- T11."distinct_id",
- T11."is_email_verified",
- T11."credentials_reviewed_at",
- T11."requested_password_reset_at",
- T11."requested_2fa_reset_at",
- T11."has_seen_product_intro_for",
- T11."strapi_id",
- T11."is_active",
- T11."role_at_organization",
- T11."theme_mode",
- T11."partial_notification_settings",
- T11."anonymize_data",
- T11."allow_impersonation",
- T11."toolbar_mode",
- T11."hedgehog_config",
- T11."allow_sidebar_suggestions",
- T11."shortcut_position",
- T11."passkeys_enabled_for_2fa",
- T11."hide_mcp_hints",
- T11."ui_configuration",
- T11."onboarding_skipped_at",
- T11."onboarding_skipped_reason",
- T11."onboarding_skipped_organization_id",
- T11."onboarding_delegated_to_invite_id",
- T11."onboarding_delegated_to_organization_id",
- T11."onboarding_delegation_accepted_at",
- T11."events_column_config",
- T11."email_opt_in"
+ "T10"."id",
+ "T10"."password",
+ "T10"."last_login",
+ "T10"."first_name",
+ "T10"."last_name",
+ "T10"."is_staff",
+ "T10"."date_joined",
+ "T10"."uuid",
+ "T10"."current_organization_id",
+ "T10"."current_team_id",
+ "T10"."email",
+ "T10"."pending_email",
+ "T10"."distinct_id",
+ "T10"."is_email_verified",
+ "T10"."credentials_reviewed_at",
+ "T10"."requested_password_reset_at",
+ "T10"."requested_2fa_reset_at",
+ "T10"."has_seen_product_intro_for",
+ "T10"."strapi_id",
+ "T10"."is_active",
+ "T10"."role_at_organization",
+ "T10"."theme_mode",
+ "T10"."partial_notification_settings",
+ "T10"."anonymize_data",
+ "T10"."allow_impersonation",
+ "T10"."toolbar_mode",
+ "T10"."hedgehog_config",
+ "T10"."allow_sidebar_suggestions",
+ "T10"."shortcut_position",
+ "T10"."passkeys_enabled_for_2fa",
+ "T10"."hide_mcp_hints",
+ "T10"."ui_configuration",
+ "T10"."onboarding_skipped_at",
+ "T10"."onboarding_skipped_reason",
+ "T10"."onboarding_skipped_organization_id",
+ "T10"."onboarding_delegated_to_invite_id",
+ "T10"."onboarding_delegated_to_organization_id",
+ "T10"."onboarding_delegation_accepted_at",
+ "T10"."events_column_config",
+ "T10"."email_opt_in",
+ "T11"."id",
+ "T11"."password",
+ "T11"."last_login",
+ "T11"."first_name",
+ "T11"."last_name",
+ "T11"."is_staff",
+ "T11"."date_joined",
+ "T11"."uuid",
+ "T11"."current_organization_id",
+ "T11"."current_team_id",
+ "T11"."email",
+ "T11"."pending_email",
+ "T11"."distinct_id",
+ "T11"."is_email_verified",
+ "T11"."credentials_reviewed_at",
+ "T11"."requested_password_reset_at",
+ "T11"."requested_2fa_reset_at",
+ "T11"."has_seen_product_intro_for",
+ "T11"."strapi_id",
+ "T11"."is_active",
+ "T11"."role_at_organization",
+ "T11"."theme_mode",
+ "T11"."partial_notification_settings",
+ "T11"."anonymize_data",
+ "T11"."allow_impersonation",
+ "T11"."toolbar_mode",
+ "T11"."hedgehog_config",
+ "T11"."allow_sidebar_suggestions",
+ "T11"."shortcut_position",
+ "T11"."passkeys_enabled_for_2fa",
+ "T11"."hide_mcp_hints",
+ "T11"."ui_configuration",
+ "T11"."onboarding_skipped_at",
+ "T11"."onboarding_skipped_reason",
+ "T11"."onboarding_skipped_organization_id",
+ "T11"."onboarding_delegated_to_invite_id",
+ "T11"."onboarding_delegated_to_organization_id",
+ "T11"."onboarding_delegation_accepted_at",
+ "T11"."events_column_config",
+ "T11"."email_opt_in"
FROM "posthog_dashboardtile"
INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."id")
LEFT OUTER JOIN "posthog_team" ON ("posthog_dashboarditem"."team_id" = "posthog_team"."id")
LEFT OUTER JOIN "posthog_user" ON ("posthog_dashboarditem"."created_by_id" = "posthog_user"."id")
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboarditem"."last_modified_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboarditem"."last_modified_by_id" = "T6"."id")
LEFT OUTER JOIN "posthog_text" ON ("posthog_dashboardtile"."text_id" = "posthog_text"."id")
LEFT OUTER JOIN "posthog_buttontile" ON ("posthog_dashboardtile"."button_tile_id" = "posthog_buttontile"."id")
LEFT OUTER JOIN "posthog_dashboardwidget" ON ("posthog_dashboardtile"."widget_id" = "posthog_dashboardwidget"."id")
- LEFT OUTER JOIN "posthog_user" T10 ON ("posthog_dashboardwidget"."created_by_id" = T10."id")
- LEFT OUTER JOIN "posthog_user" T11 ON ("posthog_dashboardwidget"."last_modified_by_id" = T11."id")
+ LEFT OUTER JOIN "posthog_user" "T10" ON ("posthog_dashboardwidget"."created_by_id" = "T10"."id")
+ LEFT OUTER JOIN "posthog_user" "T11" ON ("posthog_dashboardwidget"."last_modified_by_id" = "T11"."id")
WHERE (NOT ("posthog_dashboardtile"."deleted"
AND "posthog_dashboardtile"."deleted" IS NOT NULL)
AND NOT ("posthog_dashboard"."deleted")
@@ -35038,9 +35038,9 @@
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
+ (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))
@@ -35324,9 +35324,9 @@
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
+ (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))
@@ -35522,46 +35522,46 @@
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
"posthog_user"."email_opt_in",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in",
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in",
"posthog_text"."id",
"posthog_text"."body",
"posthog_text"."agent_context",
@@ -35587,97 +35587,97 @@
"posthog_dashboardwidget"."last_modified_at",
"posthog_dashboardwidget"."last_modified_by_id",
"posthog_dashboardwidget"."team_id",
- T10."id",
- T10."password",
- T10."last_login",
- T10."first_name",
- T10."last_name",
- T10."is_staff",
- T10."date_joined",
- T10."uuid",
- T10."current_organization_id",
- T10."current_team_id",
- T10."email",
- T10."pending_email",
- T10."distinct_id",
- T10."is_email_verified",
- T10."credentials_reviewed_at",
- T10."requested_password_reset_at",
- T10."requested_2fa_reset_at",
- T10."has_seen_product_intro_for",
- T10."strapi_id",
- T10."is_active",
- T10."role_at_organization",
- T10."theme_mode",
- T10."partial_notification_settings",
- T10."anonymize_data",
- T10."allow_impersonation",
- T10."toolbar_mode",
- T10."hedgehog_config",
- T10."allow_sidebar_suggestions",
- T10."shortcut_position",
- T10."passkeys_enabled_for_2fa",
- T10."hide_mcp_hints",
- T10."ui_configuration",
- T10."onboarding_skipped_at",
- T10."onboarding_skipped_reason",
- T10."onboarding_skipped_organization_id",
- T10."onboarding_delegated_to_invite_id",
- T10."onboarding_delegated_to_organization_id",
- T10."onboarding_delegation_accepted_at",
- T10."events_column_config",
- T10."email_opt_in",
- T11."id",
- T11."password",
- T11."last_login",
- T11."first_name",
- T11."last_name",
- T11."is_staff",
- T11."date_joined",
- T11."uuid",
- T11."current_organization_id",
- T11."current_team_id",
- T11."email",
- T11."pending_email",
- T11."distinct_id",
- T11."is_email_verified",
- T11."credentials_reviewed_at",
- T11."requested_password_reset_at",
- T11."requested_2fa_reset_at",
- T11."has_seen_product_intro_for",
- T11."strapi_id",
- T11."is_active",
- T11."role_at_organization",
- T11."theme_mode",
- T11."partial_notification_settings",
- T11."anonymize_data",
- T11."allow_impersonation",
- T11."toolbar_mode",
- T11."hedgehog_config",
- T11."allow_sidebar_suggestions",
- T11."shortcut_position",
- T11."passkeys_enabled_for_2fa",
- T11."hide_mcp_hints",
- T11."ui_configuration",
- T11."onboarding_skipped_at",
- T11."onboarding_skipped_reason",
- T11."onboarding_skipped_organization_id",
- T11."onboarding_delegated_to_invite_id",
- T11."onboarding_delegated_to_organization_id",
- T11."onboarding_delegation_accepted_at",
- T11."events_column_config",
- T11."email_opt_in"
+ "T10"."id",
+ "T10"."password",
+ "T10"."last_login",
+ "T10"."first_name",
+ "T10"."last_name",
+ "T10"."is_staff",
+ "T10"."date_joined",
+ "T10"."uuid",
+ "T10"."current_organization_id",
+ "T10"."current_team_id",
+ "T10"."email",
+ "T10"."pending_email",
+ "T10"."distinct_id",
+ "T10"."is_email_verified",
+ "T10"."credentials_reviewed_at",
+ "T10"."requested_password_reset_at",
+ "T10"."requested_2fa_reset_at",
+ "T10"."has_seen_product_intro_for",
+ "T10"."strapi_id",
+ "T10"."is_active",
+ "T10"."role_at_organization",
+ "T10"."theme_mode",
+ "T10"."partial_notification_settings",
+ "T10"."anonymize_data",
+ "T10"."allow_impersonation",
+ "T10"."toolbar_mode",
+ "T10"."hedgehog_config",
+ "T10"."allow_sidebar_suggestions",
+ "T10"."shortcut_position",
+ "T10"."passkeys_enabled_for_2fa",
+ "T10"."hide_mcp_hints",
+ "T10"."ui_configuration",
+ "T10"."onboarding_skipped_at",
+ "T10"."onboarding_skipped_reason",
+ "T10"."onboarding_skipped_organization_id",
+ "T10"."onboarding_delegated_to_invite_id",
+ "T10"."onboarding_delegated_to_organization_id",
+ "T10"."onboarding_delegation_accepted_at",
+ "T10"."events_column_config",
+ "T10"."email_opt_in",
+ "T11"."id",
+ "T11"."password",
+ "T11"."last_login",
+ "T11"."first_name",
+ "T11"."last_name",
+ "T11"."is_staff",
+ "T11"."date_joined",
+ "T11"."uuid",
+ "T11"."current_organization_id",
+ "T11"."current_team_id",
+ "T11"."email",
+ "T11"."pending_email",
+ "T11"."distinct_id",
+ "T11"."is_email_verified",
+ "T11"."credentials_reviewed_at",
+ "T11"."requested_password_reset_at",
+ "T11"."requested_2fa_reset_at",
+ "T11"."has_seen_product_intro_for",
+ "T11"."strapi_id",
+ "T11"."is_active",
+ "T11"."role_at_organization",
+ "T11"."theme_mode",
+ "T11"."partial_notification_settings",
+ "T11"."anonymize_data",
+ "T11"."allow_impersonation",
+ "T11"."toolbar_mode",
+ "T11"."hedgehog_config",
+ "T11"."allow_sidebar_suggestions",
+ "T11"."shortcut_position",
+ "T11"."passkeys_enabled_for_2fa",
+ "T11"."hide_mcp_hints",
+ "T11"."ui_configuration",
+ "T11"."onboarding_skipped_at",
+ "T11"."onboarding_skipped_reason",
+ "T11"."onboarding_skipped_organization_id",
+ "T11"."onboarding_delegated_to_invite_id",
+ "T11"."onboarding_delegated_to_organization_id",
+ "T11"."onboarding_delegation_accepted_at",
+ "T11"."events_column_config",
+ "T11"."email_opt_in"
FROM "posthog_dashboardtile"
INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."id")
LEFT OUTER JOIN "posthog_team" ON ("posthog_dashboarditem"."team_id" = "posthog_team"."id")
LEFT OUTER JOIN "posthog_user" ON ("posthog_dashboarditem"."created_by_id" = "posthog_user"."id")
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboarditem"."last_modified_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboarditem"."last_modified_by_id" = "T6"."id")
LEFT OUTER JOIN "posthog_text" ON ("posthog_dashboardtile"."text_id" = "posthog_text"."id")
LEFT OUTER JOIN "posthog_buttontile" ON ("posthog_dashboardtile"."button_tile_id" = "posthog_buttontile"."id")
LEFT OUTER JOIN "posthog_dashboardwidget" ON ("posthog_dashboardtile"."widget_id" = "posthog_dashboardwidget"."id")
- LEFT OUTER JOIN "posthog_user" T10 ON ("posthog_dashboardwidget"."created_by_id" = T10."id")
- LEFT OUTER JOIN "posthog_user" T11 ON ("posthog_dashboardwidget"."last_modified_by_id" = T11."id")
+ LEFT OUTER JOIN "posthog_user" "T10" ON ("posthog_dashboardwidget"."created_by_id" = "T10"."id")
+ LEFT OUTER JOIN "posthog_user" "T11" ON ("posthog_dashboardwidget"."last_modified_by_id" = "T11"."id")
WHERE (NOT ("posthog_dashboardtile"."deleted"
AND "posthog_dashboardtile"."deleted" IS NOT NULL)
AND NOT ("posthog_dashboard"."deleted")
@@ -36152,10 +36152,10 @@
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)))
+ 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'))
@@ -36184,79 +36184,79 @@
"posthog_dashboard"."tags",
"posthog_dashboard"."share_token",
"posthog_dashboard"."is_shared",
- recent_dashboard_views."viewed_at" AS "last_viewed_at",
+ "recent_dashboard_views"."viewed_at" AS "last_viewed_at",
("posthog_dashboard"."id")::varchar AS "_ref_id",
- (SELECT U0."path" AS "path"
- FROM "posthog_filesystem" U0
- WHERE ((U0."surface" IS NULL
- OR U0."surface" = 'web')
- AND U0."ref" = ("posthog_dashboard"."id")::varchar
- AND U0."team_id" = ("posthog_dashboard"."team_id")
- AND U0."type" = 'dashboard'
- AND NOT (U0."shortcut"
- AND U0."shortcut" IS NOT NULL))
- ORDER BY U0."id" ASC
+ (SELECT "U0"."path" AS "path"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
+ ORDER BY "U0"."id" ASC
LIMIT 1) AS "_folder_path",
- (SELECT U0."id" AS "id"
- FROM "posthog_filesystem" U0
- WHERE ((U0."surface" IS NULL
- OR U0."surface" = 'web')
- AND U0."ref" = ("posthog_dashboard"."id")::varchar
- AND U0."team_id" = ("posthog_dashboard"."team_id")
- AND U0."type" = 'dashboard'
- AND NOT (U0."shortcut"
- AND U0."shortcut" IS NOT NULL))
+ (SELECT "U0"."id" AS "id"
+ FROM "posthog_filesystem" "U0"
+ WHERE (("U0"."surface" IS NULL
+ OR "U0"."surface" = 'web')
+ AND "U0"."ref" = ("posthog_dashboard"."id")::varchar
+ AND "U0"."team_id" = ("posthog_dashboard"."team_id")
+ AND "U0"."type" = 'dashboard'
+ AND NOT ("U0"."shortcut"
+ AND "U0"."shortcut" IS NOT NULL))
ORDER BY 1 ASC
LIMIT 1) AS "_folder_id",
- T6."id",
- T6."password",
- T6."last_login",
- T6."first_name",
- T6."last_name",
- T6."is_staff",
- T6."date_joined",
- T6."uuid",
- T6."current_organization_id",
- T6."current_team_id",
- T6."email",
- T6."pending_email",
- T6."distinct_id",
- T6."is_email_verified",
- T6."credentials_reviewed_at",
- T6."requested_password_reset_at",
- T6."requested_2fa_reset_at",
- T6."has_seen_product_intro_for",
- T6."strapi_id",
- T6."is_active",
- T6."role_at_organization",
- T6."theme_mode",
- T6."partial_notification_settings",
- T6."anonymize_data",
- T6."allow_impersonation",
- T6."toolbar_mode",
- T6."hedgehog_config",
- T6."allow_sidebar_suggestions",
- T6."shortcut_position",
- T6."passkeys_enabled_for_2fa",
- T6."hide_mcp_hints",
- T6."ui_configuration",
- T6."onboarding_skipped_at",
- T6."onboarding_skipped_reason",
- T6."onboarding_skipped_organization_id",
- T6."onboarding_delegated_to_invite_id",
- T6."onboarding_delegated_to_organization_id",
- T6."onboarding_delegation_accepted_at",
- T6."events_column_config",
- T6."email_opt_in"
+ "T6"."id",
+ "T6"."password",
+ "T6"."last_login",
+ "T6"."first_name",
+ "T6"."last_name",
+ "T6"."is_staff",
+ "T6"."date_joined",
+ "T6"."uuid",
+ "T6"."current_organization_id",
+ "T6"."current_team_id",
+ "T6"."email",
+ "T6"."pending_email",
+ "T6"."distinct_id",
+ "T6"."is_email_verified",
+ "T6"."credentials_reviewed_at",
+ "T6"."requested_password_reset_at",
+ "T6"."requested_2fa_reset_at",
+ "T6"."has_seen_product_intro_for",
+ "T6"."strapi_id",
+ "T6"."is_active",
+ "T6"."role_at_organization",
+ "T6"."theme_mode",
+ "T6"."partial_notification_settings",
+ "T6"."anonymize_data",
+ "T6"."allow_impersonation",
+ "T6"."toolbar_mode",
+ "T6"."hedgehog_config",
+ "T6"."allow_sidebar_suggestions",
+ "T6"."shortcut_position",
+ "T6"."passkeys_enabled_for_2fa",
+ "T6"."hide_mcp_hints",
+ "T6"."ui_configuration",
+ "T6"."onboarding_skipped_at",
+ "T6"."onboarding_skipped_reason",
+ "T6"."onboarding_skipped_organization_id",
+ "T6"."onboarding_delegated_to_invite_id",
+ "T6"."onboarding_delegated_to_organization_id",
+ "T6"."onboarding_delegation_accepted_at",
+ "T6"."events_column_config",
+ "T6"."email_opt_in"
FROM "posthog_dashboard"
INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
- LEFT OUTER JOIN "posthog_filesystemviewlog" recent_dashboard_views ON ("posthog_team"."id" = recent_dashboard_views."team_id"
- AND ((recent_dashboard_views."user_id" = 99999
- AND recent_dashboard_views."type" = 'dashboard'
- AND recent_dashboard_views."ref" = ("posthog_dashboard"."id")::varchar)))
- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboard"."created_by_id" = T6."id")
+ LEFT OUTER JOIN "posthog_filesystemviewlog" "recent_dashboard_views" ON ("posthog_team"."id" = "recent_dashboard_views"."team_id"
+ AND (("recent_dashboard_views"."user_id" = 99999
+ AND "recent_dashboard_views"."type" = 'dashboard'
+ AND "recent_dashboard_views"."ref" = ("posthog_dashboard"."id")::varchar)))
+ LEFT OUTER JOIN "posthog_user" "T6" ON ("posthog_dashboard"."created_by_id" = "T6"."id")
WHERE ("posthog_team"."project_id" = 99999
AND NOT ("posthog_dashboard"."deleted")
AND NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))
@@ -36351,9 +36351,9 @@
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
+ (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))
diff --git a/posthog/api/test/notebooks/__snapshots__/test_notebook.ambr b/posthog/api/test/notebooks/__snapshots__/test_notebook.ambr
index cf96c84887dd..88eaf33ecdf8 100644
--- a/posthog/api/test/notebooks/__snapshots__/test_notebook.ambr
+++ b/posthog/api/test/notebooks/__snapshots__/test_notebook.ambr
@@ -626,50 +626,50 @@
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
"posthog_user"."email_opt_in",
- T5."id",
- T5."password",
- T5."last_login",
- T5."first_name",
- T5."last_name",
- T5."is_staff",
- T5."date_joined",
- T5."uuid",
- T5."current_organization_id",
- T5."current_team_id",
- T5."email",
- T5."pending_email",
- T5."distinct_id",
- T5."is_email_verified",
- T5."credentials_reviewed_at",
- T5."requested_password_reset_at",
- T5."requested_2fa_reset_at",
- T5."has_seen_product_intro_for",
- T5."strapi_id",
- T5."is_active",
- T5."role_at_organization",
- T5."theme_mode",
- T5."partial_notification_settings",
- T5."anonymize_data",
- T5."allow_impersonation",
- T5."toolbar_mode",
- T5."hedgehog_config",
- T5."allow_sidebar_suggestions",
- T5."shortcut_position",
- T5."passkeys_enabled_for_2fa",
- T5."hide_mcp_hints",
- T5."ui_configuration",
- T5."onboarding_skipped_at",
- T5."onboarding_skipped_reason",
- T5."onboarding_skipped_organization_id",
- T5."onboarding_delegated_to_invite_id",
- T5."onboarding_delegated_to_organization_id",
- T5."onboarding_delegation_accepted_at",
- T5."events_column_config",
- T5."email_opt_in"
+ "T5"."id",
+ "T5"."password",
+ "T5"."last_login",
+ "T5"."first_name",
+ "T5"."last_name",
+ "T5"."is_staff",
+ "T5"."date_joined",
+ "T5"."uuid",
+ "T5"."current_organization_id",
+ "T5"."current_team_id",
+ "T5"."email",
+ "T5"."pending_email",
+ "T5"."distinct_id",
+ "T5"."is_email_verified",
+ "T5"."credentials_reviewed_at",
+ "T5"."requested_password_reset_at",
+ "T5"."requested_2fa_reset_at",
+ "T5"."has_seen_product_intro_for",
+ "T5"."strapi_id",
+ "T5"."is_active",
+ "T5"."role_at_organization",
+ "T5"."theme_mode",
+ "T5"."partial_notification_settings",
+ "T5"."anonymize_data",
+ "T5"."allow_impersonation",
+ "T5"."toolbar_mode",
+ "T5"."hedgehog_config",
+ "T5"."allow_sidebar_suggestions",
+ "T5"."shortcut_position",
+ "T5"."passkeys_enabled_for_2fa",
+ "T5"."hide_mcp_hints",
+ "T5"."ui_configuration",
+ "T5"."onboarding_skipped_at",
+ "T5"."onboarding_skipped_reason",
+ "T5"."onboarding_skipped_organization_id",
+ "T5"."onboarding_delegated_to_invite_id",
+ "T5"."onboarding_delegated_to_organization_id",
+ "T5"."onboarding_delegation_accepted_at",
+ "T5"."events_column_config",
+ "T5"."email_opt_in"
FROM "posthog_notebook"
INNER JOIN "posthog_team" ON ("posthog_notebook"."team_id" = "posthog_team"."id")
LEFT OUTER JOIN "posthog_user" ON ("posthog_notebook"."created_by_id" = "posthog_user"."id")
- LEFT OUTER JOIN "posthog_user" T5 ON ("posthog_notebook"."last_modified_by_id" = T5."id")
+ LEFT OUTER JOIN "posthog_user" "T5" ON ("posthog_notebook"."last_modified_by_id" = "T5"."id")
WHERE ("posthog_team"."project_id" = 99999
AND "posthog_notebook"."short_id" = '00000000')
LIMIT 21
diff --git a/posthog/asgi.py b/posthog/asgi.py
index eed0080d70d9..637e45eed1e8 100644
--- a/posthog/asgi.py
+++ b/posthog/asgi.py
@@ -4,8 +4,10 @@ import time
import asyncio
# Django Imports
+import django
from django.conf import settings
-from django.core.asgi import get_asgi_application
+from django.core.handlers.asgi import ASGIHandler
+from django.http import HttpRequest, HttpResponseBase
# Structlog Import
import structlog
@@ -153,6 +155,27 @@ def self_capture_wrapper(func):
return inner
+class PostHogASGIHandler(ASGIHandler):
+ """Run each request's middleware chain and view in a child task, like Django 5.2 did.
+
+ Django 6.0 awaits run_get_response() in the handler's own task. When the client
+ disconnects, asgiref cancels the sync view and copies the context of the still-running
+ view thread back into the caller. That copy can carry asgiref's per-call executor, so
+ request_finished stops waiting for the view thread. ThreadSensitiveContext then joins
+ that thread on the event loop. If the view calls async_to_sync() again, the thread
+ waits for the blocked loop and the worker deadlocks. A child task keeps the copied
+ context out of the handler.
+ """
+
+ async def run_get_response(self, request: HttpRequest) -> HttpResponseBase:
+ return await asyncio.create_task(super().run_get_response(request))
+
+
+def get_asgi_application() -> PostHogASGIHandler:
+ django.setup(set_prefix=False)
+ return PostHogASGIHandler()
+
+
def task_run_event_ingest_wrapper(func):
async def inner(scope, receive, send):
from products.tasks.backend.facade.streams import handle_task_run_event_ingest
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 1a57b6cfd930..a20c4ef7f456 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
@@ -454,6 +454,7 @@
list([
'DoesNotExist',
'MultipleObjectsReturned',
+ 'NotUpdated',
'__doc__',
'__firstlineno__',
'__module__',
@@ -498,6 +499,7 @@
list([
'DoesNotExist',
'MultipleObjectsReturned',
+ 'NotUpdated',
'__annotate_func__',
'__doc__',
'__firstlineno__',
@@ -571,6 +573,7 @@
'CreationMode',
'DoesNotExist',
'MultipleObjectsReturned',
+ 'NotUpdated',
'__annotate_func__',
'__doc__',
'__firstlineno__',
@@ -615,6 +618,7 @@
list([
'DoesNotExist',
'MultipleObjectsReturned',
+ 'NotUpdated',
'__annotate_func__',
'__doc__',
'__firstlineno__',
@@ -647,6 +651,7 @@
list([
'DoesNotExist',
'MultipleObjectsReturned',
+ 'NotUpdated',
'__doc__',
'__firstlineno__',
'__module__',
@@ -668,6 +673,7 @@
'ActiveStage',
'DoesNotExist',
'MultipleObjectsReturned',
+ 'NotUpdated',
'Stage',
'__doc__',
'__firstlineno__',
@@ -695,6 +701,7 @@
'DoesNotExist',
'ExperimentType',
'MultipleObjectsReturned',
+ 'NotUpdated',
'Status',
'__annotate_func__',
'__doc__',
@@ -756,6 +763,7 @@
list([
'DoesNotExist',
'MultipleObjectsReturned',
+ 'NotUpdated',
'__doc__',
'__firstlineno__',
'__module__',
@@ -779,6 +787,7 @@
list([
'DoesNotExist',
'MultipleObjectsReturned',
+ 'NotUpdated',
'__doc__',
'__firstlineno__',
'__module__',
@@ -801,6 +810,7 @@
list([
'DoesNotExist',
'MultipleObjectsReturned',
+ 'NotUpdated',
'__doc__',
'__firstlineno__',
'__module__',
@@ -826,6 +836,7 @@
'DoesNotExist',
'EVALUATION_RUNTIME_CHOICES',
'MultipleObjectsReturned',
+ 'NotUpdated',
'__annotate_func__',
'__doc__',
'__firstlineno__',
@@ -896,6 +907,7 @@
'DoesNotExist',
'MATERIAL_INSIGHT_FIELDS',
'MultipleObjectsReturned',
+ 'NotUpdated',
'__annotate_func__',
'__doc__',
'__firstlineno__',
@@ -955,6 +967,7 @@
list([
'DoesNotExist',
'MultipleObjectsReturned',
+ 'NotUpdated',
'Schedule',
'SurveySamplingIntervalType',
'SurveyType',
@@ -996,6 +1009,7 @@
list([
'DoesNotExist',
'MultipleObjectsReturned',
+ 'NotUpdated',
'__doc__',
'__module__',
'_meta',
@@ -1009,6 +1023,7 @@
list([
'DoesNotExist',
'MultipleObjectsReturned',
+ 'NotUpdated',
'__doc__',
'__firstlineno__',
'__module__',
diff --git a/posthog/models/utils.py b/posthog/models/utils.py
index ab22010f60f3..d2f61f0d919a 100644
--- a/posthog/models/utils.py
+++ b/posthog/models/utils.py
@@ -273,7 +273,7 @@ def int_to_base(number: int, base: int, *, alphabet: Optional[str] = None) -> st
class Percentile(models.Aggregate):
- template = "percentile_disc(%(percentile)s) WITHIN GROUP (ORDER BY %(expressions)s)"
+ template = "percentile_disc(%(percentile)s) WITHIN GROUP (ORDER BY %(expressions)s)%(filter)s"
def __init__(self, percentile, expression, **extra):
super().__init__(expression, percentile=percentile, **extra)
diff --git a/posthog/session_recordings/test/__snapshots__/test_session_recording_playlist.ambr b/posthog/session_recordings/test/__snapshots__/test_session_recording_playlist.ambr
index 960bd70f2091..ab1581293efb 100644
--- a/posthog/session_recordings/test/__snapshots__/test_session_recording_playlist.ambr
+++ b/posthog/session_recordings/test/__snapshots__/test_session_recording_playlist.ambr
@@ -206,50 +206,50 @@
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
"posthog_user"."email_opt_in",
- T4."id",
- T4."password",
- T4."last_login",
- T4."first_name",
- T4."last_name",
- T4."is_staff",
- T4."date_joined",
- T4."uuid",
- T4."current_organization_id",
- T4."current_team_id",
- T4."email",
- T4."pending_email",
- T4."distinct_id",
- T4."is_email_verified",
- T4."credentials_reviewed_at",
- T4."requested_password_reset_at",
- T4."requested_2fa_reset_at",
- T4."has_seen_product_intro_for",
- T4."strapi_id",
- T4."is_active",
- T4."role_at_organization",
- T4."theme_mode",
- T4."partial_notification_settings",
- T4."anonymize_data",
- T4."allow_impersonation",
- T4."toolbar_mode",
- T4."hedgehog_config",
- T4."allow_sidebar_suggestions",
- T4."shortcut_position",
- T4."passkeys_enabled_for_2fa",
- T4."hide_mcp_hints",
- T4."ui_configuration",
- T4."onboarding_skipped_at",
- T4."onboarding_skipped_reason",
- T4."onboarding_skipped_organization_id",
- T4."onboarding_delegated_to_invite_id",
- T4."onboarding_delegated_to_organization_id",
- T4."onboarding_delegation_accepted_at",
- T4."events_column_config",
- T4."email_opt_in"
+ "T4"."id",
+ "T4"."password",
+ "T4"."last_login",
+ "T4"."first_name",
+ "T4"."last_name",
+ "T4"."is_staff",
+ "T4"."date_joined",
+ "T4"."uuid",
+ "T4"."current_organization_id",
+ "T4"."current_team_id",
+ "T4"."email",
+ "T4"."pending_email",
+ "T4"."distinct_id",
+ "T4"."is_email_verified",
+ "T4"."credentials_reviewed_at",
+ "T4"."requested_password_reset_at",
+ "T4"."requested_2fa_reset_at",
+ "T4"."has_seen_product_intro_for",
+ "T4"."strapi_id",
+ "T4"."is_active",
+ "T4"."role_at_organization",
+ "T4"."theme_mode",
+ "T4"."partial_notification_settings",
+ "T4"."anonymize_data",
+ "T4"."allow_impersonation",
+ "T4"."toolbar_mode",
+ "T4"."hedgehog_config",
+ "T4"."allow_sidebar_suggestions",
+ "T4"."shortcut_position",
+ "T4"."passkeys_enabled_for_2fa",
+ "T4"."hide_mcp_hints",
+ "T4"."ui_configuration",
+ "T4"."onboarding_skipped_at",
+ "T4"."onboarding_skipped_reason",
+ "T4"."onboarding_skipped_organization_id",
+ "T4"."onboarding_delegated_to_invite_id",
+ "T4"."onboarding_delegated_to_organization_id",
+ "T4"."onboarding_delegation_accepted_at",
+ "T4"."events_column_config",
+ "T4"."email_opt_in"
FROM "posthog_sessionrecordingplaylist"
INNER JOIN "posthog_team" ON ("posthog_sessionrecordingplaylist"."team_id" = "posthog_team"."id")
LEFT OUTER JOIN "posthog_user" ON ("posthog_sessionrecordingplaylist"."created_by_id" = "posthog_user"."id")
- LEFT OUTER JOIN "posthog_user" T4 ON ("posthog_sessionrecordingplaylist"."last_modified_by_id" = T4."id")
+ LEFT OUTER JOIN "posthog_user" "T4" ON ("posthog_sessionrecordingplaylist"."last_modified_by_id" = "T4"."id")
WHERE (NOT "posthog_sessionrecordingplaylist"."deleted"
AND NOT "posthog_sessionrecordingplaylist"."deleted"
AND "posthog_sessionrecordingplaylist"."type" = 'filters'
@@ -857,50 +857,50 @@
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
"posthog_user"."email_opt_in",
- T4."id",
- T4."password",
- T4."last_login",
- T4."first_name",
- T4."last_name",
- T4."is_staff",
- T4."date_joined",
- T4."uuid",
- T4."current_organization_id",
- T4."current_team_id",
- T4."email",
- T4."pending_email",
- T4."distinct_id",
- T4."is_email_verified",
- T4."credentials_reviewed_at",
- T4."requested_password_reset_at",
- T4."requested_2fa_reset_at",
- T4."has_seen_product_intro_for",
- T4."strapi_id",
- T4."is_active",
- T4."role_at_organization",
- T4."theme_mode",
- T4."partial_notification_settings",
- T4."anonymize_data",
- T4."allow_impersonation",
- T4."toolbar_mode",
- T4."hedgehog_config",
- T4."allow_sidebar_suggestions",
- T4."shortcut_position",
- T4."passkeys_enabled_for_2fa",
- T4."hide_mcp_hints",
- T4."ui_configuration",
- T4."onboarding_skipped_at",
- T4."onboarding_skipped_reason",
- T4."onboarding_skipped_organization_id",
- T4."onboarding_delegated_to_invite_id",
- T4."onboarding_delegated_to_organization_id",
- T4."onboarding_delegation_accepted_at",
- T4."events_column_config",
- T4."email_opt_in"
+ "T4"."id",
+ "T4"."password",
+ "T4"."last_login",
+ "T4"."first_name",
+ "T4"."last_name",
+ "T4"."is_staff",
+ "T4"."date_joined",
+ "T4"."uuid",
+ "T4"."current_organization_id",
+ "T4"."current_team_id",
+ "T4"."email",
+ "T4"."pending_email",
+ "T4"."distinct_id",
+ "T4"."is_email_verified",
+ "T4"."credentials_reviewed_at",
+ "T4"."requested_password_reset_at",
+ "T4"."requested_2fa_reset_at",
+ "T4"."has_seen_product_intro_for",
+ "T4"."strapi_id",
+ "T4"."is_active",
+ "T4"."role_at_organization",
+ "T4"."theme_mode",
+ "T4"."partial_notification_settings",
+ "T4"."anonymize_data",
+ "T4"."allow_impersonation",
+ "T4"."toolbar_mode",
+ "T4"."hedgehog_config",
+ "T4"."allow_sidebar_suggestions",
+ "T4"."shortcut_position",
+ "T4"."passkeys_enabled_for_2fa",
+ "T4"."hide_mcp_hints",
+ "T4"."ui_configuration",
+ "T4"."onboarding_skipped_at",
+ "T4"."onboarding_skipped_reason",
+ "T4"."onboarding_skipped_organization_id",
+ "T4"."onboarding_delegated_to_invite_id",
+ "T4"."onboarding_delegated_to_organization_id",
+ "T4"."onboarding_delegation_accepted_at",
+ "T4"."events_column_config",
+ "T4"."email_opt_in"
FROM "posthog_sessionrecordingplaylist"
INNER JOIN "posthog_team" ON ("posthog_sessionrecordingplaylist"."team_id" = "posthog_team"."id")
LEFT OUTER JOIN "posthog_user" ON ("posthog_sessionrecordingplaylist"."created_by_id" = "posthog_user"."id")
- LEFT OUTER JOIN "posthog_user" T4 ON ("posthog_sessionrecordingplaylist"."last_modified_by_id" = T4."id")
+ LEFT OUTER JOIN "posthog_user" "T4" ON ("posthog_sessionrecordingplaylist"."last_modified_by_id" = "T4"."id")
WHERE (NOT "posthog_sessionrecordingplaylist"."deleted"
AND NOT "posthog_sessionrecordingplaylist"."deleted"
AND "posthog_sessionrecordingplaylist"."type" = 'collection'
@@ -1849,50 +1849,50 @@
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
"posthog_user"."email_opt_in",
- T4."id",
- T4."password",
- T4."last_login",
- T4."first_name",
- T4."last_name",
- T4."is_staff",
- T4."date_joined",
- T4."uuid",
- T4."current_organization_id",
- T4."current_team_id",
- T4."email",
- T4."pending_email",
- T4."distinct_id",
- T4."is_email_verified",
- T4."credentials_reviewed_at",
- T4."requested_password_reset_at",
- T4."requested_2fa_reset_at",
- T4."has_seen_product_intro_for",
- T4."strapi_id",
- T4."is_active",
- T4."role_at_organization",
- T4."theme_mode",
- T4."partial_notification_settings",
- T4."anonymize_data",
- T4."allow_impersonation",
- T4."toolbar_mode",
- T4."hedgehog_config",
- T4."allow_sidebar_suggestions",
- T4."shortcut_position",
- T4."passkeys_enabled_for_2fa",
- T4."hide_mcp_hints",
- T4."ui_configuration",
- T4."onboarding_skipped_at",
- T4."onboarding_skipped_reason",
- T4."onboarding_skipped_organization_id",
- T4."onboarding_delegated_to_invite_id",
- T4."onboarding_delegated_to_organization_id",
- T4."onboarding_delegation_accepted_at",
- T4."events_column_config",
- T4."email_opt_in"
+ "T4"."id",
+ "T4"."password",
+ "T4"."last_login",
+ "T4"."first_name",
+ "T4"."last_name",
+ "T4"."is_staff",
+ "T4"."date_joined",
+ "T4"."uuid",
+ "T4"."current_organization_id",
+ "T4"."current_team_id",
+ "T4"."email",
+ "T4"."pending_email",
+ "T4"."distinct_id",
+ "T4"."is_email_verified",
+ "T4"."credentials_reviewed_at",
+ "T4"."requested_password_reset_at",
+ "T4"."requested_2fa_reset_at",
+ "T4"."has_seen_product_intro_for",
+ "T4"."strapi_id",
+ "T4"."is_active",
+ "T4"."role_at_organization",
+ "T4"."theme_mode",
+ "T4"."partial_notification_settings",
+ "T4"."anonymize_data",
+ "T4"."allow_impersonation",
+ "T4"."toolbar_mode",
+ "T4"."hedgehog_config",
+ "T4"."allow_sidebar_suggestions",
+ "T4"."shortcut_position",
+ "T4"."passkeys_enabled_for_2fa",
+ "T4"."hide_mcp_hints",
+ "T4"."ui_configuration",
+ "T4"."onboarding_skipped_at",
+ "T4"."onboarding_skipped_reason",
+ "T4"."onboarding_skipped_organization_id",
+ "T4"."onboarding_delegated_to_invite_id",
+ "T4"."onboarding_delegated_to_organization_id",
+ "T4"."onboarding_delegation_accepted_at",
+ "T4"."events_column_config",
+ "T4"."email_opt_in"
FROM "posthog_sessionrecordingplaylist"
INNER JOIN "posthog_team" ON ("posthog_sessionrecordingplaylist"."team_id" = "posthog_team"."id")
LEFT OUTER JOIN "posthog_user" ON ("posthog_sessionrecordingplaylist"."created_by_id" = "posthog_user"."id")
- LEFT OUTER JOIN "posthog_user" T4 ON ("posthog_sessionrecordingplaylist"."last_modified_by_id" = T4."id")
+ LEFT OUTER JOIN "posthog_user" "T4" ON ("posthog_sessionrecordingplaylist"."last_modified_by_id" = "T4"."id")
WHERE (NOT "posthog_sessionrecordingplaylist"."deleted"
AND NOT "posthog_sessionrecordingplaylist"."deleted"
AND "posthog_sessionrecordingplaylist"."team_id" = 99999
diff --git a/posthog/settings/service_requirements.py b/posthog/settings/service_requirements.py
index 668305c91b1b..f728dda0371f 100644
--- a/posthog/settings/service_requirements.py
+++ b/posthog/settings/service_requirements.py
@@ -18,7 +18,7 @@ if SKIP_SERVICE_VERSION_REQUIREMENTS and not (TEST or DEBUG):
SERVICE_VERSION_REQUIREMENTS = [
# Floor tracks Django's own minimum: below it the driver refuses to connect.
- ServiceVersionRequirement(service="postgresql", supported_version=">=14.0.0"),
+ ServiceVersionRequirement(service="postgresql", supported_version=">=15.0.0"),
ServiceVersionRequirement(service="redis", supported_version=">=7.0.0,<8.0.0"),
ServiceVersionRequirement(service="clickhouse", supported_version=">=24.8,<=25.12"),
]
diff --git a/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr b/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr
index 244433831b86..2d140f2ed030 100644
--- a/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr
+++ b/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr
@@ -646,9 +646,9 @@
INNER JOIN "posthog_team" ON ("posthog_featureflag"."team_id" = "posthog_team"."id")
WHERE (NOT ("posthog_featureflag"."deleted")
AND ("posthog_featureflag"."team_id" =
- (SELECT U0."parent_team_id" AS "parent_team_id"
- FROM "posthog_team" U0
- WHERE U0."id" = 99999
+ (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_featureflag"."team_id" = 99999))
@@ -1257,9 +1257,9 @@
INNER JOIN "posthog_team" ON ("posthog_featureflag"."team_id" = "posthog_team"."id")
WHERE (NOT ("posthog_featureflag"."deleted")
AND ("posthog_featureflag"."team_id" =
- (SELECT U0."parent_team_id" AS "parent_team_id"
- FROM "posthog_team" U0
- WHERE U0."id" = 99999
+ (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_featureflag"."team_id" = 99999))
diff --git a/posthog/templates/admin/posthog/user/read_only_password_hash.html b/posthog/templates/admin/posthog/user/read_only_password_hash.html
new file mode 100644
index 000000000000..29f7340adf84
--- /dev/null
+++ b/posthog/templates/admin/posthog/user/read_only_password_hash.html
@@ -0,0 +1,13 @@
+{% load i18n %}
+<div{% include 'django/forms/widgets/attrs.html' %}>
+ {% if not has_password %}
+ <p><strong>{% translate "No password set." %}</strong></p>
+ {% elif algorithm %}
+ <p><strong>{% translate "algorithm" %}</strong>: <bdi>{{ algorithm }}</bdi></p>
+ {% else %}
+ <p><strong>{% translate "Invalid password format or unknown hashing algorithm." %}</strong></p>
+ {% endif %}
+ <p><a role="button"
+ class="button"
+ href="{{ password_url|default:"../password/" }}">{{ button_label }}</a></p>
+</div>
diff --git a/posthog/test/test_asgi_handler.py b/posthog/test/test_asgi_handler.py
new file mode 100644
index 000000000000..2302d1dd11f2
--- /dev/null
+++ b/posthog/test/test_asgi_handler.py
@@ -0,0 +1,27 @@
+import contextvars
+
+import pytest
+from unittest import mock
+
+from django.core.handlers.asgi import ASGIHandler
+from django.http import HttpRequest, HttpResponse
+
+from posthog.asgi import PostHogASGIHandler
+
+_set_during_request: contextvars.ContextVar[str | None] = contextvars.ContextVar("set_during_request", default=None)
+
+
+async def _fake_get_response(self: ASGIHandler, request: HttpRequest) -> HttpResponse:
+ _set_during_request.set("leaked")
+ return HttpResponse("ok")
+
+
+async def test_request_context_changes_do_not_reach_the_handler_task() -> None:
+ handler = PostHogASGIHandler.__new__(PostHogASGIHandler)
+
+ with mock.patch.object(ASGIHandler, "run_get_response", _fake_get_response):
+ response = await handler.run_get_response(HttpRequest())
+
+ assert response.status_code == 200
+ assert _set_during_request.get() is None
diff --git a/products/actions/backend/api/test/__snapshots__/test_action.ambr b/products/actions/backend/api/test/__snapshots__/test_action.ambr
index 7b7ef4f794ed..1f658911de2d 100644
--- a/products/actions/backend/api/test/__snapshots__/test_action.ambr
+++ b/products/actions/backend/api/test/__snapshots__/test_action.ambr
@@ -446,9 +446,9 @@
LEFT OUTER JOIN "posthog_user" ON ("posthog_action"."created_by_id" = "posthog_user"."id")
WHERE (NOT "posthog_action"."deleted"
AND ("posthog_action"."team_id" =
- (SELECT U0."parent_team_id" AS "parent_team_id"
- FROM "posthog_team" U0
- WHERE U0."id" = 99999
+ (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_action"."team_id" = 99999))
@@ -1065,9 +1065,9 @@
LEFT OUTER JOIN "posthog_user" ON ("posthog_action"."created_by_id" = "posthog_user"."id")
WHERE (NOT "posthog_action"."deleted"
AND ("posthog_action"."team_id" =
- (SELECT U0."parent_team_id" AS "parent_team_id"
- FROM "posthog_team" U0
- WHERE U0."id" = 99999
+ (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_action"."team_id" = 99999))
@@ -1316,9 +1316,9 @@
LEFT OUTER JOIN "posthog_user" ON ("posthog_action"."created_by_id" = "posthog_user"."id")
WHERE (NOT "posthog_action"."deleted"
AND ("posthog_action"."team_id" =
- (SELECT U0."parent_team_id" AS "parent_team_id"
- FROM "posthog_team" U0
- WHERE U0."id" = 99999
+ (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_action"."team_id" = 99999))
diff --git a/products/alerts/backend/platform_cutover.py b/products/alerts/backend/platform_cutover.py
index 60a452c4c00f..2959ad32414f 100644
--- a/products/alerts/backend/platform_cutover.py
+++ b/products/alerts/backend/platform_cutover.py
@@ -185,7 +185,7 @@ def hand_over(alert: AlertConfiguration, at: datetime) -> bool:
"""
upsert = platform_upsert_of(alert)
assert upsert is not None
- savepoint = transaction.savepoint()
+ savepoint = transaction.savepoint_create()
upsert_configuration(upsert)
taken = take_ownership(
PlatformOwnershipHandover(
diff --git a/products/cdp/backend/api/test/__snapshots__/test_plugin.ambr b/products/cdp/backend/api/test/__snapshots__/test_plugin.ambr
index f84fde71b5f5..55d585f992af 100644
--- a/products/cdp/backend/api/test/__snapshots__/test_plugin.ambr
+++ b/products/cdp/backend/api/test/__snapshots__/test_plugin.ambr
@@ -254,11 +254,11 @@
WHERE ("posthog_plugin"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
OR "posthog_plugin"."is_global"
OR "posthog_plugin"."id" IN
- (SELECT U0."plugin_id" AS "plugin_id"
- FROM "posthog_pluginconfig" U0
- INNER JOIN "posthog_team" U1 ON (U0."team_id" = U1."id")
- WHERE (NOT U0."deleted"
- AND U1."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid)))
+ (SELECT "U0"."plugin_id" AS "plugin_id"
+ FROM "posthog_pluginconfig" "U0"
+ INNER JOIN "posthog_team" "U1" ON ("U0"."team_id" = "U1"."id")
+ WHERE (NOT "U0"."deleted"
+ AND "U1"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid)))
'''
# ---
# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.14
@@ -332,11 +332,11 @@
WHERE ("posthog_plugin"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
OR "posthog_plugin"."is_global"
OR "posthog_plugin"."id" IN
- (SELECT U0."plugin_id" AS "plugin_id"
- FROM "posthog_pluginconfig" U0
- INNER JOIN "posthog_team" U1 ON (U0."team_id" = U1."id")
- WHERE (NOT U0."deleted"
- AND U1."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid)))
+ (SELECT "U0"."plugin_id" AS "plugin_id"
+ FROM "posthog_pluginconfig" "U0"
+ INNER JOIN "posthog_team" "U1" ON ("U0"."team_id" = "U1"."id")
+ WHERE (NOT "U0"."deleted"
+ AND "U1"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid)))
ORDER BY "posthog_plugin"."id" ASC
LIMIT 100
'''
@@ -688,11 +688,11 @@
WHERE ("posthog_plugin"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
OR "posthog_plugin"."is_global"
OR "posthog_plugin"."id" IN
- (SELECT U0."plugin_id" AS "plugin_id"
- FROM "posthog_pluginconfig" U0
- INNER JOIN "posthog_team" U1 ON (U0."team_id" = U1."id")
- WHERE (NOT U0."deleted"
- AND U1."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid)))
+ (SELECT "U0"."plugin_id" AS "plugin_id"
+ FROM "posthog_pluginconfig" "U0"
+ INNER JOIN "posthog_team" "U1" ON ("U0"."team_id" = "U1"."id")
+ WHERE (NOT "U0"."deleted"
+ AND "U1"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid)))
'''
# ---
# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.22
@@ -766,11 +766,11 @@
WHERE ("posthog_plugin"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
OR "posthog_plugin"."is_global"
OR "posthog_plugin"."id" IN
- (SELECT U0."plugin_id" AS "plugin_id"
- FROM "posthog_pluginconfig" U0
- INNER JOIN "posthog_team" U1 ON (U0."team_id" = U1."id")
- WHERE (NOT U0."deleted"
- AND U1."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid)))
+ (SELECT "U0"."plugin_id" AS "plugin_id"
+ FROM "posthog_pluginconfig" "U0"
+ INNER JOIN "posthog_team" "U1" ON ("U0"."team_id" = "U1"."id")
+ WHERE (NOT "U0"."deleted"
+ AND "U1"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid)))
ORDER BY "posthog_plugin"."id" ASC
LIMIT 100
'''
@@ -1076,11 +1076,11 @@
WHERE ("posthog_plugin"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
OR "posthog_plugin"."is_global"
OR "posthog_plugin"."id" IN
- (SELECT U0."plugin_id" AS "plugin_id"
- FROM "posthog_pluginconfig" U0
- INNER JOIN "posthog_team" U1 ON (U0."team_id" = U1."id")
- WHERE (NOT U0."deleted"
- AND U1."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid)))
+ (SELECT "U0"."plugin_id" AS "plugin_id"
+ FROM "posthog_pluginconfig" "U0"
+ INNER JOIN "posthog_team" "U1" ON ("U0"."team_id" = "U1"."id")
+ WHERE (NOT "U0"."deleted"
+ AND "U1"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid)))
'''
# ---
# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.3
@@ -1209,11 +1209,11 @@
WHERE ("posthog_plugin"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
OR "posthog_plugin"."is_global"
OR "posthog_plugin"."id" IN
- (SELECT U0."plugin_id" AS "plugin_id"
- FROM "posthog_pluginconfig" U0
- INNER JOIN "posthog_team" U1 ON (U0."team_id" = U1."id")
- WHERE (NOT U0."deleted"
- AND U1."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid)))
+ (SELECT "U0"."plugin_id" AS "plugin_id"
+ FROM "posthog_pluginconfig" "U0"
+ INNER JOIN "posthog_team" "U1" ON ("U0"."team_id" = "U1"."id")
+ WHERE (NOT "U0"."deleted"
+ AND "U1"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid)))
ORDER BY "posthog_plugin"."id" ASC
LIMIT 100
'''
@@ -1326,11 +1326,11 @@
WHERE ("posthog_plugin"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
OR "posthog_plugin"."is_global"
OR "posthog_plugin"."id" IN
- (SELECT U0."plugin_id" AS "plugin_id"
- FROM "posthog_pluginconfig" U0
- INNER JOIN "posthog_team" U1 ON (U0."team_id" = U1."id")
- WHERE (NOT U0."deleted"
- AND U1."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid)))
+ (SELECT "U0"."plugin_id" AS "plugin_id"
+ FROM "posthog_pluginconfig" "U0"
+ INNER JOIN "posthog_team" "U1" ON ("U0"."team_id" = "U1"."id")
+ WHERE (NOT "U0"."deleted"
+ AND "U1"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid)))
'''
# ---
# name: TestPluginAPI.test_listing_plugins_is_not_nplus1.7
diff --git a/products/customer_analytics/backend/facade/api.py b/products/customer_analytics/backend/facade/api.py
index cb397f302fab..94b80feb4274 100644
--- a/products/customer_analytics/backend/facade/api.py
+++ b/products/customer_analytics/backend/facade/api.py
@@ -3502,7 +3502,7 @@ def _apply_account_table_sort(
class _PercentileCont(Aggregate):
function = "PERCENTILE_CONT"
- template = "%(function)s(0.5) WITHIN GROUP (ORDER BY %(expressions)s)"
+ template = "%(function)s(0.5) WITHIN GROUP (ORDER BY %(expressions)s)%(filter)s"
output_field = FloatField()
diff --git a/products/dashboards/backend/admin/dashboard_admin.py b/products/dashboards/backend/admin/dashboard_admin.py
index b2a08bc40265..ab65f751c5c4 100644
--- a/products/dashboards/backend/admin/dashboard_admin.py
+++ b/products/dashboards/backend/admin/dashboard_admin.py
@@ -1,6 +1,7 @@
from typing import Any
from django.contrib import admin, messages
+from django.contrib.admin import ActionLocation
from django.db import transaction
from django.db.models import QuerySet
from django.http import HttpRequest
@@ -55,9 +56,11 @@ class DashboardAdmin(admin.ModelAdmin):
def get_queryset(self, request):
return Dashboard.objects_including_soft_deleted.all()
- def get_actions(self, request: HttpRequest, *args: Any, **kwargs: Any) -> dict[str, Any]:
+ def get_actions(
+ self, request: HttpRequest, action_location: ActionLocation = ActionLocation.CHANGE_LIST
+ ) -> dict[str, Any]:
# Drop the built-in hard-delete: dashboards are soft-deleted product-side.
- actions = super().get_actions(request, *args, **kwargs)
+ actions = super().get_actions(request, action_location=action_location)
actions.pop("delete_selected", None)
return actions
diff --git a/products/feature_flags/backend/api/test/__snapshots__/test_feature_flag.ambr b/products/feature_flags/backend/api/test/__snapshots__/test_feature_flag.ambr
index 72644cada32e..06f1a72fbccb 100644
--- a/products/feature_flags/backend/api/test/__snapshots__/test_feature_flag.ambr
+++ b/products/feature_flags/backend/api/test/__snapshots__/test_feature_flag.ambr
@@ -1305,9 +1305,9 @@
FROM "posthog_cohort"
INNER JOIN "posthog_team" ON ("posthog_cohort"."team_id" = "posthog_team"."id")
WHERE (("posthog_cohort"."team_id" =
- (SELECT U0."parent_team_id" AS "parent_team_id"
- FROM "posthog_team" U0
- WHERE U0."id" = 99999
+ (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_cohort"."team_id" = 99999))
@@ -1969,50 +1969,50 @@
"posthog_user"."onboarding_delegation_accepted_at",
"posthog_user"."events_column_config",
"posthog_user"."email_opt_in",
- T5."id",
- T5."password",
- T5."last_login",
- T5."first_name",
- T5."last_name",
- T5."is_staff",
- T5."date_joined",
- T5."uuid",
- T5."current_organization_id",
- T5."current_team_id",
- T5."email",
- T5."pending_email",
- T5."distinct_id",
- T5."is_email_verified",
- T5."credentials_reviewed_at",
- T5."requested_password_reset_at",
- T5."requested_2fa_reset_at",
- T5."has_seen_product_intro_for",
- T5."strapi_id",
- T5."is_active",
- T5."role_at_organization",
- T5."theme_mode",
- T5."partial_notification_settings",
- T5."anonymize_data",
- T5."allow_impersonation",
- T5."toolbar_mode",
- T5."hedgehog_config",
- T5."allow_sidebar_suggestions",
- T5."shortcut_position",
- T5."passkeys_enabled_for_2fa",
- T5."hide_mcp_hints",
- T5."ui_configuration",
- T5."onboarding_skipped_at",
- T5."onboarding_skipped_reason",
- T5."onboarding_skipped_organization_id",
- T5."onboarding_delegated_to_invite_id",
- T5."onboarding_delegated_to_organization_id",
- T5."onboarding_delegation_accepted_at",
- T5."events_column_config",
- T5."email_opt_in"
+ "T5"."id",
+ "T5"."password",
+ "T5"."last_login",
+ "T5"."first_name",
+ "T5"."last_name",
+ "T5"."is_staff",
+ "T5"."date_joined",
+ "T5"."uuid",
+ "T5"."current_organization_id",
+ "T5"."current_team_id",
+ "T5"."email",
+ "T5"."pending_email",
+ "T5"."distinct_id",
+ "T5"."is_email_verified",
+ "T5"."credentials_reviewed_at",
+ "T5"."requested_password_reset_at",
+ "T5"."requested_2fa_reset_at",
+ "T5"."has_seen_product_intro_for",
+ "T5"."strapi_id",
+ "T5"."is_active",
+ "T5"."role_at_organization",
+ "T5"."theme_mode",
+ "T5"."partial_notification_settings",
+ "T5"."anonymize_data",
+ "T5"."allow_impersonation",
+ "T5"."toolbar_mode",
+ "T5"."hedgehog_config",
+ "T5"."allow_sidebar_suggestions",
+ "T5"."shortcut_position",
+ "T5"."passkeys_enabled_for_2fa",
+ "T5"."hide_mcp_hints",
+ "T5"."ui_configuration",
+ "T5"."onboarding_skipped_at",
+ "T5"."onboarding_skipped_reason",
+ "T5"."onboarding_skipped_organization_id",
+ "T5"."onboarding_delegated_to_invite_id",
+ "T5"."onboarding_delegated_to_organization_id",
+ "T5"."onboarding_delegation_accepted_at",
+ "T5"."events_column_config",
+ "T5"."email_opt_in"
FROM "posthog_featureflag"
INNER JOIN "posthog_team" ON ("posthog_featureflag"."team_id" = "posthog_team"."id")
LEFT OUTER JOIN "posthog_user" ON ("posthog_featureflag"."created_by_id" = "posthog_user"."id")
- LEFT OUTER JOIN "posthog_user" T5 ON ("posthog_featureflag"."last_modified_by_id" = T5."id")
+ LEFT OUTER JOIN "posthog_user" "T5" ON ("posthog_featureflag"."last_modified_by_id" = "T5"."id")
WHERE ("posthog_team"."project_id" = 99999
AND "posthog_featureflag"."id" = 99999)
LIMIT 21
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 f52523b86928..37abd41f60e9 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
@@ -159,9 +159,9 @@
INNER JOIN "posthog_team" ON ("posthog_featureflag"."team_id" = "posthog_team"."id")
WHERE (NOT ("posthog_featureflag"."deleted")
AND ("posthog_featureflag"."team_id" =
- (SELECT U0."parent_team_id" AS "parent_team_id"
- FROM "posthog_team" U0
- WHERE U0."id" = 99999
+ (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_featureflag"."team_id" = 99999)))
@@ -727,18 +727,18 @@
AND "ee_accesscontrol"."resource_id" = '99999'
AND "ee_accesscontrol"."role_id" IS NULL
AND "ee_accesscontrol"."team_id" IN
- (SELECT U0."id" AS "id"
- FROM "posthog_team" U0
- WHERE U0."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid))
+ (SELECT "U0"."id" AS "id"
+ FROM "posthog_team" "U0"
+ WHERE "U0"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid))
OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
AND "posthog_organizationmembership"."user_id" = 99999
AND "ee_accesscontrol"."resource" = 'feature_flag'
AND "ee_accesscontrol"."resource_id" = '99999'
AND "ee_accesscontrol"."role_id" IS NULL
AND "ee_accesscontrol"."team_id" IN
- (SELECT U0."id" AS "id"
- FROM "posthog_team" U0
- WHERE U0."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid)))
+ (SELECT "U0"."id" AS "id"
+ FROM "posthog_team" "U0"
+ WHERE "U0"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid)))
'''
# ---
# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.28
@@ -1348,9 +1348,9 @@
'flag-a-query-count')
AND "posthog_featureflag"."team_id" = 99999
AND ("posthog_featureflag"."team_id" =
- (SELECT U0."parent_team_id" AS "parent_team_id"
- FROM "posthog_team" U0
- WHERE U0."id" = 99999
+ (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_featureflag"."team_id" = 99999)))
@@ -1516,9 +1516,9 @@
4,
5 /* ... */)
AND ("posthog_featureflag"."team_id" =
- (SELECT U0."parent_team_id" AS "parent_team_id"
- FROM "posthog_team" U0
- WHERE U0."id" = 99999
+ (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_featureflag"."team_id" = 99999)))
@@ -1592,9 +1592,9 @@
4,
5 /* ... */)
AND ("posthog_featureflag"."team_id" =
- (SELECT U0."parent_team_id" AS "parent_team_id"
- FROM "posthog_team" U0
- WHERE U0."id" = 99999
+ (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_featureflag"."team_id" = 99999)))
@@ -2080,9 +2080,9 @@
4,
5 /* ... */)
AND ("posthog_featureflag"."team_id" =
- (SELECT U0."parent_team_id" AS "parent_team_id"
- FROM "posthog_team" U0
- WHERE U0."id" = 99999
+ (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_featureflag"."team_id" = 99999)))
diff --git a/products/growth/backend/admin.py b/products/growth/backend/admin.py
index 0092afff5a98..4ba3e45ea3a8 100644
--- a/products/growth/backend/admin.py
+++ b/products/growth/backend/admin.py
@@ -7,7 +7,6 @@ from django import forms
from django.contrib import admin, messages
from django.core.exceptions import ValidationError
from django.db.models import QuerySet
-from django.db.models.fields import BLANK_CHOICE_DASH
from django.http import HttpRequest, HttpResponseRedirect
from django.urls import reverse
from django.utils.html import format_html
@@ -204,6 +203,9 @@ class ProductPushCampaignAdmin(admin.ModelAdmin):
return format_html('<a href="{}">{}</a>', url, campaign.organization.name)
+BLANK_PRODUCT_KEY_CHOICE = ("", "---------")
+
+
class ProductPushCampaignInlineForm(ProductPushCampaignForm):
class Meta:
model = ProductPushCampaign
@@ -215,7 +217,7 @@ class ProductPushCampaignInlineForm(ProductPushCampaignForm):
# so every org save inserted a phantom campaign and 500ed once one was queued.
product_key_field = self.fields["product_key"]
assert isinstance(product_key_field, forms.ChoiceField) # built in ProductPushCampaignForm.__init__
- product_key_field.choices = BLANK_CHOICE_DASH + product_key_choices()
+ product_key_field.choices = [BLANK_PRODUCT_KEY_CHOICE, *product_key_choices()]
class ProductPushCampaignInline(admin.TabularInline):
diff --git a/products/growth/backend/tests/test_product_push_admin.py b/products/growth/backend/tests/test_product_push_admin.py
index 84716f931f46..d55c19036588 100644
--- a/products/growth/backend/tests/test_product_push_admin.py
+++ b/products/growth/backend/tests/test_product_push_admin.py
@@ -4,13 +4,17 @@ from posthog.test.base import BaseTest
from django import forms
from django.contrib.admin import AdminSite
-from django.db.models.fields import BLANK_CHOICE_DASH
from django.test import RequestFactory
from django.urls import reverse
from posthog.models.organization import Organization
-from products.growth.backend.admin import ProductPushCampaignAdmin, ProductPushCampaignInline, product_key_choices
+from products.growth.backend.admin import (
+ BLANK_PRODUCT_KEY_CHOICE,
+ ProductPushCampaignAdmin,
+ ProductPushCampaignInline,
+ product_key_choices,
+)
from products.growth.backend.models import ProductPushCampaign
@@ -118,7 +122,7 @@ class TestProductPushCampaignAdmin(BaseTest):
product_key_field = formset_class.form(instance=None).fields["product_key"]
assert isinstance(product_key_field, forms.ChoiceField)
- assert product_key_field.choices == BLANK_CHOICE_DASH + product_key_choices()
+ assert product_key_field.choices == [BLANK_PRODUCT_KEY_CHOICE, *product_key_choices()]
formset = formset_class(
instance=self.organization,
diff --git a/products/logs/backend/platform_cutover.py b/products/logs/backend/platform_cutover.py
index 7c93abd4ef7c..53ae29552984 100644
--- a/products/logs/backend/platform_cutover.py
+++ b/products/logs/backend/platform_cutover.py
@@ -175,7 +175,7 @@ def hand_over(alert: LogsAlertConfiguration, at: datetime, *, grouping: Grouping
`grouping` applies only to a copy this creates, because the logs row stores none."""
upsert = platform_upsert_of(alert)
- savepoint = transaction.savepoint()
+ savepoint = transaction.savepoint_create()
upsert_configuration(upsert if grouping is None else replace(upsert, grouping=grouping))
taken = take_ownership(
PlatformOwnershipHandover(
diff --git a/products/product_analytics/backend/admin.py b/products/product_analytics/backend/admin.py
index 0b4c6abde7c5..ef393f49017e 100644
--- a/products/product_analytics/backend/admin.py
+++ b/products/product_analytics/backend/admin.py
@@ -2,6 +2,7 @@ from typing import Any, cast
from django import forms
from django.contrib import admin, messages
+from django.contrib.admin import ActionLocation
from django.db import transaction
from django.db.models import QuerySet
from django.http import HttpRequest
@@ -96,9 +97,11 @@ class InsightAdmin(admin.ModelAdmin):
def get_queryset(self, request):
return Insight.objects_including_soft_deleted.all()
- def get_actions(self, request: HttpRequest, *args: Any, **kwargs: Any) -> dict[str, Any]:
+ def get_actions(
+ self, request: HttpRequest, action_location: ActionLocation = ActionLocation.CHANGE_LIST
+ ) -> dict[str, Any]:
# Drop the built-in hard-delete: insights are soft-deleted product-side.
- actions = super().get_actions(request, *args, **kwargs)
+ actions = super().get_actions(request, action_location=action_location)
actions.pop("delete_selected", None)
return actions
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 ac0896a69dee..4aa78d9042ea 100644
--- a/products/product_analytics/backend/tests/api/__snapshots__/test_insight.ambr
+++ b/products/product_analytics/backend/tests/api/__snapshots__/test_insight.ambr
@@ -33,9 +33,9 @@
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
+ (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))
@@ -511,9 +511,9 @@
"posthog_dashboarditem"."deprecated_tags",
"posthog_dashboarditem"."tags",
- (SELECT U0."last_viewed_at" AS "last_viewed_at"
- FROM "posthog_insightviewed" U0
- WHERE U0."insight_id" = ("posthog_dashboarditem"."id")
+ (SELECT "U0"."last_viewed_at" AS "last_viewed_at"
+ FROM "posthog_insightviewed" "U0"
+ WHERE "U0"."insight_id" = ("posthog_dashboarditem"."id")
ORDER BY 1 DESC
LIMIT 1) AS "last_viewed_at",
"posthog_team"."id",
@@ -1162,9 +1162,9 @@
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
+ (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))
@@ -1619,9 +1619,9 @@
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
+ (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))
@@ -2191,9 +2191,9 @@
"posthog_dashboarditem"."deprecated_tags",
"posthog_dashboarditem"."tags",
- (SELECT U0."last_viewed_at" AS "last_viewed_at"
- FROM "posthog_insightviewed" U0
- WHERE U0."insight_id" = ("posthog_dashboarditem"."id")
+ (SELECT "U0"."last_viewed_at" AS "last_viewed_at"
+ FROM "posthog_insightviewed" "U0"
+ WHERE "U0"."insight_id" = ("posthog_dashboarditem"."id")
ORDER BY 1 DESC
LIMIT 1) AS "last_viewed_at",
"posthog_team"."id",
@@ -2973,9 +2973,9 @@
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
+ (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))
@@ -3423,9 +3423,9 @@
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
+ (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))
@@ -3915,9 +3915,9 @@
"posthog_dashboarditem"."deprecated_tags",
"posthog_dashboarditem"."tags",
- (SELECT U0."last_viewed_at" AS "last_viewed_at"
- FROM "posthog_insightviewed" U0
- WHERE U0."insight_id" = ("posthog_dashboarditem"."id")
+ (SELECT "U0"."last_viewed_at" AS "last_viewed_at"
+ FROM "posthog_insightviewed" "U0"
+ WHERE "U0"."insight_id" = ("posthog_dashboarditem"."id")
ORDER BY 1 DESC
LIMIT 1) AS "last_viewed_at",
"posthog_team"."id",
@@ -4202,9 +4202,9 @@
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
+ (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))
@@ -4710,9 +4710,9 @@
"posthog_dashboarditem"."deprecated_tags",
"posthog_dashboarditem"."tags",
- (SELECT U0."last_viewed_at" AS "last_viewed_at"
- FROM "posthog_insightviewed" U0
- WHERE U0."insight_id" = ("posthog_dashboarditem"."id")
+ (SELECT "U0"."last_viewed_at" AS "last_viewed_at"
+ FROM "posthog_insightviewed" "U0"
+ WHERE "U0"."insight_id" = ("posthog_dashboarditem"."id")
ORDER BY 1 DESC
LIMIT 1) AS "last_viewed_at",
"posthog_team"."id",
@@ -5394,9 +5394,9 @@
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
+ (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))
@@ -6003,9 +6003,9 @@
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
+ (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))
@@ -6532,9 +6532,9 @@
"posthog_dashboarditem"."deprecated_tags",
"posthog_dashboarditem"."tags",
- (SELECT U0."last_viewed_at" AS "last_viewed_at"
- FROM "posthog_insightviewed" U0
- WHERE U0."insight_id" = ("posthog_dashboarditem"."id")
+ (SELECT "U0"."last_viewed_at" AS "last_viewed_at"
+ FROM "posthog_insightviewed" "U0"
+ WHERE "U0"."insight_id" = ("posthog_dashboarditem"."id")
ORDER BY 1 DESC
LIMIT 1) AS "last_viewed_at",
"posthog_team"."id",
@@ -7193,9 +7193,9 @@
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
+ (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))
@@ -7671,9 +7671,9 @@
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
+ (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))
diff --git a/products/replay_vision/backend/experiment_variants.py b/products/replay_vision/backend/experiment_variants.py
index d65254e9c54b..553b3ea1f499 100644
--- a/products/replay_vision/backend/experiment_variants.py
+++ b/products/replay_vision/backend/experiment_variants.py
@@ -39,7 +39,7 @@ LATEST_OBSERVATIONS_PER_VARIANT = 2
class _Median(Aggregate):
function = "percentile_cont"
- template = "%(function)s(0.5) WITHIN GROUP (ORDER BY %(expressions)s)"
+ template = "%(function)s(0.5) WITHIN GROUP (ORDER BY %(expressions)s)%(filter)s"
output_field = FloatField()
diff --git a/products/signals/backend/test/test_signal_report_api.py b/products/signals/backend/test/test_signal_report_api.py
index 9a1310ac884d..6474605b14e3 100644
--- a/products/signals/backend/test/test_signal_report_api.py
+++ b/products/signals/backend/test/test_signal_report_api.py
@@ -2479,7 +2479,7 @@ class TestSignalReportListAPI(APIBaseTest):
assert filter_sql
for sql in filter_sql:
# Django aliases the PR artefact, task-run artefact, legacy task, and assignment task tables as V0.
- assert sql.count(f'V0."team_id" = {self.team.id}') == 4
+ assert sql.count(f'"V0"."team_id" = {self.team.id}') == 4
# A join to the assignment or pull request table lets the planner scan every team's rows first.
assert "JOIN" not in sql
assert '"pull_request_id" = ANY((ARRAY(SELECT' in sql
diff --git a/products/workflows/backend/test/test_workflow_customer_tasks.py b/products/workflows/backend/test/test_workflow_customer_tasks.py
index 8268a73d6e1b..cb564d3e55a4 100644
--- a/products/workflows/backend/test/test_workflow_customer_tasks.py
+++ b/products/workflows/backend/test/test_workflow_customer_tasks.py
@@ -301,11 +301,11 @@ class TestWorkflowCustomerTasks(APIBaseTest):
# T2 is the joined parent row. Requiring a non-deprecated column off it keeps the check below
# from passing vacuously if the join ever stops hydrating the parent.
- parent_hydrating = [q["sql"] for q in context.captured_queries if 'T2."test_account_filters"' in q["sql"]]
+ parent_hydrating = [q["sql"] for q in context.captured_queries if '"T2"."test_account_filters"' in q["sql"]]
assert parent_hydrating, "expected the create to hydrate the parent team through a join"
for sql in parent_hydrating:
for attr in DEPRECATED_ATTRS:
- assert f'T2."{attr}"' not in sql, f"parent column {attr} was selected"
+ assert f'"T2"."{attr}"' not in sql, f"parent column {attr} was selected"
def test_foreign_account_and_assignee_are_rejected(self) -> None:
other_team = Team.objects.create(organization=self.organization, name="Other project")
diff --git a/pyproject.toml b/pyproject.toml
index 71fef1ebda4b..937494955c87 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -39,7 +39,7 @@ dependencies = [
"dagster-webserver==1.12.11",
"deltalake[pyarrow]==1.6.1",
"dj-database-url~=3.1.2",
- "django~=5.2.0",
+ "django~=6.1.0",
"django-axes[ipware]==8.3.1",
"django-cors-headers~=4.9.0",
"django-extensions~=4.1.0",
@@ -352,6 +352,18 @@ infi-clickhouse-orm = { git = "https://github.com/PostHog/infi.clickhouse_orm",
pytest-split = { git = "https://github.com/PostHog/pytest-split", tag = "v0.11.0-posthog.13" }
torch = [{ index = "pytorch-cpu", group = "inbox-ranking" }]
+# These releases cap Django below 6.1 only because 6.1 was untested when they shipped. Upstream main
+# raises the cap without library code changes. Drop each block once a release lifts the cap.
+[[tool.uv.dependency-metadata]]
+name = "django-prometheus"
+version = "2.5.0"
+requires-dist = ["Django>=4.2,!=5.0.*", "prometheus-client>=0.7"]
+
+[[tool.uv.dependency-metadata]]
+name = "django-scim2"
+version = "0.23.0"
+requires-dist = ["django>=5.2.8", "pygments>=2.20.0,<3.0.0", "scim2-filter-parser>=0.5.0"]
+
# xgboost's Linux wheel declares nvidia-nccl-cu12 (322 MB) for multi-GPU training. We use xgboost on
# CPU, so drop it to keep the wheel out of the image.
[[tool.uv.dependency-metadata]]
diff --git a/uv.lock b/uv.lock
index 373a88131e25..ec6f38b2f201 100644
--- a/uv.lock
+++ b/uv.lock
@@ -51,6 +51,16 @@ members = [
]
constraints = [{ name = "posthoganalytics", specifier = "<8" }]
+[[manifest.dependency-metadata]]
+name = "django-prometheus"
+version = "2.5.0"
+requires-dist = ["django>=4.2,!=5.0.*", "prometheus-client>=0.7"]
+
+[[manifest.dependency-metadata]]
+name = "django-scim2"
+version = "0.23.0"
+requires-dist = ["django>=5.2.8", "pygments>=2.20.0,<3.0.0", "scim2-filter-parser>=0.5.0"]
+
[[manifest.dependency-metadata]]
name = "xgboost"
version = "3.2.0"
@@ -1941,16 +1951,16 @@ wheels = [
[[package]]
name = "django"
-version = "5.2.18"
+version = "6.1.2"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "asgiref" },
{ name = "sqlparse" },
{ name = "tzdata", marker = "sys_platform == 'win32'" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/85/fe/79e692b430c7721bf4b812c328bfe687e73e3f28f56611a6a18a97e887cc/django-5.2.18.tar.gz", hash = "sha256:461c5dd06d2ea16bd5ca37d3f46e4def1d6b0fe7588c6f4e2119517bb0af8b2d", size = 10910238, upload-time = "2026-10-06T13:01:09.371Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/89/24/20d187a22ac821288b53c53b8f696019dcb0c7b4f973f052ade19392c74d/django-6.1.2.tar.gz", hash = "sha256:a1e92451ccb8b514e91bbb3b6d186d20b4030558f116b5d9de6535455ff210b7", size = 11251425, upload-time = "2026-10-06T12:53:29.622Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/d6/01/6568ec52b26548ca1b83d33249f7274db3bf74698f42c0da42ec9db1a24a/django-5.2.18-py3-none-any.whl", hash = "sha256:92ed81d500be6408ecd704d7bd1366c534f30427bffcc63c5fefb129561aec7c", size = 8316071, upload-time = "2026-10-06T13:01:04.413Z" },
+ { url = "https://files.pythonhosted.org/packages/c9/83/90ff2dbfac7b519ed77620bdbb827cd2d1a83faf00d076bf95056428bce7/django-6.1.2-py3-none-any.whl", hash = "sha256:141efee6ec64d1db6db90683bf734c550102450f444fb099063b0be1bd27d991", size = 8420684, upload-time = "2026-10-06T12:53:17.381Z" },
]
[[package]]
@@ -6219,7 +6229,7 @@ requires-dist = [
{ name = "deltalite", specifier = "==0.1.15" },
{ name = "disposable-email-domains", specifier = "~=0.0.140" },
{ name = "dj-database-url", specifier = "~=3.1.2" },
- { name = "django", specifier = "~=5.2.0" },
+ { name = "django", specifier = "~=6.1.0" },
{ name = "django-admin-inline-paginator", specifier = "===0.4.0" },
{ name = "django-axes", extras = ["ipware"], specifier = "==8.3.1" },
{ name = "django-cors-headers", specifier = "~=4.9.0" },