1- # Generated by Django 3.0.7 on 2021-01-21 16:32
1+ # Generated by Django 3.0.7 on 2021-02-03 07:30
22
33import django .contrib .postgres .fields .jsonb
44from django .db import migrations , models
@@ -49,12 +49,24 @@ class Migration(migrations.Migration):
4949 ('id' , models .AutoField (auto_created = True , primary_key = True , serialize = False , verbose_name = 'ID' )),
5050 ('cve_id' , models .CharField (help_text = 'CVE ID' , max_length = 50 , null = True , unique = True )),
5151 ('summary' , models .TextField (blank = True , help_text = 'Summary of the vulnerability' )),
52- ('cvss' , models .FloatField (help_text = 'CVSS Score' , max_length = 100 , null = True )),
5352 ],
5453 options = {
5554 'verbose_name_plural' : 'Vulnerabilities' ,
5655 },
5756 ),
57+ migrations .CreateModel (
58+ name = 'VulnerabilityReference' ,
59+ fields = [
60+ ('id' , models .AutoField (auto_created = True , primary_key = True , serialize = False , verbose_name = 'ID' )),
61+ ('source' , models .CharField (blank = True , help_text = 'Source(s) name eg:NVD' , max_length = 50 )),
62+ ('reference_id' , models .CharField (blank = True , help_text = 'Reference ID, eg:DSA-4465-1' , max_length = 50 )),
63+ ('url' , models .URLField (blank = True , help_text = 'URL of Vulnerability data' , max_length = 1024 )),
64+ ('vulnerability' , models .ForeignKey (on_delete = django .db .models .deletion .CASCADE , to = 'vulnerabilities.Vulnerability' )),
65+ ],
66+ options = {
67+ 'unique_together' : {('vulnerability' , 'source' , 'reference_id' , 'url' )},
68+ },
69+ ),
5870 migrations .CreateModel (
5971 name = 'PackageRelatedVulnerability' ,
6072 fields = [
@@ -74,16 +86,16 @@ class Migration(migrations.Migration):
7486 field = models .ManyToManyField (through = 'vulnerabilities.PackageRelatedVulnerability' , to = 'vulnerabilities.Vulnerability' ),
7587 ),
7688 migrations .CreateModel (
77- name = 'VulnerabilityReference ' ,
89+ name = 'VulnerabilitySeverity ' ,
7890 fields = [
7991 ('id' , models .AutoField (auto_created = True , primary_key = True , serialize = False , verbose_name = 'ID' )),
80- ('source ' , models .CharField (blank = True , help_text = 'Source(s) name eg:NVD ' , max_length = 50 )),
81- ('reference_id ' , models .CharField (blank = True , help_text = 'Reference ID, eg:DSA-4465-1 ' , max_length = 50 )),
82- ('url ' , models .URLField ( blank = True , help_text = 'URL of Vulnerability data' , max_length = 1024 )),
92+ ('value ' , models .CharField (help_text = 'Example: 9.0, Important, High ' , max_length = 50 )),
93+ ('scoring_system ' , models .CharField (choices = [( 'cvssv2' , 'CVSSv2' ), ( 'cvssv3' , 'CVSSv3' ), ( 'rhbs' , 'RedHat Bugzilla severity' ), ( 'rhas' , 'RedHat Aggregate severity' )], help_text = 'Identifier for the scoring system used. Avaiable choices are: cvssv2 is identifier for CVSSv2 system, cvssv3 is identifier for CVSSv3 system, rhbs is identifier for RedHat Bugzilla severity system, rhas is identifier for RedHat Aggregate severity system ' , max_length = 50 )),
94+ ('reference ' , models .ForeignKey ( on_delete = django . db . models . deletion . CASCADE , to = 'vulnerabilities.VulnerabilityReference' )),
8395 ('vulnerability' , models .ForeignKey (on_delete = django .db .models .deletion .CASCADE , to = 'vulnerabilities.Vulnerability' )),
8496 ],
8597 options = {
86- 'unique_together' : {('vulnerability' , 'source ' , 'reference_id' , 'url ' )},
98+ 'unique_together' : {('vulnerability' , 'reference ' , 'scoring_system ' )},
8799 },
88100 ),
89101 migrations .AlterUniqueTogether (
0 commit comments