From ea0a41b5fcdfc0eb944399ae242883fdd872a1ec Mon Sep 17 00:00:00 2001 From: Michael Harrison Date: Tue, 30 Jan 2024 14:22:12 -0600 Subject: [PATCH] create less problems on migration --- .../migrations/0034_delete_assignableavailable.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/snippets/migrations/0034_delete_assignableavailable.py b/snippets/migrations/0034_delete_assignableavailable.py index 4dbba1e7b..8831e5d47 100644 --- a/snippets/migrations/0034_delete_assignableavailable.py +++ b/snippets/migrations/0034_delete_assignableavailable.py @@ -2,25 +2,12 @@ from django.db import migrations - -def migrate_old_data(apps, schema_editor): - PromoteSnippet = apps.get_model("snippets", "PromoteSnippet") - AssignableAvailable = apps.get_model("snippets", "AssignableAvailable") - for assignable_snippet in AssignableAvailable.objects.all(): - snippet = PromoteSnippet.objects.create( - name=assignable_snippet.name, - description=assignable_snippet.assignable_description, - image=assignable_snippet.image - ) - snippet.save() - class Migration(migrations.Migration): dependencies = [ ("snippets", "0033_promotesnippet"), ] operations = [ - migrations.RunPython(migrate_old_data), migrations.DeleteModel( name="AssignableAvailable", ),