# Generated by Django 3.0.3 on 2020-02-27 16:15

import autoslug.fields
from django.db import migrations


def migrate_data_forward(apps, schema_editor):
    # see https://stackoverflow.com/a/37310620/330911
    models = [
        apps.get_model("erp", "Activite"),
        apps.get_model("erp", "Cheminement"),
        apps.get_model("erp", "EquipementMalentendant"),
        apps.get_model("erp", "Erp"),
        apps.get_model("erp", "Label"),
    ]
    for Model in models:
        for instance in Model.objects.all():
            instance.save()


def migrate_data_backward(apps, schema_editor):
    pass


class Migration(migrations.Migration):

    dependencies = [
        ("erp", "0053_auto_20200227_1500"),
    ]

    operations = [
        migrations.AddField(
            model_name="activite",
            name="slug",
            field=autoslug.fields.AutoSlugField(
                blank=True,
                default=None,
                editable=False,
                help_text="Identifiant d'URL (slug)",
                null=True,
                populate_from="nom",
                unique=True,
            ),
        ),
        migrations.AddField(
            model_name="cheminement",
            name="slug",
            field=autoslug.fields.AutoSlugField(
                blank=True,
                default=None,
                editable=False,
                help_text="Identifiant d'URL (slug)",
                null=True,
                populate_from="nom",
                unique=True,
            ),
        ),
        migrations.AddField(
            model_name="equipementmalentendant",
            name="slug",
            field=autoslug.fields.AutoSlugField(
                blank=True,
                default=None,
                editable=False,
                help_text="Identifiant d'URL (slug)",
                null=True,
                populate_from="nom",
                unique=True,
            ),
        ),
        migrations.AddField(
            model_name="erp",
            name="slug",
            field=autoslug.fields.AutoSlugField(
                blank=True,
                default=None,
                editable=False,
                help_text="Identifiant d'URL (slug)",
                null=True,
                populate_from="nom",
                unique=True,
            ),
        ),
        migrations.AddField(
            model_name="label",
            name="slug",
            field=autoslug.fields.AutoSlugField(
                blank=True,
                default=None,
                editable=False,
                help_text="Identifiant d'URL (slug)",
                null=True,
                populate_from="nom",
                unique=True,
            ),
        ),
        migrations.RunPython(migrate_data_forward, migrate_data_backward,),
    ]

# Generated by Django 3.0.3 on 2020-02-27 16:15

import autoslug.fields
from django.db import migrations


def migrate_data_forward(apps, schema_editor):
    # see https://stackoverflow.com/a/37310620/330911
    models = [
        apps.get_model("erp", "Activite"),
        apps.get_model("erp", "Cheminement"),
        apps.get_model("erp", "EquipementMalentendant"),
        apps.get_model("erp", "Erp"),
        apps.get_model("erp", "Label"),
    ]
    for Model in models:
        for instance in Model.objects.all():
            instance.save()


def migrate_data_backward(apps, schema_editor):
    pass


class Migration(migrations.Migration):

    dependencies = [
        ("erp", "0053_auto_20200227_1500"),
    ]

    operations = [
        migrations.AddField(
            model_name="activite",
            name="slug",
            field=autoslug.fields.AutoSlugField(
                blank=True,
                default=None,
                editable=False,
                help_text="Identifiant d'URL (slug)",
                null=True,
                populate_from="nom",
                unique=True,
            ),
        ),
        migrations.AddField(
            model_name="cheminement",
            name="slug",
            field=autoslug.fields.AutoSlugField(
                blank=True,
                default=None,
                editable=False,
                help_text="Identifiant d'URL (slug)",
                null=True,
                populate_from="nom",
                unique=True,
            ),
        ),
        migrations.AddField(
            model_name="equipementmalentendant",
            name="slug",
            field=autoslug.fields.AutoSlugField(
                blank=True,
                default=None,
                editable=False,
                help_text="Identifiant d'URL (slug)",
                null=True,
                populate_from="nom",
                unique=True,
            ),
        ),
        migrations.AddField(
            model_name="erp",
            name="slug",
            field=autoslug.fields.AutoSlugField(
                blank=True,
                default=None,
                editable=False,
                help_text="Identifiant d'URL (slug)",
                null=True,
                populate_from="nom",
                unique=True,
            ),
        ),
        migrations.AddField(
            model_name="label",
            name="slug",
            field=autoslug.fields.AutoSlugField(
                blank=True,
                default=None,
                editable=False,
                help_text="Identifiant d'URL (slug)",
                null=True,
                populate_from="nom",
                unique=True,
            ),
        ),
        migrations.RunPython(migrate_data_forward, migrate_data_backward,),
    ]

# Generated by Django 3.0.3 on 2020-02-27 16:15 # see https://stackoverflow.com/a/37310620/330911