diff --git a/shared/django_apps/reports/migrations/0039_reportsession_upload_storage_path_idx.py b/shared/django_apps/reports/migrations/0039_reportsession_upload_storage_path_idx.py new file mode 100644 index 00000000..6e661b8a --- /dev/null +++ b/shared/django_apps/reports/migrations/0039_reportsession_upload_storage_path_idx.py @@ -0,0 +1,25 @@ +# Generated by Django 4.2.16 on 2025-01-28 15:28 + +from django.db import migrations, models + +""" +BEGIN; +-- +-- Create index upload_storage_path_idx on field(s) storage_path of model reportsession +-- +CREATE INDEX "upload_storage_path_idx" ON "reports_upload" ("storage_path"); +COMMIT; +""" + + +class Migration(migrations.Migration): + dependencies = [ + ("reports", "0038_remove_test_reports_test_repoid_name_testsuite_flags_hash"), + ] + + operations = [ + migrations.AddIndex( + model_name="reportsession", + index=models.Index(fields=["storage_path"], name="upload_storage_path_idx"), + ), + ] diff --git a/shared/django_apps/reports/models.py b/shared/django_apps/reports/models.py index d33f625a..fa564bda 100644 --- a/shared/django_apps/reports/models.py +++ b/shared/django_apps/reports/models.py @@ -202,6 +202,10 @@ class Meta: name="upload_report_type_idx", fields=["report_id", "upload_type"], ), + models.Index( + name="upload_storage_path_idx", + fields=["storage_path"], + ), ] @property