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(organization): drop the is_hipaa column (#96837)

Rafael Audibert3e427b488bc4
diff --git a/posthog/management/migration_analysis/hot_table_acknowledged_migrations.txt b/posthog/management/migration_analysis/hot_table_acknowledged_migrations.txt
index 7bd91b0fdecb..63a607c49fea 100644
--- a/posthog/management/migration_analysis/hot_table_acknowledged_migrations.txt
+++ b/posthog/management/migration_analysis/hot_table_acknowledged_migrations.txt
@@ -23,3 +23,4 @@ posthog.1284_organization_enforce_verified_domains
posthog.1304_organization_has_active_subscription
posthog.1322_organization_read_only_mcp_access
posthog.1341_organization_uses_most_specific_access_resolution
+posthog.1348_drop_organization_is_hipaa_column
diff --git a/posthog/migrations/1348_drop_organization_is_hipaa_column.py b/posthog/migrations/1348_drop_organization_is_hipaa_column.py
new file mode 100644
index 000000000000..8f851cb3f227
--- /dev/null
+++ b/posthog/migrations/1348_drop_organization_is_hipaa_column.py
@@ -0,0 +1,29 @@
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+ """Drop the `is_hipaa` column from posthog_organization.
+
+ Migration 1346 already removed it from Django's model state, so nothing reads or
+ writes it any more. This is the second phase from safe-django-migrations.md
+ "Dropping Columns": deploy the state removal, wait a full deploy cycle, then drop.
+
+ posthog_organization is a hot table, so this needs an acknowledgment in
+ hot_table_acknowledged_migrations.txt and a low-traffic deploy window. The drop
+ itself is metadata-only, so the ACCESS EXCLUSIVE lock is held for microseconds
+ once Postgres grants it. The risk is the wait for the lock, not the work.
+
+ Irreversible: the column data is gone. `reverse_sql` re-adds an empty nullable
+ column so the migration can be unapplied, but it cannot bring the values back.
+ """
+
+ dependencies = [
+ ("posthog", "1347_drop_activitylog_detail_jsonb_ops_gin"),
+ ]
+
+ operations = [
+ migrations.RunSQL(
+ sql='ALTER TABLE "posthog_organization" DROP COLUMN IF EXISTS "is_hipaa";',
+ reverse_sql='ALTER TABLE "posthog_organization" ADD COLUMN IF NOT EXISTS "is_hipaa" boolean NULL;',
+ ),
+ ]
diff --git a/posthog/migrations/max_migration.txt b/posthog/migrations/max_migration.txt
index 5d9e938849b0..bc15f7d0cac7 100644
--- a/posthog/migrations/max_migration.txt
+++ b/posthog/migrations/max_migration.txt
@@ -1 +1 @@
-1347_drop_activitylog_detail_jsonb_ops_gin
+1348_drop_organization_is_hipaa_column