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: drop dashboard privilege table (#120673)

Reece Jones25c5b047677a
diff --git a/.github/scripts/check-no-new-ee-files.py b/.github/scripts/check-no-new-ee-files.py
index 15af0b7ab756..0625703081ba 100644
--- a/.github/scripts/check-no-new-ee-files.py
+++ b/.github/scripts/check-no-new-ee-files.py
@@ -17,7 +17,11 @@ import subprocess
# Approved new files, one exact path each, added by hand after a human agreed in the pull
# request. Never add a glob, because it approves files nobody reviewed.
-EXEMPT: frozenset[str] = frozenset()
+EXEMPT: frozenset[str] = frozenset(
+ {
+ "ee/migrations/0068_drop_dashboardprivilege_table.py",
+ }
+)
def _git(*args: str) -> str:
diff --git a/ee/api/test/test_migrate_dashboard_collaborators.py b/ee/api/test/test_migrate_dashboard_collaborators.py
index f149df8bc031..3b8258d6420c 100644
--- a/ee/api/test/test_migrate_dashboard_collaborators.py
+++ b/ee/api/test/test_migrate_dashboard_collaborators.py
@@ -38,6 +38,9 @@ def _conversion_state() -> Any:
class TestMigrateDashboardCollaborators(APIBaseTest):
def setUp(self) -> None:
super().setUp()
+ if "ee_dashboardprivilege" not in connection.introspection.table_names():
+ with connection.schema_editor() as schema_editor:
+ schema_editor.create_model(_conversion_state().apps.get_model("ee", "DashboardPrivilege"))
self.organization.available_product_features = [
{"key": feature, "name": feature}
for feature in (AvailableFeature.ACCESS_CONTROL, AvailableFeature.ROLE_BASED_ACCESS)
@@ -461,6 +464,12 @@ class TestMigrateDashboardCollaborators(APIBaseTest):
class TestDashboardConversionTransactions(NonAtomicBaseTestKeepIdentities):
+ def setUp(self) -> None:
+ super().setUp()
+ if "ee_dashboardprivilege" not in connection.introspection.table_names():
+ with connection.schema_editor() as schema_editor:
+ schema_editor.create_model(_conversion_state().apps.get_model("ee", "DashboardPrivilege"))
+
def test_failed_dashboard_rolls_back_without_undoing_completed_dashboards(self) -> None:
self.organization.available_product_features = [{"key": AvailableFeature.ACCESS_CONTROL}]
self.organization.save()
diff --git a/ee/migrations/0068_drop_dashboardprivilege_table.py b/ee/migrations/0068_drop_dashboardprivilege_table.py
new file mode 100644
index 000000000000..425d3d4d0792
--- /dev/null
+++ b/ee/migrations/0068_drop_dashboardprivilege_table.py
@@ -0,0 +1,11 @@
+from django.db import migrations
+
+from posthog.migration_helpers import SafeDropTable
+
+
+class Migration(migrations.Migration):
+ dependencies = [("ee", "0067_remove_scimrequestlog_identity_provider_config_and_more")]
+
+ operations = [
+ SafeDropTable("ee_dashboardprivilege"),
+ ]
diff --git a/ee/migrations/max_migration.txt b/ee/migrations/max_migration.txt
index de272df57a2a..02c8159e61e1 100644
--- a/ee/migrations/max_migration.txt
+++ b/ee/migrations/max_migration.txt
@@ -1 +1 @@
-0067_remove_scimrequestlog_identity_provider_config_and_more
+0068_drop_dashboardprivilege_table