|
| 1 | +# Generated by Django 5.2.11 on 2026-07-22 18:14 |
| 2 | + |
| 3 | +import django.db.models.deletion |
| 4 | +from django.db import migrations, models |
| 5 | + |
| 6 | + |
| 7 | +class Migration(migrations.Migration): |
| 8 | + |
| 9 | + dependencies = [ |
| 10 | + ("vulnerabilities", "0140_alter_advisorytodo_issue_type_and_more"), |
| 11 | + ] |
| 12 | + |
| 13 | + operations = [ |
| 14 | + migrations.CreateModel( |
| 15 | + name="AdvisoryMitigations", |
| 16 | + fields=[ |
| 17 | + ( |
| 18 | + "id", |
| 19 | + models.AutoField( |
| 20 | + auto_created=True, primary_key=True, serialize=False, verbose_name="ID" |
| 21 | + ), |
| 22 | + ), |
| 23 | + ( |
| 24 | + "base_purl", |
| 25 | + models.CharField( |
| 26 | + help_text="Version less PURL related to mitigation.", max_length=500 |
| 27 | + ), |
| 28 | + ), |
| 29 | + ("upgrade_to_versions_note", models.TextField(blank=True)), |
| 30 | + ("downgrade_to_versions_note", models.TextField(blank=True)), |
| 31 | + ("patches_note", models.TextField(blank=True)), |
| 32 | + ( |
| 33 | + "config_change", |
| 34 | + models.TextField( |
| 35 | + blank=True, help_text="Configuration change to mitigate the advisory." |
| 36 | + ), |
| 37 | + ), |
| 38 | + ("config_change_note", models.TextField(blank=True)), |
| 39 | + ( |
| 40 | + "filter_ports_ips", |
| 41 | + models.TextField( |
| 42 | + blank=True, help_text="Filter Ports and IPs to mitigate the advisory." |
| 43 | + ), |
| 44 | + ), |
| 45 | + ("filter_ports_ips_note", models.TextField(blank=True)), |
| 46 | + ("replace_package_note", models.TextField(blank=True)), |
| 47 | + ("created_at", models.DateTimeField(auto_now_add=True)), |
| 48 | + ("updated_at", models.DateTimeField(auto_now=True)), |
| 49 | + ( |
| 50 | + "advisory", |
| 51 | + models.ForeignKey( |
| 52 | + on_delete=django.db.models.deletion.CASCADE, |
| 53 | + related_name="mitigations", |
| 54 | + to="vulnerabilities.advisoryv2", |
| 55 | + ), |
| 56 | + ), |
| 57 | + ( |
| 58 | + "downgrade_to_versions", |
| 59 | + models.ManyToManyField( |
| 60 | + blank=True, |
| 61 | + help_text="Packages that mitigates the advisory by downgrading.", |
| 62 | + related_name="downgrade_mitigations", |
| 63 | + to="vulnerabilities.packagev2", |
| 64 | + ), |
| 65 | + ), |
| 66 | + ( |
| 67 | + "patches", |
| 68 | + models.ManyToManyField( |
| 69 | + help_text="Patches to mitigate the advisory.", |
| 70 | + related_name="patch_mitigations", |
| 71 | + to="vulnerabilities.packagecommitpatch", |
| 72 | + ), |
| 73 | + ), |
| 74 | + ( |
| 75 | + "replace_with_packages", |
| 76 | + models.ManyToManyField( |
| 77 | + blank=True, |
| 78 | + help_text="Packages that can replace the vulnerable package.", |
| 79 | + related_name="replacement_mitigations", |
| 80 | + to="vulnerabilities.packagev2", |
| 81 | + ), |
| 82 | + ), |
| 83 | + ( |
| 84 | + "upgrade_to_versions", |
| 85 | + models.ManyToManyField( |
| 86 | + blank=True, |
| 87 | + help_text="Packages that mitigates the advisory by upgrading.", |
| 88 | + related_name="upgrade_mitigations", |
| 89 | + to="vulnerabilities.packagev2", |
| 90 | + ), |
| 91 | + ), |
| 92 | + ], |
| 93 | + ), |
| 94 | + ] |
0 commit comments