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(workflows): drop the dead email reputation snapshot table (#75277)

Meikel Ratz1b9a59d03227
diff --git a/products/workflows/backend/migrations/0017_drop_emailreputationsnapshot_table.py b/products/workflows/backend/migrations/0017_drop_emailreputationsnapshot_table.py
new file mode 100644
index 000000000000..774b31347154
--- /dev/null
+++ b/products/workflows/backend/migrations/0017_drop_emailreputationsnapshot_table.py
@@ -0,0 +1,20 @@
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("workflows", "0016_drop_emailreputationsnapshot_fk"),
+ ]
+
+ # Phase 2 of the two-phase table drop (safe-django-migrations.md, "Dropping Tables").
+ # 0015 removed EmailReputationSnapshot from Django state and 0016 dropped its FK to
+ # posthog_hogflow; the physical table has been dead ever since. This drops it now that the
+ # state removal has shipped. Irreversible by nature — the reverse is a no-op rather than a
+ # bogus CREATE TABLE, so a rollback past this point simply leaves the table absent (nothing
+ # reads or writes it).
+ operations = [
+ migrations.RunSQL(
+ sql='DROP TABLE IF EXISTS "posthog_emailreputationsnapshot";',
+ reverse_sql=migrations.RunSQL.noop,
+ ),
+ ]
diff --git a/products/workflows/backend/migrations/max_migration.txt b/products/workflows/backend/migrations/max_migration.txt
index 92b4c0e3895c..862851e8e8bd 100644
--- a/products/workflows/backend/migrations/max_migration.txt
+++ b/products/workflows/backend/migrations/max_migration.txt
@@ -1 +1 @@
-0016_drop_emailreputationsnapshot_fk
+0017_drop_emailreputationsnapshot_table