Skip to content

Commit af1c7e2

Browse files
committed
Add data migration
1 parent 9a4fa93 commit af1c7e2

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Generated by Django 4.2.25 on 2025-10-21 10:14
2+
3+
from django.db import migrations
4+
5+
6+
def replace_error_message_none_values(apps, _schema_editor):
7+
RawImageUploadSession = apps.get_model( # noqa: N806
8+
"cases", "RawImageUploadSession"
9+
)
10+
11+
RawImageUploadSession.objects.filter(error_message__isnull=True).update(
12+
error_message=""
13+
)
14+
15+
16+
class Migration(migrations.Migration):
17+
18+
dependencies = [
19+
("cases", "0021_dicomimagesetupload_task_on_success"),
20+
]
21+
22+
operations = [
23+
migrations.RunPython(replace_error_message_none_values, elidable=True),
24+
]

app/grandchallenge/cases/migrations/0022_alter_rawimageuploadsession_error_message.py renamed to app/grandchallenge/cases/migrations/0023_alter_rawimageuploadsession_error_message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
class Migration(migrations.Migration):
77

88
dependencies = [
9-
("cases", "0021_dicomimagesetupload_task_on_success"),
9+
("cases", "0022_auto_20251021_1014"),
1010
]
1111

1212
operations = [

0 commit comments

Comments
 (0)