From bb417f1e682732646b8a594210079a1a7f6bdb9c Mon Sep 17 00:00:00 2001 From: Neil Kakkar Date: Tue, 12 Sep 2023 13:44:01 +0100 Subject: [PATCH] chore(surveys): Update model query name for survey (#17387) --- latest_migrations.manifest | 2 +- .../0349_update_survey_query_name.py | 38 +++++++++++++++++++ posthog/models/feedback/survey.py | 4 +- 3 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 posthog/migrations/0349_update_survey_query_name.py diff --git a/latest_migrations.manifest b/latest_migrations.manifest index d53b210a470de..2db90ee7e8674 100644 --- a/latest_migrations.manifest +++ b/latest_migrations.manifest @@ -5,7 +5,7 @@ contenttypes: 0002_remove_content_type_name ee: 0015_add_verified_properties otp_static: 0002_throttling otp_totp: 0002_auto_20190420_0723 -posthog: 0348_alter_datawarehousetable_format +posthog: 0349_update_survey_query_name sessions: 0001_initial social_django: 0010_uid_db_index two_factor: 0007_auto_20201201_1019 diff --git a/posthog/migrations/0349_update_survey_query_name.py b/posthog/migrations/0349_update_survey_query_name.py new file mode 100644 index 0000000000000..cbcbbb3a0c954 --- /dev/null +++ b/posthog/migrations/0349_update_survey_query_name.py @@ -0,0 +1,38 @@ +# Generated by Django 3.2.19 on 2023-09-12 10:35 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ("posthog", "0348_alter_datawarehousetable_format"), + ] + + operations = [ + migrations.AlterField( + model_name="survey", + name="linked_flag", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="surveys_linked_flag", + related_query_name="survey_linked_flag", + to="posthog.featureflag", + ), + ), + migrations.AlterField( + model_name="survey", + name="targeting_flag", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="surveys_targeting_flag", + related_query_name="survey_targeting_flag", + to="posthog.featureflag", + ), + ), + ] diff --git a/posthog/models/feedback/survey.py b/posthog/models/feedback/survey.py index 9579ab7a5a782..5287747ea98f5 100644 --- a/posthog/models/feedback/survey.py +++ b/posthog/models/feedback/survey.py @@ -24,7 +24,7 @@ class Meta: blank=True, on_delete=models.SET_NULL, related_name="surveys_linked_flag", - related_query_name="survey", + related_query_name="survey_linked_flag", ) targeting_flag: models.ForeignKey = models.ForeignKey( "posthog.FeatureFlag", @@ -32,7 +32,7 @@ class Meta: blank=True, on_delete=models.SET_NULL, related_name="surveys_targeting_flag", - related_query_name="survey", + related_query_name="survey_targeting_flag", ) type: models.CharField = models.CharField(max_length=40, choices=SurveyType.choices)