# Generated by Django 2.2.13 on 2020-06-22 14:35

from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("municipales", "0018_2eme_tour"),
    ]

    operations = [
        migrations.RemoveConstraint(
            model_name="liste",
            name="commune_soutenue_unique",
        ),
        migrations.AddField(
            model_name="liste",
            name="tour",
            field=models.IntegerField(
                choices=[(1, "Premier tour"), (2, "Deuxi√®me tour")],
                default=1,
                verbose_name="Tour",
            ),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name="liste",
            name="code",
            field=models.CharField(editable=False, max_length=20, verbose_name="Code"),
        ),
        migrations.AddConstraint(
            model_name="liste",
            constraint=models.UniqueConstraint(
                fields=("tour", "code"), name="code_unique"
            ),
        ),
        migrations.AddConstraint(
            model_name="liste",
            constraint=models.UniqueConstraint(
                condition=models.Q(_negated=True, soutien="N"),
                fields=("tour", "commune"),
                name="commune_soutenue_unique",
            ),
        ),
    ]
