Skip to content

Commit

Permalink
Migrations for running testruns (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashesh3 authored Jul 31, 2023
1 parent b38d986 commit bd78be7
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions ayushma/migrations/0035_auto_20230731_1407.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.2.1 on 2023-07-31 14:07

from django.db import migrations

from ayushma.models.enums import StatusChoices


def migrate_testrun_status(apps, schema_editor):
TestRun = apps.get_model("ayushma", "TestRun")
for testrun in TestRun.objects.all():
if testrun.status == StatusChoices.RUNNING:
testrun.status = StatusChoices.COMPLETED
testrun.save()


class Migration(migrations.Migration):
dependencies = [
("ayushma", "0034_remove_testrun_complete_testrun_status"),
]

operations = [
migrations.RunPython(migrate_testrun_status),
]

0 comments on commit bd78be7

Please sign in to comment.