# Generated by Django 5.1.5 on 2025-02-02 21:49

from django.db import migrations, models


def fill_support_email(apps, schema_editor):
    MailDomain = apps.get_model('mailbox_manager', 'MailDomain')
    for domain in MailDomain.objects.filter(support_email__isnull=True):
        domain.support_email = "support-regie@numerique.gouv.fr"
        domain.save()


class Migration(migrations.Migration):

    dependencies = [
        ('mailbox_manager', '0017_alter_maildomain_status'),
    ]

    operations = [
        migrations.AddField(
            model_name='maildomain',
            name='support_email',
            field=models.EmailField(blank=True, max_length=254, null=True, verbose_name='support email'),
        ),
        migrations.RunPython(fill_support_email, reverse_code=migrations.RunPython.noop),
        migrations.AlterField(
            model_name='maildomain',
            name='support_email',
            field=models.EmailField(max_length=254, verbose_name='support email'),
        ),
    ]
