:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(file-system): clear Recents when underlying file disappears (#60381)
posthog[bot]4c66d26483a3
diff --git a/posthog/api/test/dashboards/test_dashboard.py b/posthog/api/test/dashboards/test_dashboard.pyindex b97abaf8ca90..5a91aa5c4856 100644--- a/posthog/api/test/dashboards/test_dashboard.py+++ b/posthog/api/test/dashboards/test_dashboard.py@@ -798,6 +798,52 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):dashboard_two_after_delete = self.dashboard_api.get_dashboard(dashboard_two_id)assert len(dashboard_two_after_delete["tiles"]) == 1+ def test_delete_dashboard_with_insights_removes_filesystem_entries(self):+ """+ Cascading insight deletion via the dashboard endpoint uses bulk update under the hood,+ which bypasses signals. The serializer must explicitly resync FileSystem entries so the+ Recents sidebar stops surfacing dead references.+ """+ from posthog.models.file_system.file_system import FileSystem++ dashboard_id, _ = self.dashboard_api.create_dashboard({})+ insight_id, _ = self.dashboard_api.create_insight(+ {"name": "to be cascade-deleted", "dashboards": [dashboard_id]}+ )++ insight = Insight.objects.get(id=insight_id)+ assert FileSystem.objects.filter(team=self.team, type="insight", ref=insight.short_id).exists()+ FileSystemViewLog.objects.create(team=self.team, user=self.user, type="insight", ref=insight.short_id)++ self.dashboard_api.soft_delete(dashboard_id, "dashboards", {"delete_insights": True})++ insight.refresh_from_db()+ assert insight.deleted is True+ assert not FileSystem.objects.filter(team=self.team, type="insight", ref=insight.short_id).exists()+ assert not FileSystemViewLog.objects.filter(team=self.team, type="insight", ref=insight.short_id).exists()++ def test_undelete_dashboard_restores_insight_filesystem_entries(self):+ """Undoing a cascade delete must re-create FileSystem entries via the resync helper."""+ from posthog.models.file_system.file_system import FileSystem++ dashboard_id, _ = self.dashboard_api.create_dashboard({})+ insight_id, _ = self.dashboard_api.create_insight({"name": "round-tripped", "dashboards": [dashboard_id]})+ insight = Insight.objects.get(id=insight_id)++ self.dashboard_api.soft_delete(dashboard_id, "dashboards", {"delete_insights": True})+ assert not FileSystem.objects.filter(team=self.team, type="insight", ref=insight.short_id).exists()++ response = self.client.patch(+ f"/api/projects/{self.team.id}/dashboards/{dashboard_id}/",+ {"deleted": False},+ format="json",+ )+ assert response.status_code == status.HTTP_200_OK++ insight.refresh_from_db()+ assert insight.deleted is False+ assert FileSystem.objects.filter(team=self.team, type="insight", ref=insight.short_id).exists()+def test_delete_dashboard_clears_primary_dashboard(self):dashboard_id, _ = self.dashboard_api.create_dashboard({})self.team.primary_dashboard_id = dashboard_iddiff --git a/posthog/models/file_system/file_system_view_log.py b/posthog/models/file_system/file_system_view_log.pyindex 449f31f5f852..8b80f6427f17 100644--- a/posthog/models/file_system/file_system_view_log.py+++ b/posthog/models/file_system/file_system_view_log.py@@ -6,6 +6,8 @@ from typing import TYPE_CHECKING, Optional, castfrom django.db import IntegrityError, modelsfrom django.db.models import F, FilteredRelation, Q, QuerySet+from django.db.models.signals import post_delete+from django.dispatch import receiverfrom django.utils import timezonefrom posthog.models.file_system.file_system import FileSystem@@ -33,6 +35,22 @@ class FileSystemViewLog(UUIDModel):]+@receiver(post_delete, sender=FileSystem)+def _drop_view_logs_when_file_deleted(sender, instance: FileSystem, **kwargs) -> None:+ # When a file (not a folder or shortcut) is removed, drop the matching view logs so+ # the Recents sidebar can't surface a dead reference. Shortcuts share (type, ref) with+ # their canonical file, so we only act when the canonical row is gone.+ if not instance.ref or instance.type == "folder" or instance.shortcut:+ return+ if (+ FileSystem.objects.filter(team_id=instance.team_id, type=instance.type, ref=instance.ref)+ .exclude(shortcut=True)+ .exists()+ ):+ return+ FileSystemViewLog.objects.filter(team_id=instance.team_id, type=instance.type, ref=instance.ref).delete()++def log_file_system_view(*,user: Optional[User],diff --git a/posthog/models/file_system/test/test_file_system_mixin.py b/posthog/models/file_system/test/test_file_system_mixin.pyindex 33aae873e78d..2469e34e80ed 100644--- a/posthog/models/file_system/test/test_file_system_mixin.py+++ b/posthog/models/file_system/test/test_file_system_mixin.py@@ -1,6 +1,7 @@from django.test import TestCasefrom posthog.models import FileSystem, Organization, Team, User+from posthog.models.file_system.file_system_view_log import FileSystemViewLogfrom products.dashboards.backend.models.dashboard import Dashboardfrom products.experiments.backend.models.experiment import Experiment@@ -196,3 +197,69 @@ class TestFileSystemSyncMixin(TestCase):assert FileSystem.objects.filter(id=fs_entry_id).exists() is False, ("Existing entries for internal notebooks should be deleted")++ def test_file_system_delete_clears_view_logs(self):+ """+ When a FileSystem row is removed (e.g. because the underlying insight was soft-deleted),+ the matching FileSystemViewLog rows must also disappear so the Recents sidebar can't+ surface a dead reference.+ """+ insight = Insight.objects.create(team=self.team, name="My Insight", saved=True, created_by=self.user)+ fs_entry = FileSystem.objects.get(team=self.team, type="insight", ref=insight.short_id)+ FileSystemViewLog.objects.create(team=self.team, user=self.user, type="insight", ref=insight.short_id)+ self.assertEqual(FileSystemViewLog.objects.count(), 1)++ # Soft-deleting the insight runs the post_save signal, which removes the FileSystem entry+ insight.deleted = True+ insight.save()++ assert not FileSystem.objects.filter(id=fs_entry.id).exists()+ self.assertEqual(FileSystemViewLog.objects.count(), 0)++ def test_file_system_view_logs_survive_when_legacy_null_shortcut_row_remains(self):+ """+ Legacy FileSystem rows can have shortcut=NULL (the field is nullable and the Recents+ query treats NULL as canonical). Deleting one canonical row while another canonical+ row with shortcut=NULL still exists must not clear the view logs.+ """+ insight = Insight.objects.create(team=self.team, name="My Insight", saved=True, created_by=self.user)+ FileSystemViewLog.objects.create(team=self.team, user=self.user, type="insight", ref=insight.short_id)++ legacy_row = FileSystem.objects.create(+ team=self.team,+ path=f"Legacy/{insight.name}",+ depth=2,+ type="insight",+ ref=insight.short_id,+ href=f"/insights/{insight.short_id}",+ shortcut=None,+ created_by=self.user,+ )++ canonical = FileSystem.objects.get(team=self.team, type="insight", ref=insight.short_id, shortcut=False)+ canonical.delete()++ assert FileSystem.objects.filter(id=legacy_row.id).exists()+ self.assertEqual(FileSystemViewLog.objects.count(), 1)++ def test_file_system_view_logs_survive_shortcut_deletion(self):+ """+ Shortcuts share (type, ref) with their canonical file. Deleting a shortcut must not+ clear view logs — they should follow the canonical row's lifecycle.+ """+ insight = Insight.objects.create(team=self.team, name="My Insight", saved=True, created_by=self.user)+ FileSystemViewLog.objects.create(team=self.team, user=self.user, type="insight", ref=insight.short_id)++ shortcut = FileSystem.objects.create(+ team=self.team,+ path=f"Shortcuts/{insight.name}",+ depth=2,+ type="insight",+ ref=insight.short_id,+ href=f"/insights/{insight.short_id}",+ shortcut=True,+ created_by=self.user,+ )+ shortcut.delete()++ self.assertEqual(FileSystemViewLog.objects.count(), 1)diff --git a/products/dashboards/backend/api/dashboard.py b/products/dashboards/backend/api/dashboard.pyindex ffc620fb1b7f..8466665e9a39 100644--- a/products/dashboards/backend/api/dashboard.py+++ b/products/dashboards/backend/api/dashboard.py@@ -45,6 +45,7 @@ from posthog.api.utils import actionfrom posthog.clickhouse.client.async_task_chain import task_chain_contextfrom posthog.constants import GENERATED_DASHBOARD_PREFIXfrom posthog.event_usage import get_request_analytics_properties, report_user_action+from posthog.exceptions_capture import capture_exceptionfrom posthog.helpers import create_dashboard_from_templatefrom posthog.helpers.dashboard_templates import create_from_template, dashboard_template_from_creation_payloadfrom posthog.helpers.trigram_search import (@@ -56,6 +57,7 @@ from posthog.helpers.trigram_search import ()from posthog.hogql_queries.query_runner import ExecutionModefrom posthog.models.activity_logging.activity_log import Detail, changes_between, log_activity+from posthog.models.file_system.file_system import create_or_update_file, delete_filefrom posthog.models.quick_filter import QuickFilterfrom posthog.models.signals import model_activity_signal, mutable_receiverfrom posthog.models.tagged_item import TaggedItem@@ -938,18 +940,61 @@ class DashboardSerializer(DashboardMetadataSerializer):if insight_ids_to_delete:# nosemgrep: idor-lookup-without-teamInsight.objects.filter(id__in=insight_ids_to_delete).update(deleted=True)+ # Bulk update bypasses signals, so the FileSystemSyncMixin can't prune the+ # corresponding FileSystem rows. Without this, stale entries linger in the+ # Recents sidebar and clicking them lands on an "Insight not found" page.+ DashboardSerializer._sync_filesystem_for_insights(insight_ids_to_delete, instance.team_id)DashboardTile.objects_including_soft_deleted.filter(dashboard__id=instance.id).update(deleted=True)@staticmethoddef _undo_delete_related_tiles(instance: Dashboard) -> None:DashboardTile.objects_including_soft_deleted.filter(dashboard__id=instance.id).update(deleted=False)- insights_to_undelete = []- for tile in DashboardTile.objects.filter(dashboard__id=instance.id):- if tile.insight and tile.insight.deleted:- tile.insight.deleted = False- insights_to_undelete.append(tile.insight)- Insight.objects.bulk_update(insights_to_undelete, ["deleted"])+ # The default Insight manager excludes deleted=True, so traversing tile.insight returns None+ # for soft-deleted rows. Query the unfiltered manager directly to find the insights that+ # need to be restored alongside the dashboard.+ insights_to_undelete = list(+ Insight.objects_including_soft_deleted.filter(+ dashboard_tiles__dashboard_id=instance.id, deleted=True+ ).distinct()+ )+ for insight in insights_to_undelete:+ insight.deleted = False+ if insights_to_undelete:+ Insight.objects_including_soft_deleted.bulk_update(insights_to_undelete, ["deleted"])+ # bulk_update also bypasses signals — re-sync FileSystem so restored insights reappear.+ DashboardSerializer._sync_filesystem_for_insights(+ [insight.id for insight in insights_to_undelete], instance.team_id+ )++ @staticmethod+ def _sync_filesystem_for_insights(insight_ids: list[int], team_id: int) -> None:+ """Re-run FileSystem sync for insights whose ``deleted`` flag was changed via bulk update."""+ # The default Insight manager excludes deleted=True, so use the unfiltered manager —+ # this helper is invoked specifically after bulk deletes/undeletes and must see both.+ insights = Insight.objects_including_soft_deleted.filter(id__in=insight_ids, team_id=team_id).select_related(+ "team"+ )+ for insight in insights:+ fs_data = insight.get_file_system_representation()+ try:+ if fs_data.should_delete:+ delete_file(team=insight.team, file_type=fs_data.type, ref=fs_data.ref)+ else:+ create_or_update_file(+ team=insight.team,+ base_folder=fs_data.base_folder,+ name=fs_data.name,+ file_type=fs_data.type,+ ref=fs_data.ref,+ href=fs_data.href,+ meta=fs_data.meta,+ created_at=fs_data.meta.get("created_at") or insight.created_at,+ created_by_id=fs_data.meta.get("created_by") or insight.created_by_id,+ )+ except Exception as exc:+ # Mirror the signal-handler stance: never raise from sync, but surface it.+ capture_exception(exc, additional_properties={"insight_id": insight.id, "team_id": team_id})@tracer.start_as_current_span("DashboardSerializer.get_tiles")def get_tiles(self, dashboard: Dashboard) -> Optional[list[ReturnDict]]: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.ambrindex 1dcb927414dd..d4264c816a59 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@@ -518,6 +518,26 @@'''# ---# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.20+ '''+ SELECT "posthog_filesystem"."team_id",+ "posthog_filesystem"."id",+ "posthog_filesystem"."path",+ "posthog_filesystem"."depth",+ "posthog_filesystem"."type",+ "posthog_filesystem"."ref",+ "posthog_filesystem"."href",+ "posthog_filesystem"."shortcut",+ "posthog_filesystem"."meta",+ "posthog_filesystem"."created_at",+ "posthog_filesystem"."created_by_id",+ "posthog_filesystem"."project_id"+ FROM "posthog_filesystem"+ WHERE ("posthog_filesystem"."ref" = '0001'+ AND "posthog_filesystem"."team_id" = 99999+ AND "posthog_filesystem"."type" = 'dashboard')+ '''+# ---+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.21'''SELECT "posthog_dashboardtile"."id" AS "pk"FROM "posthog_dashboardtile"@@ -528,7 +548,7 @@AND "posthog_dashboardtile"."dashboard_id" = 99999)'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.21+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.22'''SELECT "posthog_tag"."id","posthog_tag"."name",@@ -546,7 +566,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.22+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.23'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -650,7 +670,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.23+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.24'''SELECT 1 AS "a"FROM "posthog_tag"@@ -658,7 +678,7 @@LIMIT 1'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.24+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.25'''SELECT 1 AS "a"FROM "posthog_dashboard"@@ -666,7 +686,7 @@LIMIT 1'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.25+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.26'''SELECT 1 AS "a"FROM "posthog_taggeditem"@@ -674,7 +694,7 @@LIMIT 1'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.26+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.27'''SELECT 1 AS "_check"WHERE COALESCE((EXISTS@@ -686,13 +706,13 @@LIMIT 1)), true)'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.27+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.28'''SELECT 1 AS "_check"WHERE COALESCE(true, true)'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.28+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.29'''SELECT "posthog_tag"."id","posthog_tag"."name",@@ -702,7 +722,16 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.29+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.3+ '''+ SELECT 1 AS "a"+ FROM "posthog_organizationmembership"+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 1+ '''+# ---+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.30'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -806,16 +835,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.3- '''- SELECT 1 AS "a"- FROM "posthog_organizationmembership"- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999)- LIMIT 1- '''-# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.30+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.31'''SELECT "posthog_dashboard"."id","posthog_dashboard"."name",@@ -845,7 +865,27 @@LIMIT 1'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.31+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.32+ '''+ SELECT "posthog_filesystem"."team_id",+ "posthog_filesystem"."id",+ "posthog_filesystem"."path",+ "posthog_filesystem"."depth",+ "posthog_filesystem"."type",+ "posthog_filesystem"."ref",+ "posthog_filesystem"."href",+ "posthog_filesystem"."shortcut",+ "posthog_filesystem"."meta",+ "posthog_filesystem"."created_at",+ "posthog_filesystem"."created_by_id",+ "posthog_filesystem"."project_id"+ FROM "posthog_filesystem"+ WHERE ("posthog_filesystem"."ref" = '0001'+ AND "posthog_filesystem"."team_id" = 99999+ AND "posthog_filesystem"."type" = 'dashboard')+ '''+# ---+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.33'''SELECT "posthog_dashboardtile"."id" AS "pk"FROM "posthog_dashboardtile"@@ -856,7 +896,7 @@AND "posthog_dashboardtile"."dashboard_id" = 99999)'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.32+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.34'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -952,7 +992,7 @@WHERE "posthog_team"."primary_dashboard_id" = 99999'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.33+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.35'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -1048,7 +1088,7 @@WHERE "posthog_team"."primary_dashboard_id" = 99999'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.34+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.36'''SELECT "posthog_taggeditem"."id","posthog_taggeditem"."tag_id",@@ -1066,7 +1106,7 @@WHERE "posthog_taggeditem"."dashboard_id" = 99999'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.35+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.37'''SELECT "posthog_tag"."id","posthog_tag"."name",@@ -1076,7 +1116,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.36+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.38'''SELECT "posthog_taggeditem"."id","posthog_taggeditem"."tag_id",@@ -1094,7 +1134,7 @@WHERE "posthog_taggeditem"."dashboard_id" = 99999'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.37+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.39'''SELECT "posthog_tag"."id","posthog_tag"."name",@@ -1104,7 +1144,40 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.38+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.4+ '''+ SELECT "posthog_featureflag"."id",+ "posthog_featureflag"."key",+ "posthog_featureflag"."name",+ "posthog_featureflag"."filters",+ "posthog_featureflag"."team_id",+ "posthog_featureflag"."created_by_id",+ "posthog_featureflag"."created_at",+ "posthog_featureflag"."updated_at",+ "posthog_featureflag"."deleted",+ "posthog_featureflag"."active",+ "posthog_featureflag"."version",+ "posthog_featureflag"."last_modified_by_id",+ "posthog_featureflag"."rollback_conditions",+ "posthog_featureflag"."performed_rollback",+ "posthog_featureflag"."ensure_experience_continuity",+ "posthog_featureflag"."usage_dashboard_id",+ "posthog_featureflag"."has_enriched_analytics",+ "posthog_featureflag"."is_remote_configuration",+ "posthog_featureflag"."has_encrypted_payloads",+ "posthog_featureflag"."evaluation_runtime",+ "posthog_featureflag"."bucketing_identifier",+ "posthog_featureflag"."last_called_at"+ FROM "posthog_featureflag"+ INNER JOIN "posthog_team" ON ("posthog_featureflag"."team_id" = "posthog_team"."id")+ WHERE (NOT ("posthog_featureflag"."deleted")+ AND "posthog_featureflag"."key" = 'copied-flag-key'+ AND "posthog_team"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_team"."project_id" = 99999)+ LIMIT 21+ '''+# ---+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.40'''SELECT "posthog_dashboardtile"."id","posthog_dashboardtile"."dashboard_id",@@ -1130,7 +1203,7 @@AND "posthog_dashboardtile"."dashboard_id" = 99999)'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.39+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.41'''SELECT "posthog_dashboardtile"."id","posthog_dashboardtile"."dashboard_id",@@ -1156,40 +1229,7 @@AND "posthog_dashboardtile"."dashboard_id" = 99999)'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.4- '''- SELECT "posthog_featureflag"."id",- "posthog_featureflag"."key",- "posthog_featureflag"."name",- "posthog_featureflag"."filters",- "posthog_featureflag"."team_id",- "posthog_featureflag"."created_by_id",- "posthog_featureflag"."created_at",- "posthog_featureflag"."updated_at",- "posthog_featureflag"."deleted",- "posthog_featureflag"."active",- "posthog_featureflag"."version",- "posthog_featureflag"."last_modified_by_id",- "posthog_featureflag"."rollback_conditions",- "posthog_featureflag"."performed_rollback",- "posthog_featureflag"."ensure_experience_continuity",- "posthog_featureflag"."usage_dashboard_id",- "posthog_featureflag"."has_enriched_analytics",- "posthog_featureflag"."is_remote_configuration",- "posthog_featureflag"."has_encrypted_payloads",- "posthog_featureflag"."evaluation_runtime",- "posthog_featureflag"."bucketing_identifier",- "posthog_featureflag"."last_called_at"- FROM "posthog_featureflag"- INNER JOIN "posthog_team" ON ("posthog_featureflag"."team_id" = "posthog_team"."id")- WHERE (NOT ("posthog_featureflag"."deleted")- AND "posthog_featureflag"."key" = 'copied-flag-key'- AND "posthog_team"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_team"."project_id" = 99999)- LIMIT 21- '''-# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.40+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.42'''SELECT "posthog_dashboarditem"."id","posthog_dashboarditem"."name",@@ -1225,7 +1265,7 @@AND "posthog_dashboarditem"."dashboard_id" = 99999)'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.41+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.43'''SELECT "posthog_dashboarditem"."id","posthog_dashboarditem"."name",@@ -1261,7 +1301,7 @@AND "posthog_dashboarditem"."dashboard_id" = 99999)'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.42+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.44'''SELECT "posthog_dashboarditem"."id","posthog_dashboarditem"."name",@@ -1298,7 +1338,7 @@AND "posthog_dashboardtile"."dashboard_id" = 99999)'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.43+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.45'''SELECT "posthog_dashboarditem"."id","posthog_dashboarditem"."name",@@ -1335,7 +1375,7 @@AND "posthog_dashboardtile"."dashboard_id" = 99999)'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.44+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.46'''SELECT "posthog_filesystem"."team_id","posthog_filesystem"."id",@@ -1357,7 +1397,7 @@AND "posthog_filesystem"."shortcut" IS NOT NULL))'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.45+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.47'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -1454,7 +1494,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.46+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.48'''SELECT "posthog_dashboarditem"."id","posthog_dashboarditem"."name",@@ -1490,7 +1530,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.47+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.49'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -1594,20 +1634,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.48- '''- SELECT "posthog_teamrevenueanalyticsconfig"."team_id",- "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",- "posthog_teamrevenueanalyticsconfig"."notified_first_sync",- "posthog_teamrevenueanalyticsconfig"."events",- "posthog_teamrevenueanalyticsconfig"."goals",- "posthog_teamrevenueanalyticsconfig"."base_currency"- FROM "posthog_teamrevenueanalyticsconfig"- WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999- LIMIT 21- '''-# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.49+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.5'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -1711,7 +1738,20 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.5+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.50+ '''+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",+ "posthog_teamrevenueanalyticsconfig"."events",+ "posthog_teamrevenueanalyticsconfig"."goals",+ "posthog_teamrevenueanalyticsconfig"."base_currency"+ FROM "posthog_teamrevenueanalyticsconfig"+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999+ LIMIT 21+ '''+# ---+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.51'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -1815,7 +1855,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.50+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.52'''SELECT "posthog_teammarketinganalyticsconfig"."team_id","posthog_teammarketinganalyticsconfig"."attribution_window_days",@@ -1830,7 +1870,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.51+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.53'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -1934,7 +1974,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.52+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.54'''SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id","customer_analytics_teamcustomeranalyticsconfig"."activity_event",@@ -1948,7 +1988,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.53+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.55'''SELECT 1 AS "a"FROM "access_control_propertyaccesscontrol"@@ -1957,7 +1997,7 @@LIMIT 1'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.54+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.56'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -2054,7 +2094,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.55+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.57'''SELECT "posthog_dashboardtile"."id","posthog_dashboardtile"."dashboard_id",@@ -2077,7 +2117,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.56+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.58'''SELECT "posthog_dashboarditem"."id","posthog_dashboarditem"."name",@@ -2113,7 +2153,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.57+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.59'''SELECT "posthog_dashboard"."id","posthog_dashboard"."name",@@ -2141,40 +2181,90 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.58+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.6'''- SELECT "posthog_team"."id",- "posthog_team"."uuid",- "posthog_team"."organization_id",- "posthog_team"."parent_team_id",- "posthog_team"."project_id",- "posthog_team"."api_token",- "posthog_team"."app_urls",- "posthog_team"."name",- "posthog_team"."slack_incoming_webhook",- "posthog_team"."created_at",- "posthog_team"."updated_at",- "posthog_team"."anonymize_ips",- "posthog_team"."completed_snippet_onboarding",- "posthog_team"."has_completed_onboarding_for",- "posthog_team"."onboarding_tasks",- "posthog_team"."ingested_event",- "posthog_team"."person_processing_opt_out",- "posthog_team"."secret_api_token",- "posthog_team"."secret_api_token_backup",- "posthog_team"."session_recording_opt_in",- "posthog_team"."session_recording_sample_rate",- "posthog_team"."session_recording_minimum_duration_milliseconds",- "posthog_team"."session_recording_linked_flag",- "posthog_team"."session_recording_network_payload_capture_config",- "posthog_team"."session_recording_masking_config",- "posthog_team"."session_recording_url_trigger_config",- "posthog_team"."session_recording_url_blocklist_config",- "posthog_team"."session_recording_event_trigger_config",- "posthog_team"."session_recording_trigger_match_type_config",- "posthog_team"."session_recording_trigger_groups",- "posthog_team"."session_replay_config",- "posthog_team"."session_recording_retention_period",+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21+ '''+# ---+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.60+ '''+ SELECT "posthog_team"."id",+ "posthog_team"."uuid",+ "posthog_team"."organization_id",+ "posthog_team"."parent_team_id",+ "posthog_team"."project_id",+ "posthog_team"."api_token",+ "posthog_team"."app_urls",+ "posthog_team"."name",+ "posthog_team"."slack_incoming_webhook",+ "posthog_team"."created_at",+ "posthog_team"."updated_at",+ "posthog_team"."anonymize_ips",+ "posthog_team"."completed_snippet_onboarding",+ "posthog_team"."has_completed_onboarding_for",+ "posthog_team"."onboarding_tasks",+ "posthog_team"."ingested_event",+ "posthog_team"."person_processing_opt_out",+ "posthog_team"."secret_api_token",+ "posthog_team"."secret_api_token_backup",+ "posthog_team"."session_recording_opt_in",+ "posthog_team"."session_recording_sample_rate",+ "posthog_team"."session_recording_minimum_duration_milliseconds",+ "posthog_team"."session_recording_linked_flag",+ "posthog_team"."session_recording_network_payload_capture_config",+ "posthog_team"."session_recording_masking_config",+ "posthog_team"."session_recording_url_trigger_config",+ "posthog_team"."session_recording_url_blocklist_config",+ "posthog_team"."session_recording_event_trigger_config",+ "posthog_team"."session_recording_trigger_match_type_config",+ "posthog_team"."session_recording_trigger_groups",+ "posthog_team"."session_replay_config",+ "posthog_team"."session_recording_retention_period","posthog_team"."conversations_enabled","posthog_team"."conversations_settings","posthog_team"."proactive_tasks_enabled",@@ -2245,7 +2335,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.59+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.61'''SELECT 1 AS "a"FROM "access_control_propertyaccesscontrol"@@ -2254,57 +2344,7 @@LIMIT 1'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.6- '''- SELECT "posthog_organizationmembership"."id",- "posthog_organizationmembership"."organization_id",- "posthog_organizationmembership"."user_id",- "posthog_organizationmembership"."level",- "posthog_organizationmembership"."joined_at",- "posthog_organizationmembership"."updated_at",- "posthog_organizationmembership"."invited_by_id",- "posthog_organization"."id",- "posthog_organization"."name",- "posthog_organization"."slug",- "posthog_organization"."logo_media_id",- "posthog_organization"."created_at",- "posthog_organization"."updated_at",- "posthog_organization"."is_active",- "posthog_organization"."is_not_active_reason",- "posthog_organization"."session_cookie_age",- "posthog_organization"."is_member_join_email_enabled",- "posthog_organization"."is_ai_data_processing_approved",- "posthog_organization"."is_ai_training_opted_in",- "posthog_organization"."is_ai_training_locked",- "posthog_organization"."is_ai_training_cta_shown",- "posthog_organization"."enforce_2fa",- "posthog_organization"."members_can_invite",- "posthog_organization"."members_can_use_personal_api_keys",- "posthog_organization"."allow_publicly_shared_resources",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "posthog_organization"."is_pending_deletion",- "posthog_organization"."customer_id",- "posthog_organization"."available_product_features",- "posthog_organization"."usage",- "posthog_organization"."never_drop_data",- "posthog_organization"."customer_trust_scores",- "posthog_organization"."setup_section_2_completed",- "posthog_organization"."personalization",- "posthog_organization"."domain_whitelist",- "posthog_organization"."is_platform"- FROM "posthog_organizationmembership"- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999)- LIMIT 21- '''-# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.60+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.62'''SELECT "posthog_filesystem"."team_id","posthog_filesystem"."id",@@ -2326,7 +2366,7 @@AND "posthog_filesystem"."shortcut" IS NOT NULL))'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.61+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.63'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -2423,7 +2463,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.62+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.64'''SELECT "posthog_dashboarditem"."id","posthog_dashboarditem"."name",@@ -2459,7 +2499,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.63+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.65'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -2563,7 +2603,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.64+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.66'''SELECT 1 AS "a"FROM "access_control_propertyaccesscontrol"@@ -2572,7 +2612,7 @@LIMIT 1'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.65+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.67'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -2669,7 +2709,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.66+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.68'''SELECT "posthog_dashboardtile"."id","posthog_dashboardtile"."dashboard_id",@@ -2692,7 +2732,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.67+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.69'''SELECT "posthog_dashboarditem"."id","posthog_dashboarditem"."name",@@ -2728,7 +2768,53 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.68+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.7+ '''+ SELECT "posthog_user"."id",+ "posthog_user"."password",+ "posthog_user"."last_login",+ "posthog_user"."first_name",+ "posthog_user"."last_name",+ "posthog_user"."is_staff",+ "posthog_user"."date_joined",+ "posthog_user"."uuid",+ "posthog_user"."current_organization_id",+ "posthog_user"."current_team_id",+ "posthog_user"."email",+ "posthog_user"."pending_email",+ "posthog_user"."distinct_id",+ "posthog_user"."is_email_verified",+ "posthog_user"."credentials_reviewed_at",+ "posthog_user"."requested_password_reset_at",+ "posthog_user"."requested_2fa_reset_at",+ "posthog_user"."has_seen_product_intro_for",+ "posthog_user"."strapi_id",+ "posthog_user"."is_active",+ "posthog_user"."role_at_organization",+ "posthog_user"."theme_mode",+ "posthog_user"."partial_notification_settings",+ "posthog_user"."anonymize_data",+ "posthog_user"."allow_impersonation",+ "posthog_user"."toolbar_mode",+ "posthog_user"."hedgehog_config",+ "posthog_user"."allow_sidebar_suggestions",+ "posthog_user"."shortcut_position",+ "posthog_user"."passkeys_enabled_for_2fa",+ "posthog_user"."hide_mcp_hints",+ "posthog_user"."onboarding_skipped_at",+ "posthog_user"."onboarding_skipped_reason",+ "posthog_user"."onboarding_skipped_organization_id",+ "posthog_user"."onboarding_delegated_to_invite_id",+ "posthog_user"."onboarding_delegated_to_organization_id",+ "posthog_user"."onboarding_delegation_accepted_at",+ "posthog_user"."events_column_config",+ "posthog_user"."email_opt_in"+ FROM "posthog_user"+ WHERE "posthog_user"."id" = 99999+ LIMIT 21+ '''+# ---+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.70'''SELECT "posthog_dashboard"."id","posthog_dashboard"."name",@@ -2756,7 +2842,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.69+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.71'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -2860,53 +2946,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.7- '''- SELECT "posthog_user"."id",- "posthog_user"."password",- "posthog_user"."last_login",- "posthog_user"."first_name",- "posthog_user"."last_name",- "posthog_user"."is_staff",- "posthog_user"."date_joined",- "posthog_user"."uuid",- "posthog_user"."current_organization_id",- "posthog_user"."current_team_id",- "posthog_user"."email",- "posthog_user"."pending_email",- "posthog_user"."distinct_id",- "posthog_user"."is_email_verified",- "posthog_user"."credentials_reviewed_at",- "posthog_user"."requested_password_reset_at",- "posthog_user"."requested_2fa_reset_at",- "posthog_user"."has_seen_product_intro_for",- "posthog_user"."strapi_id",- "posthog_user"."is_active",- "posthog_user"."role_at_organization",- "posthog_user"."theme_mode",- "posthog_user"."partial_notification_settings",- "posthog_user"."anonymize_data",- "posthog_user"."allow_impersonation",- "posthog_user"."toolbar_mode",- "posthog_user"."hedgehog_config",- "posthog_user"."allow_sidebar_suggestions",- "posthog_user"."shortcut_position",- "posthog_user"."passkeys_enabled_for_2fa",- "posthog_user"."hide_mcp_hints",- "posthog_user"."onboarding_skipped_at",- "posthog_user"."onboarding_skipped_reason",- "posthog_user"."onboarding_skipped_organization_id",- "posthog_user"."onboarding_delegated_to_invite_id",- "posthog_user"."onboarding_delegated_to_organization_id",- "posthog_user"."onboarding_delegation_accepted_at",- "posthog_user"."events_column_config",- "posthog_user"."email_opt_in"- FROM "posthog_user"- WHERE "posthog_user"."id" = 99999- LIMIT 21- '''-# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.70+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.72'''SELECT 1 AS "a"FROM "access_control_propertyaccesscontrol"@@ -2915,7 +2955,7 @@LIMIT 1'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.71+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.73'''SELECT "posthog_featureflag"."id","posthog_featureflag"."key",@@ -2946,7 +2986,7 @@LIMIT 1'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.72+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.74'''SELECT "posthog_filesystem"."team_id","posthog_filesystem"."id",@@ -2968,7 +3008,7 @@AND "posthog_filesystem"."shortcut" IS NOT NULL))'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.73+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.75'''SELECT "posthog_filesystemshortcut"."id","posthog_filesystemshortcut"."team_id",@@ -2988,7 +3028,7 @@AND "posthog_filesystemshortcut"."href" IS NOT NULL))'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.74+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.76'''SELECT "posthog_integration"."id","posthog_integration"."team_id",@@ -3007,7 +3047,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.75+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.77'''SELECT "posthog_organizationintegration"."id","posthog_organizationintegration"."organization_id",@@ -3024,7 +3064,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.76+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.78'''SELECT "posthog_taggeditem"."id","posthog_taggeditem"."tag_id",@@ -3042,7 +3082,7 @@WHERE "posthog_taggeditem"."feature_flag_id" = 99999'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.77+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.79'''SELECT "posthog_taggeditem"."id","posthog_taggeditem"."tag_id",@@ -3060,7 +3100,55 @@WHERE "posthog_taggeditem"."feature_flag_id" = 99999'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.78+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.8+ '''+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id",+ "posthog_organization"."name",+ "posthog_organization"."slug",+ "posthog_organization"."logo_media_id",+ "posthog_organization"."created_at",+ "posthog_organization"."updated_at",+ "posthog_organization"."is_active",+ "posthog_organization"."is_not_active_reason",+ "posthog_organization"."session_cookie_age",+ "posthog_organization"."is_member_join_email_enabled",+ "posthog_organization"."is_ai_data_processing_approved",+ "posthog_organization"."is_ai_training_opted_in",+ "posthog_organization"."is_ai_training_locked",+ "posthog_organization"."is_ai_training_cta_shown",+ "posthog_organization"."enforce_2fa",+ "posthog_organization"."members_can_invite",+ "posthog_organization"."members_can_use_personal_api_keys",+ "posthog_organization"."allow_publicly_shared_resources",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "posthog_organization"."is_pending_deletion",+ "posthog_organization"."customer_id",+ "posthog_organization"."available_product_features",+ "posthog_organization"."usage",+ "posthog_organization"."never_drop_data",+ "posthog_organization"."customer_trust_scores",+ "posthog_organization"."setup_section_2_completed",+ "posthog_organization"."personalization",+ "posthog_organization"."domain_whitelist",+ "posthog_organization"."is_platform"+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE "posthog_organizationmembership"."user_id" = 99999+ '''+# ---+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.80'''SELECT "posthog_survey"."id","posthog_survey"."team_id",@@ -3105,7 +3193,7 @@WHERE "posthog_survey"."internal_response_sampling_flag_id" = 99999'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.79+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.81'''SELECT "posthog_survey"."id","posthog_survey"."team_id",@@ -3150,55 +3238,7 @@WHERE "posthog_survey"."internal_response_sampling_flag_id" = 99999'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.8- '''- SELECT "posthog_organizationmembership"."id",- "posthog_organizationmembership"."organization_id",- "posthog_organizationmembership"."user_id",- "posthog_organizationmembership"."level",- "posthog_organizationmembership"."joined_at",- "posthog_organizationmembership"."updated_at",- "posthog_organizationmembership"."invited_by_id",- "posthog_organization"."id",- "posthog_organization"."name",- "posthog_organization"."slug",- "posthog_organization"."logo_media_id",- "posthog_organization"."created_at",- "posthog_organization"."updated_at",- "posthog_organization"."is_active",- "posthog_organization"."is_not_active_reason",- "posthog_organization"."session_cookie_age",- "posthog_organization"."is_member_join_email_enabled",- "posthog_organization"."is_ai_data_processing_approved",- "posthog_organization"."is_ai_training_opted_in",- "posthog_organization"."is_ai_training_locked",- "posthog_organization"."is_ai_training_cta_shown",- "posthog_organization"."enforce_2fa",- "posthog_organization"."members_can_invite",- "posthog_organization"."members_can_use_personal_api_keys",- "posthog_organization"."allow_publicly_shared_resources",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "posthog_organization"."is_pending_deletion",- "posthog_organization"."customer_id",- "posthog_organization"."available_product_features",- "posthog_organization"."usage",- "posthog_organization"."never_drop_data",- "posthog_organization"."customer_trust_scores",- "posthog_organization"."setup_section_2_completed",- "posthog_organization"."personalization",- "posthog_organization"."domain_whitelist",- "posthog_organization"."is_platform"- FROM "posthog_organizationmembership"- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE "posthog_organizationmembership"."user_id" = 99999- '''-# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.80+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.82'''SELECT "posthog_experiment"."id","posthog_experiment"."name",@@ -3235,7 +3275,7 @@AND NOT "posthog_experiment"."deleted")'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.81+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.83'''SELECT "posthog_experiment"."id","posthog_experiment"."name",@@ -3272,7 +3312,7 @@AND NOT "posthog_experiment"."deleted")'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.82+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.84'''SELECT "posthog_survey"."id","posthog_survey"."team_id",@@ -3317,7 +3357,7 @@WHERE "posthog_survey"."linked_flag_id" = 99999'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.83+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.85'''SELECT "posthog_earlyaccessfeature"."id","posthog_earlyaccessfeature"."team_id",@@ -3332,7 +3372,7 @@WHERE "posthog_earlyaccessfeature"."feature_flag_id" = 99999'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.84+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.86'''SELECT "posthog_organizationmembership"."id","posthog_organizationmembership"."organization_id",@@ -3382,7 +3422,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.85+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.87'''SELECT "posthog_dashboard"."id","posthog_dashboard"."name",@@ -3411,7 +3451,7 @@AND "posthog_featureflagdashboards"."feature_flag_id" = 99999)'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.86+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.88'''SELECT "posthog_organizationmembership"."id","posthog_organizationmembership"."organization_id",@@ -3461,7 +3501,7 @@LIMIT 21'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.87+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.89'''SELECT 1 AS "a"FROM "posthog_team"@@ -3470,7 +3510,15 @@LIMIT 1'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.88+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.9+ '''+ SELECT "posthog_team"."id",+ "posthog_team"."organization_id"+ FROM "posthog_team"+ WHERE "posthog_team"."organization_id" IN ('00000000-0000-0000-0000-000000000000'::uuid)+ '''+# ---+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.90'''SELECT "posthog_featureflagevaluationcontext"."id","posthog_featureflagevaluationcontext"."feature_flag_id",@@ -3485,7 +3533,7 @@WHERE "posthog_featureflagevaluationcontext"."feature_flag_id" = 99999'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.89+# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.91'''SELECT "posthog_tag"."name" AS "tag__name"FROM "posthog_taggeditem"@@ -3493,14 +3541,6 @@WHERE "posthog_taggeditem"."feature_flag_id" = 99999'''# ----# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.9- '''- SELECT "posthog_team"."id",- "posthog_team"."organization_id"- FROM "posthog_team"- WHERE "posthog_team"."organization_id" IN ('00000000-0000-0000-0000-000000000000'::uuid)- '''-# ---# name: TestOrganizationFeatureFlagGet.test_get_feature_flag_success'''SELECT "posthog_user"."id",