Skip to content

Commit

Permalink
Implement DB migrations for allowing changing of the culprit feature
Browse files Browse the repository at this point in the history
  • Loading branch information
florinbilt committed Nov 7, 2024
1 parent 6cc3b7e commit a3ca9bb
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,16 @@
from django.db import migrations, models


def copy_push_to_original_push(apps, schema_editor):
alerts = apps.get_model('perf', 'PerformanceAlertSummary')
for alert in alerts.objects.all():
def update_summary_original_push(apps, schema_editor):
PerformanceAlertSummary = apps.get_model('perf', 'PerformanceAlertSummary')
for alert in PerformanceAlertSummary.objects.all():
alert.original_push = alert.push
alert.save()


class Migration(migrations.Migration):

dependencies = [
(
"model",
"0032_rename_failureline_job_guid_repository_failure_lin_job_gui_b67c6d_idx_and_more",
),
(
"perf",
"0052_rename_performancedatum_repository_signature_push_timestamp_performance_reposit_c9d328_idx_and_more",
Expand All @@ -36,5 +32,5 @@ class Migration(migrations.Migration):
to="model.push",
),
),
migrations.RunPython(copy_push_to_original_push, reverse_code=migrations.RunPython.noop),
migrations.RunPython(update_summary_original_push, reverse_code=migrations.RunPython.noop),
]

0 comments on commit a3ca9bb

Please sign in to comment.