# Generated by Django 2.0.6 on 2018-06-27 06:24

from django.db import migrations, models
import django.db.models.deletion

def add_sha256(apps, schema_editor):
     '''
     Make sure all ConfirmedEmail have digest_sha256 set
     in order to alter the model so sha256 may not be NULL
     '''
     ConfirmedEmail = apps.get_model('ivataraccount', 'ConfirmedEmail')
     for mail in ConfirmedEmail.objects.filter(digest_sha256=None):
         mail.save()  # pragma: no cover


class Migration(migrations.Migration):

    dependencies = [
        ('ivataraccount', '0006_auto_20180626_1445'),
    ]

    operations = [
        migrations.RunPython(add_sha256),
        migrations.AlterField(
            model_name='confirmedemail',
            name='digest_sha256',
            field=models.CharField(max_length=64),
        ),
        migrations.AlterField(
            model_name='confirmedemail',
            name='photo',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='emails', to='ivataraccount.Photo'),
        ),
        migrations.AlterField(
            model_name='confirmedopenid',
            name='photo',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='openids', to='ivataraccount.Photo'),
        ),
    ]
