Skip to content

Commit 1177d57

Browse files
committed
Add indexes
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
1 parent 2fb1923 commit 1177d57

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

vulnerabilities/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,8 +723,11 @@ class Meta:
723723
unique_together = ["type", "namespace", "name", "version", "qualifiers", "subpath"]
724724
ordering = ["type", "namespace", "name", "version_rank", "version", "qualifiers", "subpath"]
725725
indexes = [
726+
# Index for getting al versions of a package
726727
models.Index(fields=["type", "namespace", "name"]),
727728
models.Index(fields=["type", "namespace", "name", "qualifiers", "subpath"]),
729+
# Index for getting a specific version of a package
730+
models.Index(fields=["type", "namespace", "name", "version",])
728731
]
729732

730733
def __str__(self):

0 commit comments

Comments
 (0)