# Generated by Django 2.2.7 on 2020-05-06 18:48

from django.db import migrations, models
import uuid


def create_uuid(apps, schema_editor):
    BalanceFill = apps.get_model('user', 'UserBalanceFilRecord')
    for user_profile in BalanceFill.objects.all():
        user_profile.token = uuid.uuid4()
        user_profile.save(update_fields=['token'])


def reverse_placeholder(apps, schema_editor):
    pass


class Migration(migrations.Migration):
    dependencies = [
        ('user', '0014_user_related_referer'),
    ]

    operations = [
        migrations.AddField(
            model_name='userbalancefilrecord',
            name='token',
            field=models.CharField(default=uuid.uuid4, max_length=255, null=True, unique=True, verbose_name='Токен проверки'),
        ),
        migrations.RunPython(create_uuid, reverse_placeholder),
        migrations.AlterField(
            model_name='userbalancefilrecord',
            name='token',
            field=models.CharField(default=uuid.uuid4, max_length=255, editable=False, unique=True, verbose_name='Токен проверки'),
        )
    ]
