Skip to content

Commit 32e402b

Browse files
committed
refactor(surveys): rename migration 0906 to 0907 for index
1 parent 6847af2 commit 32e402b

File tree

4 files changed

+42
-24
lines changed

4 files changed

+42
-24
lines changed

posthog/migrations/0906_survey_linked_insight_index.py

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Generated by Django 4.2.26 on 2025-11-20 04:53
2+
3+
import django.db.models.deletion
4+
from django.db import migrations, models
5+
6+
7+
# manually updated to pass CI checks, using SeparateDatabaseAndState
8+
class Migration(migrations.Migration):
9+
dependencies = [
10+
("posthog", "0913_alter_survey_linked_insight"),
11+
]
12+
13+
operations = [
14+
migrations.SeparateDatabaseAndState(
15+
state_operations=[
16+
migrations.AlterField(
17+
model_name="survey",
18+
name="linked_insight",
19+
field=models.ForeignKey(
20+
blank=True,
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+
"""
32+
CREATE INDEX IF NOT EXISTS "posthog_survey_linked_insight_id_586524f3" ON "posthog_survey" ("linked_insight_id"); -- existing-table-constraint-ignore
33+
""",
34+
reverse_sql="""
35+
DROP INDEX IF EXISTS "posthog_survey_linked_insight_id_586524f3";
36+
""",
37+
),
38+
],
39+
),
40+
]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0913_alter_survey_linked_insight
1+
0914_alter_survey_linked_insight

posthog/models/surveys/survey.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class Meta:
7878
on_delete=models.SET_NULL,
7979
related_name="surveys_linked_insight",
8080
related_query_name="survey_linked_insight",
81-
db_index=False,
81+
db_index=True,
8282
db_constraint=True,
8383
)
8484
internal_targeting_flag = models.ForeignKey(

0 commit comments

Comments
 (0)