1 # This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
4 from django.db import models, migrations
7 def null_to_blank(apps, schema_editor):
8 Chunk = apps.get_model("chunks", "Chunk")
9 Chunk.objects.filter(content=None).update(content='')
10 Chunk.objects.filter(description=None).update(description='')
13 class Migration(migrations.Migration):
16 ('chunks', '0001_initial'),
20 migrations.RunPython(null_to_blank),
21 migrations.AlterField(
24 field=models.TextField(verbose_name='content', blank=True),
26 migrations.AlterField(
29 field=models.CharField(max_length=255, verbose_name='Description', blank=True),