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.

feat(project): add is_pending_deletion column (#62125)

Yasenaad772ef212c
diff --git a/posthog/api/test/notebooks/__snapshots__/test_notebook.ambr b/posthog/api/test/notebooks/__snapshots__/test_notebook.ambr
index 22da09a634d5..dca15ac1ef0a 100644
--- a/posthog/api/test/notebooks/__snapshots__/test_notebook.ambr
+++ b/posthog/api/test/notebooks/__snapshots__/test_notebook.ambr
@@ -271,7 +271,8 @@
"posthog_project"."organization_id",
"posthog_project"."name",
"posthog_project"."created_at",
- "posthog_project"."product_description"
+ "posthog_project"."product_description",
+ "posthog_project"."is_pending_deletion"
FROM "posthog_project"
WHERE "posthog_project"."id" = 99999
LIMIT 21
@@ -1176,7 +1177,8 @@
"posthog_project"."organization_id",
"posthog_project"."name",
"posthog_project"."created_at",
- "posthog_project"."product_description"
+ "posthog_project"."product_description",
+ "posthog_project"."is_pending_deletion"
FROM "posthog_project"
WHERE "posthog_project"."id" = 99999
LIMIT 21
@@ -1325,7 +1327,8 @@
"posthog_project"."organization_id",
"posthog_project"."name",
"posthog_project"."created_at",
- "posthog_project"."product_description"
+ "posthog_project"."product_description",
+ "posthog_project"."is_pending_deletion"
FROM "posthog_project"
WHERE "posthog_project"."id" = 99999
LIMIT 21
diff --git a/posthog/migrations/1217_project_is_pending_deletion.py b/posthog/migrations/1217_project_is_pending_deletion.py
new file mode 100644
index 000000000000..0c6574fb74cd
--- /dev/null
+++ b/posthog/migrations/1217_project_is_pending_deletion.py
@@ -0,0 +1,20 @@
+# Generated by Django 5.2.14 on 2026-06-08 10:54
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [("posthog", "1216_migrate_cohorts_models")]
+
+ operations = [
+ migrations.AddField(
+ model_name="project",
+ name="is_pending_deletion",
+ field=models.BooleanField(
+ blank=True,
+ default=False,
+ help_text="Set to True when project deletion has been initiated. Blocks UI access to this project until the async task completes.",
+ null=True,
+ ),
+ ),
+ ]
diff --git a/posthog/migrations/max_migration.txt b/posthog/migrations/max_migration.txt
index 089c457074e5..44335a24d758 100644
--- a/posthog/migrations/max_migration.txt
+++ b/posthog/migrations/max_migration.txt
@@ -1 +1 @@
-1216_migrate_cohorts_models
+1217_project_is_pending_deletion
diff --git a/posthog/models/project.py b/posthog/models/project.py
index 0927d2fed198..c9d674832d25 100644
--- a/posthog/models/project.py
+++ b/posthog/models/project.py
@@ -50,6 +50,12 @@ class Project(UpdatedMetaFields):
created_at = models.DateTimeField(auto_now_add=True)
# Deprecated in favor of CoreMemory
product_description = models.TextField(null=True, blank=True, max_length=1000)
+ is_pending_deletion = models.BooleanField(
+ default=False,
+ null=True,
+ blank=True,
+ help_text="Set to True when project deletion has been initiated. Blocks UI access to this project until the async task completes.",
+ )
objects: ProjectManager = ProjectManager()
diff --git a/products/actions/backend/api/test/__snapshots__/test_action.ambr b/products/actions/backend/api/test/__snapshots__/test_action.ambr
index 11ae5e23379e..ad41f86c0a71 100644
--- a/products/actions/backend/api/test/__snapshots__/test_action.ambr
+++ b/products/actions/backend/api/test/__snapshots__/test_action.ambr
@@ -229,7 +229,8 @@
"posthog_project"."organization_id",
"posthog_project"."name",
"posthog_project"."created_at",
- "posthog_project"."product_description"
+ "posthog_project"."product_description",
+ "posthog_project"."is_pending_deletion"
FROM "posthog_project"
WHERE "posthog_project"."id" = 99999
LIMIT 21
@@ -855,7 +856,8 @@
"posthog_project"."organization_id",
"posthog_project"."name",
"posthog_project"."created_at",
- "posthog_project"."product_description"
+ "posthog_project"."product_description",
+ "posthog_project"."is_pending_deletion"
FROM "posthog_project"
WHERE "posthog_project"."id" = 99999
LIMIT 21
@@ -1122,7 +1124,8 @@
"posthog_project"."organization_id",
"posthog_project"."name",
"posthog_project"."created_at",
- "posthog_project"."product_description"
+ "posthog_project"."product_description",
+ "posthog_project"."is_pending_deletion"
FROM "posthog_project"
WHERE "posthog_project"."id" = 99999
LIMIT 21
diff --git a/products/annotations/backend/api/test/__snapshots__/test_annotation.ambr b/products/annotations/backend/api/test/__snapshots__/test_annotation.ambr
index 360fec8c6588..1d82d2a75d97 100644
--- a/products/annotations/backend/api/test/__snapshots__/test_annotation.ambr
+++ b/products/annotations/backend/api/test/__snapshots__/test_annotation.ambr
@@ -229,7 +229,8 @@
"posthog_project"."organization_id",
"posthog_project"."name",
"posthog_project"."created_at",
- "posthog_project"."product_description"
+ "posthog_project"."product_description",
+ "posthog_project"."is_pending_deletion"
FROM "posthog_project"
WHERE "posthog_project"."id" = 99999
LIMIT 21
@@ -864,7 +865,8 @@
"posthog_project"."organization_id",
"posthog_project"."name",
"posthog_project"."created_at",
- "posthog_project"."product_description"
+ "posthog_project"."product_description",
+ "posthog_project"."is_pending_deletion"
FROM "posthog_project"
WHERE "posthog_project"."id" = 99999
LIMIT 21
@@ -1140,7 +1142,8 @@
"posthog_project"."organization_id",
"posthog_project"."name",
"posthog_project"."created_at",
- "posthog_project"."product_description"
+ "posthog_project"."product_description",
+ "posthog_project"."is_pending_deletion"
FROM "posthog_project"
WHERE "posthog_project"."id" = 99999
LIMIT 21
diff --git a/products/feature_flags/backend/api/test/__snapshots__/test_feature_flag.ambr b/products/feature_flags/backend/api/test/__snapshots__/test_feature_flag.ambr
index 7d76ca5bb63f..b06cb7b6c311 100644
--- a/products/feature_flags/backend/api/test/__snapshots__/test_feature_flag.ambr
+++ b/products/feature_flags/backend/api/test/__snapshots__/test_feature_flag.ambr
@@ -2692,7 +2692,8 @@
"posthog_project"."organization_id",
"posthog_project"."name",
"posthog_project"."created_at",
- "posthog_project"."product_description"
+ "posthog_project"."product_description",
+ "posthog_project"."is_pending_deletion"
FROM "posthog_project"
WHERE "posthog_project"."id" = 99999
LIMIT 21