Skip to content

Commit

Permalink
improved migration
Browse files Browse the repository at this point in the history
  • Loading branch information
drosetti committed Nov 22, 2024
1 parent e98f48b commit 5b09461
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions api_app/migrations/0064_vt_sample_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,10 @@ def migrate(apps, schema_editor):


def reverse_migrate(apps, schema_editor):
PythonModule = apps.get_model("api_app", "PythonModule")

vt_sample_analyzer_python_module = PythonModule.objects.get(
module="vt.vt3_sample_download.VirusTotalv3SampleDownload"
)
print(f"{vt_sample_analyzer_python_module.connectorconfigs.all()=}")
vt_sample_analyzer_python_module.delete()
vt_sample_visualizer_python_module = PythonModule.objects.get(
module="sample_download.SampleDownload"
)
vt_sample_visualizer_python_module.delete()
# cannot undo:
# depending on migration order, some field could miss and the reverse fail
# for this reason the reversion didn't delete nothing
pass


class Migration(migrations.Migration):
Expand Down

0 comments on commit 5b09461

Please sign in to comment.