diff --git a/snpdb/management/commands/one_off_fix_csv_quoting.py b/snpdb/management/commands/one_off_fix_csv_export_quoting.py similarity index 100% rename from snpdb/management/commands/one_off_fix_csv_quoting.py rename to snpdb/management/commands/one_off_fix_csv_export_quoting.py diff --git a/snpdb/migrations/0151_one_off_fix_csv_export_quoting.py b/snpdb/migrations/0151_one_off_fix_csv_export_quoting.py new file mode 100644 index 000000000..d8601ae64 --- /dev/null +++ b/snpdb/migrations/0151_one_off_fix_csv_export_quoting.py @@ -0,0 +1,24 @@ +# Generated by Django 4.2.9 on 2024-10-08 06:29 + +from django.db import migrations + +from manual.operations.manual_operations import ManualOperation + + +def _test_for_csv_export(apps): + CachedGeneratedFile = apps.get_model("snpdb", "CachedGeneratedFile") + + AFFECTED_GENERATORS = ["export_sample_to_downloadable_file", "export_cohort_to_downloadable_file"] + return CachedGeneratedFile.objects.filter(generator__in=AFFECTED_GENERATORS, filename__icontains='.csv').exists() + + +class Migration(migrations.Migration): + + dependencies = [ + ("snpdb", "0150_rename_cachedgeneratedfile2_cachedgeneratedfile"), + ] + + operations = [ + ManualOperation(task_id=ManualOperation.task_id_manage(["one_off_fix_csv_export_quoting"]), + test=_test_for_csv_export) + ]