-
-
Notifications
You must be signed in to change notification settings - Fork 98
address mysql utf8mb4 composite index sizes #774
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Generated by Django 4.2.28 on 2026-03-03 01:02 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('modules', '0005_alter_module_unique_together'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AlterField( | ||
| model_name='module', | ||
| name='context', | ||
| field=models.CharField(max_length=128), | ||
| ), | ||
| migrations.AlterField( | ||
| model_name='module', | ||
| name='name', | ||
| field=models.CharField(max_length=128), | ||
| ), | ||
| migrations.AlterField( | ||
| model_name='module', | ||
| name='stream', | ||
| field=models.CharField(max_length=128), | ||
| ), | ||
| migrations.AlterField( | ||
| model_name='module', | ||
| name='version', | ||
| field=models.CharField(max_length=128), | ||
| ), | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Generated by Django 4.2.28 on 2026-03-03 01:02 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('operatingsystems', '0010_backfill_osvariant_counts'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AlterField( | ||
| model_name='osrelease', | ||
| name='codename', | ||
| field=models.CharField(blank=True, max_length=128), | ||
| ), | ||
| migrations.AlterField( | ||
| model_name='osrelease', | ||
| name='cpe_name', | ||
| field=models.CharField(blank=True, max_length=128, null=True, unique=True), | ||
| ), | ||
| migrations.AlterField( | ||
| model_name='osrelease', | ||
| name='name', | ||
| field=models.CharField(max_length=128, unique=True), | ||
| ), | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,10 +24,10 @@ | |
|
|
||
| class OSRelease(models.Model): | ||
|
|
||
| name = models.CharField(max_length=255, unique=True, blank=False, null=False) | ||
| name = models.CharField(max_length=128, unique=True, blank=False, null=False) | ||
| repos = models.ManyToManyField(Repository, blank=True) | ||
| codename = models.CharField(max_length=255, blank=True) | ||
| cpe_name = models.CharField(max_length=255, null=True, blank=True, unique=True) | ||
| codename = models.CharField(max_length=128, blank=True) | ||
| cpe_name = models.CharField(max_length=128, null=True, blank=True, unique=True) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| from operatingsystems.managers import OSReleaseManager | ||
| objects = OSReleaseManager() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Generated by Django 4.2.28 on 2026-03-03 01:02 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('packages', '0006_alter_packageupdate_options'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AlterField( | ||
| model_name='package', | ||
| name='epoch', | ||
| field=models.CharField(blank=True, max_length=128, null=True), | ||
| ), | ||
| migrations.AlterField( | ||
| model_name='package', | ||
| name='release', | ||
| field=models.CharField(blank=True, max_length=128, null=True), | ||
| ), | ||
| migrations.AlterField( | ||
| model_name='package', | ||
| name='version', | ||
| field=models.CharField(max_length=128), | ||
| ), | ||
| ] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -74,9 +74,9 @@ class Package(models.Model): | |||||
| ) | ||||||
|
|
||||||
| name = models.ForeignKey(PackageName, on_delete=models.CASCADE) | ||||||
| epoch = models.CharField(max_length=255, blank=True, null=True) | ||||||
| version = models.CharField(max_length=255) | ||||||
| release = models.CharField(max_length=255, blank=True, null=True) | ||||||
| epoch = models.CharField(max_length=128, blank=True, null=True) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| version = models.CharField(max_length=128) | ||||||
| release = models.CharField(max_length=128, blank=True, null=True) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
As above, consider replacing |
||||||
| arch = models.ForeignKey(PackageArchitecture, on_delete=models.CASCADE) | ||||||
| packagetype = models.CharField(max_length=1, choices=PACKAGE_TYPES, blank=True, null=True) | ||||||
| category = models.ForeignKey(PackageCategory, blank=True, null=True, on_delete=models.SET_NULL) | ||||||
|
|
@@ -173,13 +173,13 @@ def repo_count(self): | |||||
|
|
||||||
| class PackageString(models.Model): | ||||||
|
|
||||||
| name = models.CharField(max_length=255) | ||||||
| version = models.CharField(max_length=255) | ||||||
| epoch = models.CharField(max_length=255, blank=True, null=True) | ||||||
| release = models.CharField(max_length=255, blank=True, null=True) | ||||||
| arch = models.CharField(max_length=255) | ||||||
| name = models.CharField(max_length=128) | ||||||
| version = models.CharField(max_length=128) | ||||||
| epoch = models.CharField(max_length=128, blank=True, null=True) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
As above, consider replacing |
||||||
| release = models.CharField(max_length=128, blank=True, null=True) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Again, consider replacing |
||||||
| arch = models.CharField(max_length=128) | ||||||
| packagetype = models.CharField(max_length=1, blank=True, null=True) | ||||||
| category = models.CharField(max_length=255, blank=True, null=True) | ||||||
| category = models.CharField(max_length=128, blank=True, null=True) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Again, consider replacing |
||||||
| description = models.TextField(blank=True, null=True) | ||||||
| url = models.URLField(max_length=255, blank=True, null=True) | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Generated by Django 4.2.28 on 2026-03-03 01:02 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('security', '0008_alter_cwe_options_alter_reference_options'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AlterField( | ||
| model_name='cvss', | ||
| name='severity', | ||
| field=models.CharField(blank=True, max_length=128, null=True), | ||
| ), | ||
| migrations.AlterField( | ||
| model_name='cvss', | ||
| name='vector_string', | ||
| field=models.CharField(blank=True, max_length=128, null=True), | ||
| ), | ||
| migrations.AlterField( | ||
| model_name='reference', | ||
| name='ref_type', | ||
| field=models.CharField(max_length=128), | ||
| ), | ||
| migrations.AlterField( | ||
| model_name='reference', | ||
| name='url', | ||
| field=models.URLField(max_length=512), | ||
| ), | ||
| ] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -28,8 +28,8 @@ | |||||
|
|
||||||
| class Reference(models.Model): | ||||||
|
|
||||||
| ref_type = models.CharField(max_length=255) | ||||||
| url = models.URLField(max_length=765) | ||||||
| ref_type = models.CharField(max_length=128) | ||||||
| url = models.URLField(max_length=512) | ||||||
|
|
||||||
| class Meta: | ||||||
| unique_together = ['ref_type', 'url'] | ||||||
|
|
@@ -82,9 +82,9 @@ def fetch_cwe_data(self): | |||||
| class CVSS(models.Model): | ||||||
|
|
||||||
| score = models.DecimalField(max_digits=3, decimal_places=1, null=True) | ||||||
| severity = models.CharField(max_length=255, blank=True, null=True) | ||||||
| severity = models.CharField(max_length=128, blank=True, null=True) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| version = models.DecimalField(max_digits=2, decimal_places=1) | ||||||
| vector_string = models.CharField(max_length=255, blank=True, null=True) | ||||||
| vector_string = models.CharField(max_length=128, blank=True, null=True) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Same as above: consider replacing |
||||||
|
|
||||||
| class Meta: | ||||||
| unique_together = ['score', 'severity', 'version', 'vector_string'] | ||||||
|
|
||||||
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.
Falseis the default value Django uses forblank, soblank=Falsecan be removed. Explained here.Again, redundant default arguments can be removed.