-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consolidate migrations files into one single file #138
Signed-off-by: tdruez <tdruez@nexb.com>
- Loading branch information
Showing
4 changed files
with
19 additions
and
167 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,142 +1,38 @@ | ||
# Generated by Django 5.0.6 on 2024-07-15 10:33 | ||
# Generated by Django 5.0.6 on 2024-08-06 12:14 | ||
|
||
import django.db.models.deletion | ||
import dje.fields | ||
import uuid | ||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("component_catalog", "0005_remove_component_concluded_license_and_more"), | ||
("dje", "0003_alter_dejacodeuser_homepage_layout"), | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('component_catalog', '0005_remove_component_concluded_license_and_more'), | ||
('dje', '0003_alter_dejacodeuser_homepage_layout'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Vulnerability", | ||
name='Vulnerability', | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
( | ||
"uuid", | ||
models.UUIDField( | ||
default=uuid.uuid4, editable=False, verbose_name="UUID" | ||
), | ||
), | ||
( | ||
"created_date", | ||
models.DateTimeField( | ||
auto_now_add=True, | ||
db_index=True, | ||
help_text="The date and time the object was created.", | ||
), | ||
), | ||
( | ||
"last_modified_date", | ||
models.DateTimeField( | ||
auto_now=True, | ||
db_index=True, | ||
help_text="The date and time the object was last modified.", | ||
), | ||
), | ||
( | ||
"vulnerability_id", | ||
models.CharField( | ||
help_text="A unique identifier for the vulnerability, prefixed with 'VCID-'. For example, 'VCID-2024-0001'.", | ||
max_length=20, | ||
unique=True, | ||
), | ||
), | ||
( | ||
"summary", | ||
models.TextField( | ||
blank=True, | ||
help_text="A brief summary of the vulnerability, outlining its nature and impact.", | ||
), | ||
), | ||
( | ||
"aliases", | ||
dje.fields.JSONListField( | ||
blank=True, | ||
default=list, | ||
help_text="A list of aliases for this vulnerability, such as CVE identifiers (e.g., 'CVE-2017-1000136').", | ||
), | ||
), | ||
( | ||
"references", | ||
dje.fields.JSONListField( | ||
blank=True, | ||
default=list, | ||
help_text="A list of references for this vulnerability. Each reference includes a URL, an optional reference ID, scores, and the URL for further details. ", | ||
), | ||
), | ||
( | ||
"fixed_packages", | ||
dje.fields.JSONListField( | ||
blank=True, | ||
default=list, | ||
help_text="A list of packages that are not affected by this vulnerability.", | ||
), | ||
), | ||
( | ||
"affected_packages", | ||
models.ManyToManyField( | ||
help_text="Packages that are affected by this vulnerability.", | ||
related_name="affected_by_vulnerabilities", | ||
to="component_catalog.package", | ||
), | ||
), | ||
( | ||
"created_by", | ||
models.ForeignKey( | ||
editable=False, | ||
help_text="The application user who created the object.", | ||
null=True, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
related_name="created_%(class)ss", | ||
serialize=False, | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
( | ||
"dataspace", | ||
models.ForeignKey( | ||
editable=False, | ||
help_text="A Dataspace is an independent, exclusive set of DejaCode data, which can be either nexB master reference data or installation-specific data.", | ||
on_delete=django.db.models.deletion.PROTECT, | ||
to="dje.dataspace", | ||
), | ||
), | ||
( | ||
"last_modified_by", | ||
dje.fields.LastModifiedByField( | ||
editable=False, | ||
help_text="The application user who last modified the object.", | ||
null=True, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
related_name="modified_%(class)ss", | ||
serialize=False, | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, verbose_name='UUID')), | ||
('created_date', models.DateTimeField(auto_now_add=True, db_index=True, help_text='The date and time the object was created.')), | ||
('last_modified_date', models.DateTimeField(auto_now=True, db_index=True, help_text='The date and time the object was last modified.')), | ||
('vulnerability_id', models.CharField(help_text="A unique identifier for the vulnerability, prefixed with 'VCID-'. For example, 'VCID-2024-0001'.", max_length=20, unique=True)), | ||
('summary', models.TextField(blank=True, help_text='A brief summary of the vulnerability, outlining its nature and impact.')), | ||
('aliases', dje.fields.JSONListField(blank=True, default=list, help_text="A list of aliases for this vulnerability, such as CVE identifiers (e.g., 'CVE-2017-1000136').")), | ||
('references', dje.fields.JSONListField(blank=True, default=list, help_text='A list of references for this vulnerability. Each reference includes a URL, an optional reference ID, scores, and the URL for further details. ')), | ||
('fixed_packages', dje.fields.JSONListField(blank=True, default=list, help_text='A list of packages that are not affected by this vulnerability.')), | ||
('affected_components', models.ManyToManyField(help_text='Components affected by this vulnerability.', related_name='affected_by_vulnerabilities', to='component_catalog.component')), | ||
('affected_packages', models.ManyToManyField(help_text='Packages affected by this vulnerability.', related_name='affected_by_vulnerabilities', to='component_catalog.package')), | ||
('dataspace', models.ForeignKey(editable=False, help_text='A Dataspace is an independent, exclusive set of DejaCode data, which can be either nexB master reference data or installation-specific data.', on_delete=django.db.models.deletion.PROTECT, to='dje.dataspace')), | ||
], | ||
options={ | ||
"verbose_name_plural": "Vulnerabilities", | ||
"unique_together": { | ||
("dataspace", "uuid"), | ||
("dataspace", "vulnerability_id"), | ||
}, | ||
'verbose_name_plural': 'Vulnerabilities', | ||
'unique_together': {('dataspace', 'uuid'), ('dataspace', 'vulnerability_id')}, | ||
}, | ||
), | ||
] |
23 changes: 0 additions & 23 deletions
23
component_catalog/migrations/0007_vulnerability_affected_components_and_more.py
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
component_catalog/migrations/0008_remove_vulnerability_created_by_and_more.py
This file was deleted.
Oops, something went wrong.