Skip to content

Commit

Permalink
add rollback method in migration
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienReuiller committed Nov 21, 2024
1 parent e5daefd commit caf89b4
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ def create_template(apps, schema_editor):
)


def delete_template(apps, schema_editor):
TemplateTransactional = apps.get_model("conversations", "TemplateTransactional")
TemplateTransactional.objects.get(code="TENDERS_AUTHOR_CONFIRMATION_VALIDATED_COMMERCIAL_PARTNERS").delete()


class Migration(migrations.Migration):
dependencies = [
("tenders", "0093_alter_tender_send_to_commercial_partners_only"),
]

operations = [
migrations.RunPython(create_template),
migrations.RunPython(create_template, reverse_code=delete_template),
]

0 comments on commit caf89b4

Please sign in to comment.