Skip to content

Commit

Permalink
added data model index in analyzer report (#2597)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristinaascari authored Dec 12, 2024
1 parent 155969f commit 5b5c91d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 4.2.16 on 2024-12-12 11:45

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("analyzers_manager", "0139_alter_analyzerconfig_mapping_data_model"),
]

operations = [
migrations.AddIndex(
model_name="analyzerreport",
index=models.Index(
fields=["data_model_content_type", "data_model_object_id"],
name="analyzers_m_data_mo_a1952b_idx",
),
),
]
4 changes: 3 additions & 1 deletion api_app/analyzers_manager/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ class AnalyzerReport(AbstractReport):

class Meta:
unique_together = [("config", "job")]
indexes = AbstractReport.Meta.indexes
indexes = AbstractReport.Meta.indexes + [
models.Index(fields=["data_model_content_type", "data_model_object_id"])
]

def clean(self):
if self.data_model_content_type:
Expand Down

0 comments on commit 5b5c91d

Please # to comment.