GooDrive/backend/drive/migrations/0013_private_space_quota.py
Louis Mazin 9c0c7b65dc nice
2026-10-14 02:15:33 +02:00

16 lines
509 B
Python

"""Set the fixed quota on existing private spaces; filesystem relocation is manual."""
from django.db import migrations
QUOTA = 50 * 1024 ** 3
def set_private_quotas(apps, schema_editor):
Space = apps.get_model('drive', 'DriveSpace')
Space.objects.filter(private_owner__isnull=False).update(quota_bytes=QUOTA)
class Migration(migrations.Migration):
dependencies = [('drive', '0012_merge_20261014_0129')]
operations = [migrations.RunPython(set_private_quotas, migrations.RunPython.noop)]