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(data-warehouse): drop the orphaned posthog_duckgresserverteam table (#75206)

Benjamin Knofe-Viderb2176f11c7af
diff --git a/posthog/migrations/1279_drop_duckgresserverteam_table.py b/posthog/migrations/1279_drop_duckgresserverteam_table.py
new file mode 100644
index 000000000000..8761b4aa1fe7
--- /dev/null
+++ b/posthog/migrations/1279_drop_duckgresserverteam_table.py
@@ -0,0 +1,19 @@
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("posthog", "1278_identityproviderconfig_config_scope_and_more"),
+ ]
+
+ operations = [
+ # Second step of the DuckgresServerTeam retirement: migration 1265 removed the
+ # model from Django state (per-team managed-warehouse state now lives in the
+ # duckgres control plane), and that change has been deployed for a full cycle
+ # with every environment reading the control plane. Drop the orphaned table,
+ # including its stale rows for organizations whose warehouses no longer exist.
+ migrations.RunSQL(
+ sql="DROP TABLE IF EXISTS posthog_duckgresserverteam;",
+ reverse_sql="", # No reverse - the table is obsolete and its data superseded
+ ),
+ ]
diff --git a/posthog/migrations/max_migration.txt b/posthog/migrations/max_migration.txt
index 68b4884554ca..071e5b0727a6 100644
--- a/posthog/migrations/max_migration.txt
+++ b/posthog/migrations/max_migration.txt
@@ -1 +1 @@
-1278_identityproviderconfig_config_scope_and_more
+1279_drop_duckgresserverteam_table