# Generated by Django 3.2.15 on 2022-09-23 09:13

from django.db import migrations
import localized_fields.fields.char_field

from emeis.core import models


def set_full_name(apps, schema_editor):
    scope_model = apps.get_model("emeis_core.scope")
    for scope in scope_model.objects.all().iterator():
        # explicitly trigger the set_full_name signal handler
        models.set_full_name(instance=scope, sender=set_full_name)
        scope.save()


class Migration(migrations.Migration):
    dependencies = [
        ("emeis_core", "0009_alter_scope_parent"),
    ]

    operations = [
        migrations.AddField(
            model_name="scope",
            name="full_name",
            field=localized_fields.fields.char_field.LocalizedCharField(
                blank=True, null=True, required=[], verbose_name="scope name"
            ),
        ),
        migrations.RunPython(set_full_name, migrations.RunPython.noop),
    ]
