Skip to content

Commit

Permalink
Concept/Mapping Indexes for repo version listing
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Feb 6, 2024
1 parent 81e50ba commit 5b55dba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/concepts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ class Meta:
),
models.Index(fields=['uri']),
models.Index(fields=['version']),
models.Index(
name='repo_version_concepts',
fields=['id'],
condition=Q(is_active=True, retired=False)
)
] + VersionedModel.Meta.indexes

external_id = models.TextField(null=True, blank=True)
Expand Down
5 changes: 5 additions & 0 deletions core/mappings/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ class Meta:
fields=['from_concept', 'parent_id'],
condition=(Q(id=F('versioned_object_id')))
),
models.Index(
name='repo_version_mappings',
fields=['id'],
condition=Q(is_active=True, retired=False)
),
] + VersionedModel.Meta.indexes
parent = models.ForeignKey('sources.Source', related_name='mappings_set', on_delete=models.CASCADE)
map_type = models.TextField()
Expand Down

0 comments on commit 5b55dba

Please sign in to comment.