|
1 | 1 | # Generated by Django 3.2.8 on 2021-12-02 14:22
|
2 | 2 |
|
3 |
| -from django.db import migrations, models |
4 | 3 | import django.db.models.deletion
|
| 4 | +from django.db import migrations, models |
5 | 5 |
|
6 | 6 |
|
7 | 7 | class Migration(migrations.Migration):
|
8 | 8 |
|
9 | 9 | dependencies = [
|
10 |
| - ('orgs', '0029_auto_20211025_1504'), |
11 |
| - ('flows', '0001_initial'), |
12 |
| - ('locations', '0006_boundary_backend'), |
13 |
| - ('stats', '0026_populate_flow_result_word_clouds'), |
| 10 | + ("orgs", "0029_auto_20211025_1504"), |
| 11 | + ("flows", "0001_initial"), |
| 12 | + ("locations", "0006_boundary_backend"), |
| 13 | + ("stats", "0026_populate_flow_result_word_clouds"), |
14 | 14 | ]
|
15 | 15 |
|
16 | 16 | operations = [
|
17 | 17 | migrations.CreateModel(
|
18 |
| - name='PollContactResult', |
| 18 | + name="PollContactResult", |
19 | 19 | fields=[
|
20 |
| - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
21 |
| - ('contact', models.CharField(max_length=36)), |
22 |
| - ('flow', models.CharField(max_length=36)), |
23 |
| - ('text', models.TextField(null=True)), |
24 |
| - ('date', models.DateTimeField(null=True)), |
25 |
| - ('age_segment', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='stats.agesegment')), |
26 |
| - ('flow_result', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='flows.flowresult')), |
27 |
| - ('flow_result_category', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='flows.flowresultcategory')), |
28 |
| - ('gender_segment', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='stats.gendersegment')), |
29 |
| - ('location', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='locations.boundary')), |
30 |
| - ('org', models.ForeignKey(db_index=False, on_delete=django.db.models.deletion.PROTECT, related_name='poll_contact_results', to='orgs.org')), |
31 |
| - ('scheme_segment', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='stats.schemesegment')), |
| 20 | + ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), |
| 21 | + ("contact", models.CharField(max_length=36)), |
| 22 | + ("flow", models.CharField(max_length=36)), |
| 23 | + ("text", models.TextField(null=True)), |
| 24 | + ("date", models.DateTimeField(null=True)), |
| 25 | + ( |
| 26 | + "age_segment", |
| 27 | + models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to="stats.agesegment"), |
| 28 | + ), |
| 29 | + ( |
| 30 | + "flow_result", |
| 31 | + models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to="flows.flowresult"), |
| 32 | + ), |
| 33 | + ( |
| 34 | + "flow_result_category", |
| 35 | + models.ForeignKey( |
| 36 | + null=True, on_delete=django.db.models.deletion.SET_NULL, to="flows.flowresultcategory" |
| 37 | + ), |
| 38 | + ), |
| 39 | + ( |
| 40 | + "gender_segment", |
| 41 | + models.ForeignKey( |
| 42 | + null=True, on_delete=django.db.models.deletion.SET_NULL, to="stats.gendersegment" |
| 43 | + ), |
| 44 | + ), |
| 45 | + ( |
| 46 | + "location", |
| 47 | + models.ForeignKey( |
| 48 | + null=True, on_delete=django.db.models.deletion.SET_NULL, to="locations.boundary" |
| 49 | + ), |
| 50 | + ), |
| 51 | + ( |
| 52 | + "org", |
| 53 | + models.ForeignKey( |
| 54 | + db_index=False, |
| 55 | + on_delete=django.db.models.deletion.PROTECT, |
| 56 | + related_name="poll_contact_results", |
| 57 | + to="orgs.org", |
| 58 | + ), |
| 59 | + ), |
| 60 | + ( |
| 61 | + "scheme_segment", |
| 62 | + models.ForeignKey( |
| 63 | + null=True, on_delete=django.db.models.deletion.SET_NULL, to="stats.schemesegment" |
| 64 | + ), |
| 65 | + ), |
32 | 66 | ],
|
33 | 67 | ),
|
34 | 68 | migrations.CreateModel(
|
35 |
| - name='ContactEngagementActivity', |
| 69 | + name="ContactEngagementActivity", |
36 | 70 | fields=[
|
37 |
| - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
38 |
| - ('contact', models.CharField(max_length=36)), |
39 |
| - ('date', models.DateField(help_text='The starting date for for the month')), |
40 |
| - ('used', models.BooleanField(null=True)), |
41 |
| - ('age_segment', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='stats.agesegment')), |
42 |
| - ('gender_segment', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='stats.gendersegment')), |
43 |
| - ('location', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='locations.boundary')), |
44 |
| - ('org', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='contact_engagement_activities', to='orgs.org')), |
45 |
| - ('scheme_segment', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='stats.schemesegment')), |
| 71 | + ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), |
| 72 | + ("contact", models.CharField(max_length=36)), |
| 73 | + ("date", models.DateField(help_text="The starting date for for the month")), |
| 74 | + ("used", models.BooleanField(null=True)), |
| 75 | + ( |
| 76 | + "age_segment", |
| 77 | + models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to="stats.agesegment"), |
| 78 | + ), |
| 79 | + ( |
| 80 | + "gender_segment", |
| 81 | + models.ForeignKey( |
| 82 | + null=True, on_delete=django.db.models.deletion.SET_NULL, to="stats.gendersegment" |
| 83 | + ), |
| 84 | + ), |
| 85 | + ( |
| 86 | + "location", |
| 87 | + models.ForeignKey( |
| 88 | + null=True, on_delete=django.db.models.deletion.SET_NULL, to="locations.boundary" |
| 89 | + ), |
| 90 | + ), |
| 91 | + ( |
| 92 | + "org", |
| 93 | + models.ForeignKey( |
| 94 | + on_delete=django.db.models.deletion.PROTECT, |
| 95 | + related_name="contact_engagement_activities", |
| 96 | + to="orgs.org", |
| 97 | + ), |
| 98 | + ), |
| 99 | + ( |
| 100 | + "scheme_segment", |
| 101 | + models.ForeignKey( |
| 102 | + null=True, on_delete=django.db.models.deletion.SET_NULL, to="stats.schemesegment" |
| 103 | + ), |
| 104 | + ), |
46 | 105 | ],
|
47 | 106 | ),
|
48 | 107 | migrations.AddIndex(
|
49 |
| - model_name='pollcontactresult', |
50 |
| - index=models.Index(fields=['contact'], name='stats_pcr_contact'), |
| 108 | + model_name="pollcontactresult", |
| 109 | + index=models.Index(fields=["contact"], name="stats_pcr_contact"), |
51 | 110 | ),
|
52 | 111 | migrations.AddIndex(
|
53 |
| - model_name='pollcontactresult', |
54 |
| - index=models.Index(fields=['org', 'flow', 'contact'], name='stats_pcr_org_flow_contact'), |
| 112 | + model_name="pollcontactresult", |
| 113 | + index=models.Index(fields=["org", "flow", "contact"], name="stats_pcr_org_flow_contact"), |
55 | 114 | ),
|
56 | 115 | migrations.AddIndex(
|
57 |
| - model_name='pollcontactresult', |
58 |
| - index=models.Index(fields=['org', 'flow'], name='stats_pcr_org_flow'), |
| 116 | + model_name="pollcontactresult", |
| 117 | + index=models.Index(fields=["org", "flow"], name="stats_pcr_org_flow"), |
59 | 118 | ),
|
60 | 119 | migrations.AddIndex(
|
61 |
| - model_name='pollcontactresult', |
62 |
| - index=models.Index(fields=['org', 'flow', 'flow_result', 'text'], name='stats_pcr_org_flow_result_text'), |
| 120 | + model_name="pollcontactresult", |
| 121 | + index=models.Index(fields=["org", "flow", "flow_result", "text"], name="stats_pcr_org_flow_result_text"), |
63 | 122 | ),
|
64 | 123 | migrations.AddIndex(
|
65 |
| - model_name='contactengagementactivity', |
66 |
| - index=models.Index(fields=['org', 'contact'], name='stats_cea_org_contact'), |
| 124 | + model_name="contactengagementactivity", |
| 125 | + index=models.Index(fields=["org", "contact"], name="stats_cea_org_contact"), |
67 | 126 | ),
|
68 | 127 | migrations.AddIndex(
|
69 |
| - model_name='contactengagementactivity', |
70 |
| - index=models.Index(fields=['org', 'date'], name='stats_cea_org_date'), |
| 128 | + model_name="contactengagementactivity", |
| 129 | + index=models.Index(fields=["org", "date"], name="stats_cea_org_date"), |
71 | 130 | ),
|
72 | 131 | migrations.AddIndex(
|
73 |
| - model_name='contactengagementactivity', |
74 |
| - index=models.Index(condition=models.Q(('used', True)), fields=['org', 'date', 'used'], name='stats_cea_org_date_used'), |
| 132 | + model_name="contactengagementactivity", |
| 133 | + index=models.Index( |
| 134 | + condition=models.Q(("used", True)), fields=["org", "date", "used"], name="stats_cea_org_date_used" |
| 135 | + ), |
75 | 136 | ),
|
76 | 137 | migrations.AddIndex(
|
77 |
| - model_name='contactengagementactivity', |
78 |
| - index=models.Index(condition=models.Q(('location__isnull', False), ('used', True)), fields=['org', 'date', 'location', 'used'], name='stats_cea_org_date_state_used'), |
| 138 | + model_name="contactengagementactivity", |
| 139 | + index=models.Index( |
| 140 | + condition=models.Q(("location__isnull", False), ("used", True)), |
| 141 | + fields=["org", "date", "location", "used"], |
| 142 | + name="stats_cea_org_date_state_used", |
| 143 | + ), |
79 | 144 | ),
|
80 | 145 | migrations.AddIndex(
|
81 |
| - model_name='contactengagementactivity', |
82 |
| - index=models.Index(condition=models.Q(('age_segment__isnull', False), ('used', True)), fields=['org', 'date', 'age_segment', 'used'], name='stats_cea_org_date_age_used'), |
| 146 | + model_name="contactengagementactivity", |
| 147 | + index=models.Index( |
| 148 | + condition=models.Q(("age_segment__isnull", False), ("used", True)), |
| 149 | + fields=["org", "date", "age_segment", "used"], |
| 150 | + name="stats_cea_org_date_age_used", |
| 151 | + ), |
83 | 152 | ),
|
84 | 153 | migrations.AddIndex(
|
85 |
| - model_name='contactengagementactivity', |
86 |
| - index=models.Index(condition=models.Q(('scheme_segment__isnull', False), ('used', True)), fields=['org', 'date', 'scheme_segment', 'used'], name='stats_cea_org_date_scheme_used'), |
| 154 | + model_name="contactengagementactivity", |
| 155 | + index=models.Index( |
| 156 | + condition=models.Q(("scheme_segment__isnull", False), ("used", True)), |
| 157 | + fields=["org", "date", "scheme_segment", "used"], |
| 158 | + name="stats_cea_org_date_scheme_used", |
| 159 | + ), |
87 | 160 | ),
|
88 | 161 | migrations.AddIndex(
|
89 |
| - model_name='contactengagementactivity', |
90 |
| - index=models.Index(condition=models.Q(('gender_segment__isnull', False), ('used', True)), fields=['org', 'date', 'gender_segment', 'used'], name='stats_cea_org_date_gender_used'), |
| 162 | + model_name="contactengagementactivity", |
| 163 | + index=models.Index( |
| 164 | + condition=models.Q(("gender_segment__isnull", False), ("used", True)), |
| 165 | + fields=["org", "date", "gender_segment", "used"], |
| 166 | + name="stats_cea_org_date_gender_used", |
| 167 | + ), |
91 | 168 | ),
|
92 | 169 | migrations.AlterUniqueTogether(
|
93 |
| - name='contactengagementactivity', |
94 |
| - unique_together={('org', 'contact', 'date')}, |
| 170 | + name="contactengagementactivity", |
| 171 | + unique_together={("org", "contact", "date")}, |
95 | 172 | ),
|
96 | 173 | ]
|
0 commit comments