# Generated by Django 2.2.4 on 2019-09-17 13:07

from django.db import migrations, models
import uuid


def fill_uuid(apps, schemaeditor):
    Advertisement = apps.get_model('advertisement', 'Advertisement')
    for a in Advertisement.objects.all():
        a.uuid = uuid.uuid4()
        a.save()


def fill_block_level(apps, schemaeditor):
    Advertisement = apps.get_model('advertisement', 'Advertisement')
    for a in Advertisement.objects.all():
        a.block_level = ''
        a.save()


class Migration(migrations.Migration):

    dependencies = [
        ('translation', '0003_auto_20190901_1032'),
        ('advertisement', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='advertisement',
            name='source',
            field=models.PositiveSmallIntegerField(choices=[(0, 'Mobile'), (1, 'Web')], default=0, verbose_name='Source'),
        ),
        migrations.AddField(
            model_name='advertisement',
            name='target_languages',
            field=models.ManyToManyField(to='translation.Language'),
        ),
        migrations.AddField(
            model_name='advertisement',
            name='uuid',
            field=models.UUIDField(default=uuid.uuid4, editable=False),
        ),
        migrations.RunPython(fill_uuid, migrations.RunPython.noop),
        migrations.AlterField(
            model_name='advertisement',
            name='uuid',
            field=models.UUIDField(default=uuid.uuid4, editable=False, unique=True),
        ),
        migrations.RemoveField(
            model_name='advertisement',
            name='block_level',
        ),
        migrations.AddField(
            model_name='advertisement',
            name='block_level',
            field=models.CharField(blank=True, null=True, max_length=10, verbose_name='Block level')
        ),
        migrations.RunPython(fill_block_level, migrations.RunPython.noop),
        migrations.AlterField(
            model_name='advertisement',
            name='block_level',
            field=models.CharField(max_length=10, verbose_name='Block level')
        ),
    ]
