forked from HHS/TANF-app
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into 3109-quarter-explainer
- Loading branch information
Showing
18 changed files
with
384 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
tdrs-backend/tdpservice/data_files/migrations/0014_reparsefilemeta.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Generated by Django 3.2.15 on 2024-10-08 12:18 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('search_indexes', '0031_alter_tribal_tanf_t4_closure_reason'), | ||
('data_files', '0013_datafile_reparse_meta'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='ReparseFileMeta', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('finished', models.BooleanField(default=False)), | ||
('success', models.BooleanField(default=False)), | ||
('started_at', models.DateTimeField(null=True)), | ||
('finished_at', models.DateTimeField(null=True)), | ||
('num_records_created', models.PositiveIntegerField(default=0)), | ||
('cat_4_errors_generated', models.PositiveIntegerField(default=0)), | ||
('data_file', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reparse_file_metas', to='data_files.datafile')), | ||
('reparse_meta', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reparse_file_metas', to='search_indexes.reparsemeta')), | ||
], | ||
), | ||
] |
20 changes: 20 additions & 0 deletions
20
tdrs-backend/tdpservice/data_files/migrations/0015_datafile_reparses.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Generated by Django 3.2.15 on 2024-10-04 12:17 | ||
|
||
from django.db import migrations, models | ||
from tdpservice.data_files.models import ReparseFileMeta | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('data_files', '0014_reparsefilemeta'), | ||
('search_indexes', '0031_alter_tribal_tanf_t4_closure_reason'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='datafile', | ||
name='reparses', | ||
field=models.ManyToManyField(help_text='Reparse events this file has been associated with.', related_name='files', through="data_files.ReparseFileMeta", to='search_indexes.ReparseMeta'), | ||
), | ||
] |
38 changes: 38 additions & 0 deletions
38
tdrs-backend/tdpservice/data_files/migrations/0016_remove_datafile_reparse_meta_models.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Generated by Django 3.2.15 on 2024-10-04 12:17 | ||
|
||
from django.db import migrations | ||
|
||
|
||
def switch_reparse_meta_through_model(apps, schema_editor): | ||
DataFile=apps.get_model("data_files","DataFile") | ||
ReparseMeta=apps.get_model("search_indexes","ReparseMeta") | ||
OldThru=DataFile.reparse_meta_models.through | ||
ReparseFileMeta=apps.get_model("data_files", "ReparseFileMeta") | ||
|
||
q = OldThru.objects.all() | ||
|
||
print(f'switching {q.count()} through models') | ||
|
||
for m in q: | ||
ReparseFileMeta.objects.create( | ||
data_file_id=m.datafile.pk, | ||
reparse_meta_id=m.reparsemeta.pk | ||
) | ||
m.delete() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('data_files', '0015_datafile_reparses'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython( | ||
switch_reparse_meta_through_model, | ||
), | ||
migrations.RemoveField( | ||
model_name='datafile', | ||
name='reparse_meta_models', | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.