# Generated by Django 5.0.6 on 2024-06-03 14:14

from django.db import migrations, models
from django.utils.text import slugify


def populate_slug(apps, schema_editor):
    MailDomain = apps.get_model('mailbox_manager', 'MailDomain')
    for mail_domain in MailDomain.objects.filter(slug=''):
        mail_domain.slug = slugify(mail_domain.name)
        mail_domain.save()


class Migration(migrations.Migration):

    dependencies = [
        ('mailbox_manager', '0003_maildomain_slug'),
    ]

    operations = [
        migrations.RunPython(populate_slug, reverse_code=migrations.RunPython.noop),

    ]
