Skip to content

Commit

Permalink
Update ScannableURI migrations #49 #285
Browse files Browse the repository at this point in the history
Signed-off-by: Jono Yang <[email protected]>
  • Loading branch information
JonoYang committed Mar 7, 2024
1 parent 5856cde commit 86b0885
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 72 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated by Django 5.0.1 on 2024-02-15 23:16
# Generated by Django 5.0.1 on 2024-03-07 00:59

from django.db import migrations, models
import uuid
from django.db import migrations, models


class Migration(migrations.Migration):
Expand All @@ -16,28 +16,32 @@ class Migration(migrations.Migration):
model_name="scannableuri",
name="minecode_sc_scan_st_d6a459_idx",
),
migrations.RenameField(
model_name="scannableuri",
old_name="rescan_uri",
new_name="reindex_uri",
),
migrations.AlterUniqueTogether(
name="scannableuri",
unique_together=set(),
),
migrations.AddField(
model_name="scannableuri",
name="scan_date",
field=models.DateTimeField(
name="pipelines",
field=models.JSONField(
blank=True,
db_index=True,
help_text="Timestamp set to the date when a scan was taken by a worker",
null=True,
default=list,
editable=False,
help_text="A list of ScanCode.io pipeline names to be run for this scan",
),
),
migrations.AddField(
model_name="scannableuri",
name="scan_project_url",
field=models.CharField(
name="scan_date",
field=models.DateTimeField(
blank=True,
db_index=True,
help_text="URL to scan project for this Package",
max_length=2048,
help_text="Timestamp set to the date when a scan was taken by a worker",
null=True,
),
),
Expand All @@ -49,10 +53,14 @@ class Migration(migrations.Migration):
migrations.AddIndex(
model_name="scannableuri",
index=models.Index(
fields=["scan_status", "scan_date", "last_status_poll_date"],
name="minecode_sc_scan_st_5e04d7_idx",
fields=["scan_status", "scan_date"],
name="minecode_sc_scan_st_baab37_idx",
),
),
migrations.RemoveField(
model_name="scannableuri",
name="last_status_poll_date",
),
migrations.RemoveField(
model_name="scannableuri",
name="scan_request_date",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def create_scan_queue_workers_group_and_permissions(apps, schema_editor):
class Migration(migrations.Migration):

dependencies = [
("minecode", "0036_scannableuri_pipelines"),
("minecode", "0034_scannableuri_alter_uuid_field"),
]

operations = [
Expand Down

This file was deleted.

23 changes: 0 additions & 23 deletions minecode/migrations/0036_scannableuri_pipelines.py

This file was deleted.

17 changes: 0 additions & 17 deletions minecode/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,22 +662,6 @@ class ScannableURI(BaseURI):
help_text='Timestamp set to the date when a scan was taken by a worker',
)

last_status_poll_date = models.DateTimeField(
null=True,
blank=True,
db_index=True,
help_text='Timestamp set to the date of the last status poll. '
'Used to track the scan polling.',
)

scan_project_url = models.CharField(
max_length=2048,
db_index=True,
null=True,
blank=True,
help_text='URL to scan project for this Package',
)

pipelines = models.JSONField(
default=list,
blank=True,
Expand Down Expand Up @@ -751,7 +735,6 @@ class Meta:
fields=[
'scan_status',
'scan_date',
'last_status_poll_date',
]
),
# ordered by for the main queue query e.g. '-priority'
Expand Down

0 comments on commit 86b0885

Please sign in to comment.