Skip to content

Commit edca080

Browse files
committed
Update migrations
1 parent 6769002 commit edca080

File tree

2 files changed

+131
-56
lines changed

2 files changed

+131
-56
lines changed
Lines changed: 129 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,173 @@
11
# Generated by Django 3.2.8 on 2021-12-02 14:22
22

3-
from django.db import migrations, models
43
import django.db.models.deletion
4+
from django.db import migrations, models
55

66

77
class Migration(migrations.Migration):
88

99
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"),
1414
]
1515

1616
operations = [
1717
migrations.CreateModel(
18-
name='PollContactResult',
18+
name="PollContactResult",
1919
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+
),
3266
],
3367
),
3468
migrations.CreateModel(
35-
name='ContactEngagementActivity',
69+
name="ContactEngagementActivity",
3670
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+
),
46105
],
47106
),
48107
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"),
51110
),
52111
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"),
55114
),
56115
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"),
59118
),
60119
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"),
63122
),
64123
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"),
67126
),
68127
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"),
71130
),
72131
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+
),
75136
),
76137
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+
),
79144
),
80145
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+
),
83152
),
84153
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+
),
87160
),
88161
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+
),
91168
),
92169
migrations.AlterUniqueTogether(
93-
name='contactengagementactivity',
94-
unique_together={('org', 'contact', 'date')},
170+
name="contactengagementactivity",
171+
unique_together={("org", "contact", "date")},
95172
),
96173
]

ureport/stats/migrations/0028_install_cea_triggers.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
class Migration(migrations.Migration):
99

1010
dependencies = [
11-
('stats', '0027_auto_20211202_1422'),
11+
("stats", "0027_auto_20211202_1422"),
1212
]
1313

14-
operations = [
15-
InstallSQL("stats_0028")
16-
]
14+
operations = [InstallSQL("stats_0028")]

0 commit comments

Comments
 (0)