Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

added data model index in analyzer report #2597

Merged
merged 1 commit into from
Dec 12, 2024
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
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
Loading