# -*- coding: utf-8 -*-
# Generated by Django 1.11.28 on 2020-03-22 14:03
from __future__ import unicode_literals

from django.db import migrations, models
import uuid


def create_uuid(apps, schema_editor):
    SQLInvitation = apps.get_model('users', 'SQLInvitation')
    for invitation in SQLInvitation.objects.all():
        invitation.uuid = uuid.uuid4()
        invitation.save()


class Migration(migrations.Migration):

    dependencies = [
        ('users', '0010_populate_usersinvitation'),
    ]

    operations = [
        migrations.AddField(
            model_name='sqlinvitation',
            name='uuid',
            field=models.UUIDField(db_index=True, null=True)
        ),
        migrations.RunPython(create_uuid,
            reverse_code=migrations.RunPython.noop,
            elidable=True),
        migrations.AlterField(
            model_name='sqlinvitation',
            name='id',
            field=models.AutoField(auto_created=True, serialize=False, verbose_name='ID'),
        ),
        migrations.AlterField(
            model_name='sqlinvitation',
            name='uuid',
            field=models.UUIDField(db_index=True, default=uuid.uuid4, primary_key=True, serialize=False),
        )
    ]
