Skip to content

Commit 2df1fd0

Browse files
committed
fix(migration): Rebase and merge migrations
1 parent 0e82690 commit 2df1fd0

6 files changed

+145
-220
lines changed
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# Generated by Django 4.2.19 on 2025-08-12 14:58
2+
3+
import django.db.models.deletion
4+
from django.conf import settings
5+
from django.db import migrations, models
6+
7+
import main.fields
8+
9+
10+
class Migration(migrations.Migration):
11+
12+
dependencies = [
13+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
14+
("api", "0220_event_ifrc_severity_level_update_date_and_more"),
15+
("local_units", "0020_alter_localunit_created_at"),
16+
]
17+
18+
operations = [
19+
migrations.AddField(
20+
model_name="localunit",
21+
name="is_new_local_unit",
22+
field=models.BooleanField(default=False, verbose_name="Is New Local Unit?"),
23+
),
24+
migrations.AddField(
25+
model_name="localunit",
26+
name="status",
27+
field=models.IntegerField(
28+
choices=[(1, "Validated"), (2, "Unvalidated"), (3, "Pending Edit Validation")],
29+
default=2,
30+
verbose_name="Validation Status",
31+
),
32+
),
33+
migrations.AddField(
34+
model_name="localunit",
35+
name="update_reason_overview",
36+
field=models.TextField(blank=True, null=True, verbose_name="Explain the reason why the local unit is being updated"),
37+
),
38+
migrations.CreateModel(
39+
name="LocalUnitBulkUpload",
40+
fields=[
41+
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
42+
("success_count", models.PositiveIntegerField(default=0, verbose_name="Success Count")),
43+
("failed_count", models.PositiveIntegerField(default=0, verbose_name="Failed Count")),
44+
("file_size", models.PositiveIntegerField(default=0, verbose_name="File Size")),
45+
("status", models.IntegerField(choices=[(1, "Success"), (2, "Failed"), (3, "Pending")], verbose_name="Status")),
46+
("triggered_at", models.DateTimeField(auto_now_add=True, verbose_name="Triggered At")),
47+
("file", main.fields.SecureFileField(upload_to="local_unit/bulk_uploads/", verbose_name="Uploaded File")),
48+
(
49+
"error_file",
50+
main.fields.SecureFileField(
51+
blank=True, null=True, upload_to="local_unit/bulk_upload_errors/", verbose_name="Error File"
52+
),
53+
),
54+
("error_message", models.TextField(blank=True, null=True, verbose_name="Error Message")),
55+
(
56+
"country",
57+
models.ForeignKey(
58+
on_delete=django.db.models.deletion.CASCADE,
59+
related_name="bulk_upload_local_unit_country",
60+
to="api.country",
61+
verbose_name="Country",
62+
),
63+
),
64+
(
65+
"local_unit_type",
66+
models.ForeignKey(
67+
on_delete=django.db.models.deletion.CASCADE,
68+
related_name="bulk_upload_local_unit_type",
69+
to="local_units.localunittype",
70+
verbose_name="Local Unit Type",
71+
),
72+
),
73+
(
74+
"triggered_by",
75+
models.ForeignKey(
76+
null=True,
77+
on_delete=django.db.models.deletion.SET_NULL,
78+
related_name="triggered_by_bulk_upload",
79+
to=settings.AUTH_USER_MODEL,
80+
verbose_name="Triggered By",
81+
),
82+
),
83+
],
84+
),
85+
migrations.CreateModel(
86+
name="ExternallyManagedLocalUnit",
87+
fields=[
88+
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
89+
("created_at", models.DateTimeField(auto_now_add=True)),
90+
("updated_at", models.DateTimeField(auto_now=True)),
91+
("enabled", models.BooleanField(default=False)),
92+
(
93+
"country",
94+
models.ForeignKey(
95+
on_delete=django.db.models.deletion.CASCADE,
96+
related_name="externally_managed_local_unit_country",
97+
to="api.country",
98+
verbose_name="Country",
99+
),
100+
),
101+
(
102+
"created_by",
103+
models.ForeignKey(
104+
null=True,
105+
on_delete=django.db.models.deletion.SET_NULL,
106+
related_name="created_external_local_units",
107+
to=settings.AUTH_USER_MODEL,
108+
),
109+
),
110+
(
111+
"local_unit_type",
112+
models.ForeignKey(
113+
on_delete=django.db.models.deletion.CASCADE,
114+
related_name="externally_managed_local_unit_type",
115+
to="local_units.localunittype",
116+
verbose_name="Type",
117+
),
118+
),
119+
(
120+
"updated_by",
121+
models.ForeignKey(
122+
null=True,
123+
on_delete=django.db.models.deletion.SET_NULL,
124+
related_name="updated_external_local_units",
125+
to=settings.AUTH_USER_MODEL,
126+
),
127+
),
128+
],
129+
),
130+
migrations.AddField(
131+
model_name="localunit",
132+
name="bulk_upload",
133+
field=models.ForeignKey(
134+
null=True,
135+
on_delete=django.db.models.deletion.SET_NULL,
136+
related_name="bulk_upload_local_unit",
137+
to="local_units.localunitbulkupload",
138+
verbose_name="Bulk Upload Local Unit",
139+
),
140+
),
141+
migrations.AddConstraint(
142+
model_name="externallymanagedlocalunit",
143+
constraint=models.UniqueConstraint(fields=("country", "local_unit_type"), name="unique_country_local_unit_type"),
144+
),
145+
]

local_units/migrations/0021_localunit_update_reason_overview_and_more.py

Lines changed: 0 additions & 71 deletions
This file was deleted.

local_units/migrations/0021_localunitbulkupload_localunit_bulk_upload.py

Lines changed: 0 additions & 76 deletions
This file was deleted.

local_units/migrations/0022_localunit_is_new_local_unit.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

local_units/migrations/0023_merge_20250808_1036.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

local_units/migrations/0024_localunit_status_localunitbulkupload_error_message.py

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)