# Generated by Django 3.1.2 on 2020-10-07 14:36

from django.db import migrations, models


def copy_house_id(apps, schema_editor):
    ElectionManager = apps.get_model('management', 'ElectionManager')
    for e in ElectionManager.objects.all():
        e.username = e.email
        e.save()


class Migration(migrations.Migration):

    dependencies = [
        ('management', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='electionmanager',
            name='username',
            field=models.CharField(null=True, max_length=255),
        ),
        migrations.RunPython(code=copy_house_id, reverse_code=migrations.RunPython.noop),
        migrations.AlterField(
            model_name='electionmanager',
            name='username',
            field=models.CharField(max_length=255, unique=True),
        ),
        migrations.AlterField(
            model_name='electionmanager',
            name='email',
            field=models.EmailField(blank=True, max_length=254, null=True),
        ),
    ]
