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(file-system): drop the PersistedFolder table (#97096)

posthog[bot]523fb0a7f701
diff --git a/posthog/migrations/1351_drop_persistedfolder_table.py b/posthog/migrations/1351_drop_persistedfolder_table.py
new file mode 100644
index 000000000000..f4353bf9cd53
--- /dev/null
+++ b/posthog/migrations/1351_drop_persistedfolder_table.py
@@ -0,0 +1,17 @@
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("posthog", "1350_alter_userscenepersonalisation_dashboard"),
+ ]
+
+ operations = [
+ # 1349 removed the model from Django state and dropped the two foreign keys, so this takes
+ # ACCESS EXCLUSIVE on the dead table alone. No table points at it, and the drop takes the
+ # three unused indexes with it.
+ migrations.RunSQL(
+ sql="DROP TABLE IF EXISTS posthog_persistedfolder;",
+ reverse_sql=migrations.RunSQL.noop,
+ ),
+ ]
diff --git a/posthog/migrations/max_migration.txt b/posthog/migrations/max_migration.txt
index b62675790611..6af560e16578 100644
--- a/posthog/migrations/max_migration.txt
+++ b/posthog/migrations/max_migration.txt
@@ -1 +1 @@
-1350_alter_userscenepersonalisation_dashboard
+1351_drop_persistedfolder_table