Skip to content

Commit e18e66b

Browse files
committed
🗃️(backend) fix storage_location for existing BBB AWS documents
The `storage location` field was introduced in a previous release and filled with a default value "AWS_S3". However, the correct enum value is "AWS".
1 parent 5704e81 commit e18e66b

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Generated by Django 5.0.9 on 2025-06-11 17:34
2+
3+
from django.db import migrations
4+
5+
from marsha.core.defaults import AWS_S3
6+
7+
8+
def fix_storage_location_to_aws(apps, schema_editor):
9+
"""Update the storage_location field for existing classroom documents."""
10+
ClassroomDocument = apps.get_model("bbb", "ClassroomDocument")
11+
ClassroomDocument.objects.filter(storage_location="AWS_S3").update(
12+
storage_location=AWS_S3
13+
)
14+
15+
16+
class Migration(migrations.Migration):
17+
dependencies = [
18+
("bbb", "0025_classroomdocument_fill_storage_location"),
19+
]
20+
21+
operations = [
22+
migrations.RunPython(fix_storage_location_to_aws, migrations.RunPython.noop),
23+
]

0 commit comments

Comments
 (0)