From abf2d474982544482a6a2a4afb1c560d773b5565 Mon Sep 17 00:00:00 2001 From: Donny Peeters Date: Wed, 17 May 2023 15:31:06 +0200 Subject: [PATCH 1/2] Remove job model and generate migrations --- .gitignore | 3 +++ .../0070.tools.0029_delete_job.sql | 4 ++++ rocky/tools/migrations/0038_delete_job.py | 16 ++++++++++++++++ rocky/tools/models.py | 10 ---------- 4 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 rocky/export_migrations/0070.tools.0029_delete_job.sql create mode 100644 rocky/tools/migrations/0038_delete_job.py diff --git a/.gitignore b/.gitignore index 4f88a8a60da..ecd82e4703e 100644 --- a/.gitignore +++ b/.gitignore @@ -421,6 +421,9 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk +# Swap files +*.swp + # End of https://www.toptal.com/developers/gitignore/api/windows,linux,macos,python,node,react,intellij,vscode /bytes/bytes-data diff --git a/rocky/export_migrations/0070.tools.0029_delete_job.sql b/rocky/export_migrations/0070.tools.0029_delete_job.sql new file mode 100644 index 00000000000..e82247b3a5c --- /dev/null +++ b/rocky/export_migrations/0070.tools.0029_delete_job.sql @@ -0,0 +1,4 @@ +-- +-- Drop the job table +-- +DROP TABLE "tools_job"; diff --git a/rocky/tools/migrations/0038_delete_job.py b/rocky/tools/migrations/0038_delete_job.py new file mode 100644 index 00000000000..c3f78006f13 --- /dev/null +++ b/rocky/tools/migrations/0038_delete_job.py @@ -0,0 +1,16 @@ +# Generated by Django 3.2.19 on 2023-05-17 13:19 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('tools', '0037_alter_organization_options'), + ] + + operations = [ + migrations.DeleteModel( + name='Job', + ), + ] diff --git a/rocky/tools/models.py b/rocky/tools/models.py index 5cb6b450bd7..07a5650c054 100644 --- a/rocky/tools/models.py +++ b/rocky/tools/models.py @@ -1,5 +1,4 @@ import logging -import uuid from functools import cached_property from typing import Iterable, Set @@ -309,12 +308,3 @@ def get_internet_description(self): def __str__(self): return self.id - - -class Job(models.Model): - id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) - organization = models.ForeignKey(Organization, on_delete=models.SET_NULL, null=True) - boefje_id = models.CharField(max_length=128) - input_ooi = models.TextField(null=True) - arguments = models.JSONField() - created = models.DateTimeField(auto_now_add=True) From bbaafba01a3abbc176129bc02125c3ceec60bf7d Mon Sep 17 00:00:00 2001 From: Donny Peeters Date: Wed, 17 May 2023 15:33:45 +0200 Subject: [PATCH 2/2] Style fix --- rocky/tools/migrations/0038_delete_job.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rocky/tools/migrations/0038_delete_job.py b/rocky/tools/migrations/0038_delete_job.py index c3f78006f13..e18e8856116 100644 --- a/rocky/tools/migrations/0038_delete_job.py +++ b/rocky/tools/migrations/0038_delete_job.py @@ -4,13 +4,12 @@ class Migration(migrations.Migration): - dependencies = [ - ('tools', '0037_alter_organization_options'), + ("tools", "0037_alter_organization_options"), ] operations = [ migrations.DeleteModel( - name='Job', + name="Job", ), ]