File tree Expand file tree Collapse file tree 3 files changed +42
-2
lines changed Expand file tree Collapse file tree 3 files changed +42
-2
lines changed Original file line number Diff line number Diff line change 1+ # Generated by Django 4.2.26 on 2025-11-20 02:30
2+
3+ import django .db .models .deletion
4+ from django .db import migrations , models
5+
6+
7+ class Migration (migrations .Migration ):
8+ dependencies = [
9+ ("posthog" , "0912_alter_survey_linked_insight_type" ),
10+ ]
11+
12+ operations = [
13+ migrations .SeparateDatabaseAndState (
14+ state_operations = [
15+ migrations .AlterField (
16+ model_name = "survey" ,
17+ name = "linked_insight" ,
18+ field = models .ForeignKey (
19+ blank = True ,
20+ db_index = False ,
21+ null = True ,
22+ on_delete = django .db .models .deletion .SET_NULL ,
23+ related_name = "surveys_linked_insight" ,
24+ related_query_name = "survey_linked_insight" ,
25+ to = "posthog.insight" ,
26+ ),
27+ ),
28+ ],
29+ database_operations = [
30+ migrations .RunSQL (
31+ sql = """
32+ ALTER TABLE "posthog_survey" ADD CONSTRAINT "posthog_survey_linked_insight_id_586524f3_fk_posthog_d" FOREIGN KEY ("linked_insight_id") REFERENCES "posthog_dashboarditem" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID; -- existing-table-constraint-ignore
33+ """ ,
34+ reverse_sql = """
35+ ALTER TABLE "posthog_survey" DROP CONSTRAINT IF EXISTS "posthog_survey_linked_insight_id_586524f3_fk_posthog_d";
36+ """ ,
37+ ),
38+ ],
39+ ),
40+ ]
Original file line number Diff line number Diff line change 1- 0912_alter_survey_linked_insight_type
1+ 0913_alter_survey_linked_insight
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ class Meta:
7979 related_name = "surveys_linked_insight" ,
8080 related_query_name = "survey_linked_insight" ,
8181 db_index = False ,
82- db_constraint = False , # Constraint will be added in follow-up migration
82+ db_constraint = True ,
8383 )
8484 internal_targeting_flag = models .ForeignKey (
8585 "posthog.FeatureFlag" ,
You can’t perform that action at this time.
0 commit comments