-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement DB migrations for allowing changing of the culprit feature (#…
- Loading branch information
1 parent
146ec53
commit b2231d1
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
treeherder/perf/migrations/0056_performancealertsummary_original_push.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Generated by Django 5.1.3 on 2024-11-14 13:30 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
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 = [ | ||
("perf", "0055_remove_performancealerttesting_related_summary_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="performancealertsummary", | ||
name="original_push", | ||
field=models.ForeignKey( | ||
default=None, | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="+", | ||
to="model.push", | ||
), | ||
), | ||
migrations.RunPython(update_summary_original_push, reverse_code=migrations.RunPython.noop), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters