-
-
Notifications
You must be signed in to change notification settings - Fork 248
Add indexes for models #1701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add indexes for models #1701
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7ac1589
Reorder Meta and core properties
TG1999 96027c7
Add todo
TG1999 560b73d
Add indexes on models
TG1999 2fb1923
Add migrations
TG1999 1177d57
Add indexes
TG1999 06c1586
Add migrations
TG1999 874d8f0
Fix formatting issues
TG1999 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
83 changes: 83 additions & 0 deletions
83
...erabilities/migrations/0085_alter_package_is_ghost_alter_package_version_rank_and_more.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| # Generated by Django 4.2.16 on 2024-12-18 10:09 | ||
|
|
||
| import aboutcode.hashid | ||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ("vulnerabilities", "0084_alter_package_options_package_version_rank"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AlterField( | ||
| model_name="package", | ||
| name="is_ghost", | ||
| field=models.BooleanField( | ||
| db_index=True, | ||
| default=False, | ||
| help_text="True if the package does not exist in the upstream package manager or its repository.", | ||
| ), | ||
| ), | ||
| migrations.AlterField( | ||
| model_name="package", | ||
| name="version_rank", | ||
| field=models.IntegerField( | ||
| db_index=True, | ||
| default=0, | ||
| help_text="Rank of the version to support ordering by version. Rank zero means the rank has not been defined yet", | ||
| ), | ||
| ), | ||
| migrations.AlterField( | ||
| model_name="vulnerability", | ||
| name="vulnerability_id", | ||
| field=models.CharField( | ||
| blank=True, | ||
| db_index=True, | ||
| default=aboutcode.hashid.build_vcid, | ||
| help_text="Unique identifier for a vulnerability in the external representation. It is prefixed with VCID-", | ||
| max_length=20, | ||
| unique=True, | ||
| ), | ||
| ), | ||
| migrations.AlterField( | ||
| model_name="vulnerabilityreference", | ||
| name="reference_id", | ||
| field=models.CharField( | ||
| blank=True, | ||
| db_index=True, | ||
| help_text="An optional reference ID, such as DSA-4465-1 when available", | ||
| max_length=200, | ||
| ), | ||
| ), | ||
| migrations.AlterField( | ||
| model_name="vulnerabilityseverity", | ||
| name="url", | ||
| field=models.URLField( | ||
| db_index=True, | ||
| help_text="URL to the vulnerability severity", | ||
| max_length=1024, | ||
| null=True, | ||
| ), | ||
| ), | ||
| migrations.AddIndex( | ||
| model_name="package", | ||
| index=models.Index( | ||
| fields=["type", "namespace", "name"], name="vulnerabili_type_825918_idx" | ||
| ), | ||
| ), | ||
| migrations.AddIndex( | ||
| model_name="package", | ||
| index=models.Index( | ||
| fields=["type", "namespace", "name", "qualifiers", "subpath"], | ||
| name="vulnerabili_type_8e6aff_idx", | ||
| ), | ||
| ), | ||
| migrations.AddIndex( | ||
| model_name="package", | ||
| index=models.Index( | ||
| fields=["type", "namespace", "name", "version"], name="vulnerabili_type_f6687a_idx" | ||
| ), | ||
| ), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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