1
0
mirror of https://github.com/etesync/server synced 2024-12-29 10:48:07 +00:00
etesync-server/django_etesync/migrations/0037_auto_20200415_1421.py

24 lines
693 B
Python

# Generated by Django 3.0.3 on 2020-04-15 14:21
from django.db import migrations
def change_chunk_relation(apps, schema_editor):
CollectionItemRevision = apps.get_model('django_etesync', 'CollectionItemRevision')
RevisionChunkRelation = apps.get_model('django_etesync', 'RevisionChunkRelation')
for revision in CollectionItemRevision.objects.all():
for chunk in revision.chunks.all():
RevisionChunkRelation.objects.create(chunk=chunk, revision=revision)
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0036_auto_20200415_1420'),
]
operations = [
migrations.RunPython(change_chunk_relation),
]