Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add indexes
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
  • Loading branch information
TG1999 committed Dec 18, 2024
commit 1177d57ffc2c9a9625aa25339fd0184ba2ac5ffc
3 changes: 3 additions & 0 deletions vulnerabilities/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,11 @@ class Meta:
unique_together = ["type", "namespace", "name", "version", "qualifiers", "subpath"]
ordering = ["type", "namespace", "name", "version_rank", "version", "qualifiers", "subpath"]
indexes = [
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a index for type, namespace, name, version

# Index for getting al versions of a package
models.Index(fields=["type", "namespace", "name"]),
models.Index(fields=["type", "namespace", "name", "qualifiers", "subpath"]),
# Index for getting a specific version of a package
models.Index(fields=["type", "namespace", "name", "version",])
]

def __str__(self):
Expand Down