# Generated by Django 2.1.15 on 2020-02-25 13:24

from django.db import migrations, models
import uuid


def create_uuid(apps, schema_editor):
    Task = apps.get_model('core', 'Task')
    for task in Task.objects.all():
        task.authtoken_hash = uuid.uuid4()
        task.save(update_fields=['authtoken_hash'])


class Migration(migrations.Migration):
    dependencies = [
        ('core', '0007_auto_20200129_0950'),
    ]

    operations = [
        migrations.AddField(
            model_name='task',
            name='authtoken_hash',
            field=models.UUIDField(blank=True, null=True, default=None),
        ),
        migrations.AddField(
            model_name='task',
            name='total',
            field=models.IntegerField(default=0, help_text='Total amount of documents/items that are tracked with this model.'),
        ),
        migrations.AlterField(
            model_name='task',
            name='errors',
            field=models.TextField(default='[]'),
        ),
        migrations.RunPython(create_uuid),

        migrations.AlterField(
            model_name='task',
            name='authtoken_hash',
            field=models.UUIDField(default=uuid.uuid4, editable=False, unique=True)
        )
    ]
