Skip to content

Commit 5b5c91d

Browse files
added data model index in analyzer report (#2597)
1 parent 155969f commit 5b5c91d

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Generated by Django 4.2.16 on 2024-12-12 11:45
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("analyzers_manager", "0139_alter_analyzerconfig_mapping_data_model"),
10+
]
11+
12+
operations = [
13+
migrations.AddIndex(
14+
model_name="analyzerreport",
15+
index=models.Index(
16+
fields=["data_model_content_type", "data_model_object_id"],
17+
name="analyzers_m_data_mo_a1952b_idx",
18+
),
19+
),
20+
]

api_app/analyzers_manager/models.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ class AnalyzerReport(AbstractReport):
5050

5151
class Meta:
5252
unique_together = [("config", "job")]
53-
indexes = AbstractReport.Meta.indexes
53+
indexes = AbstractReport.Meta.indexes + [
54+
models.Index(fields=["data_model_content_type", "data_model_object_id"])
55+
]
5456

5557
def clean(self):
5658
if self.data_model_content_type:

0 commit comments

Comments
 (0)