Skip to content

Commit 68bb105

Browse files
committed
squash the migration files
Signed-off-by: Varsha U N <varshaun58@gmail.com>
1 parent 435b2d9 commit 68bb105

4 files changed

Lines changed: 93 additions & 95 deletions

scanpipe/migrations/0068_packagearchive_downloadedpackage.py

Lines changed: 0 additions & 44 deletions
This file was deleted.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Generated by Django 5.1.1 on 2025-07-09
2+
3+
import django.db.models.deletion
4+
import uuid
5+
from django.db import migrations, models
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
('scanpipe', '0067_discoveredpackage_notes'),
12+
]
13+
14+
operations = [
15+
migrations.CreateModel(
16+
name='PackageArchive',
17+
fields=[
18+
('uuid', models.UUIDField(
19+
db_index=True, default=uuid.uuid4, editable=False, primary_key=True,
20+
serialize=False, verbose_name='UUID'
21+
)),
22+
('checksum_sha256', models.CharField(
23+
db_index=True, help_text='SHA256 checksum of the package archive file.',
24+
max_length=64, unique=True
25+
)),
26+
('storage_path', models.CharField(
27+
blank=True, help_text='Path to the stored archive file', max_length=1024
28+
)),
29+
('created_date', models.DateTimeField(
30+
auto_now_add=True, help_text='Date when the archive was added to storage.'
31+
)),
32+
('package_file', models.FileField(
33+
blank=True, help_text='The actual package archive file ( ZIP or TAR).',
34+
null=True, upload_to='packages/'
35+
)),
36+
],
37+
options={
38+
'indexes': [models.Index(fields=['checksum_sha256'], name='checksum_idx')],
39+
},
40+
),
41+
42+
migrations.CreateModel(
43+
name='DownloadedPackage',
44+
fields=[
45+
('uuid', models.UUIDField(
46+
db_index=True, default=uuid.uuid4, editable=False, primary_key=True,
47+
serialize=False, verbose_name='UUID'
48+
)),
49+
('url', models.URLField(
50+
blank=True, db_index=True, help_text='URL from which the package was downloaded, if applicable.',
51+
max_length=1024
52+
)),
53+
('filename', models.CharField(
54+
help_text='Name of the package file.', max_length=255
55+
)),
56+
('download_date', models.DateTimeField(
57+
auto_now_add=True, help_text='Date when the package was downloaded or added.'
58+
)),
59+
('scan_log', models.TextField(
60+
blank=True, help_text='Log output from scanning the package.'
61+
)),
62+
('scan_date', models.DateTimeField(
63+
blank=True, help_text='Date when the package was scanned.', null=True
64+
)),
65+
('project', models.ForeignKey(
66+
editable=False, on_delete=django.db.models.deletion.CASCADE,
67+
related_name='downloadedpackages', to='scanpipe.project'
68+
)),
69+
('package_archive', models.ForeignKey(
70+
help_text='The stored archive file associated with this package.',
71+
on_delete=django.db.models.deletion.CASCADE, to='scanpipe.packagearchive'
72+
)),
73+
],
74+
options={
75+
'indexes': [models.Index(fields=['url'], name='url_idx')],
76+
'constraints': [
77+
models.UniqueConstraint(
78+
condition=models.Q(('url__gt', '')),
79+
fields=('url', 'project'),
80+
name='scanpipe_downloadedpackage_unique_url_project'
81+
),
82+
],
83+
},
84+
),
85+
86+
migrations.AddField(
87+
model_name='project',
88+
name='use_local_storage',
89+
field=models.BooleanField(
90+
default=False, help_text='Store packages locally if enabled.'
91+
),
92+
),
93+
]

scanpipe/migrations/0069_packagearchive_package_file_and_more.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

scanpipe/migrations/0070_project_use_local_storage_and_more.py

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)