Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions shared/django_apps/reports/migrations/0035_upload_indices_part1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 4.2.16 on 2024-11-28 12:26

from django.contrib.postgres.operations import AddIndexConcurrently
from django.db import migrations, models


class Migration(migrations.Migration):
atomic = False

dependencies = [
(
"reports",
"0034_remove_flake_created_at_remove_flake_updated_at",
),
]

operations = [
AddIndexConcurrently(
model_name="reportsession",
index=models.Index(
name="upload_report_type_idx",
fields=["report_id", "upload_type"],
),
),
]
7 changes: 6 additions & 1 deletion shared/django_apps/reports/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,13 @@ class Meta:
db_table = "reports_upload"
indexes = [
models.Index(
fields=["report_id", "upload_type", "order_number"],
name="upload_report_type_idx",
fields=["report_id", "upload_type"],
),
# TODO(swatinem): remove the index below in a followup migration:
models.Index(
name="upload_index_id_type_number",
fields=["report_id", "upload_type", "order_number"],
),
]

Expand Down
Loading