# Generated by Django 4.1.5 on 2023-03-04 22:33

from django.db import migrations
from django.db import models


class Migration(migrations.Migration):
    dependencies = [
        ("documents", "1032_alter_correspondent_matching_algorithm_and_more"),
    ]

    operations = [
        migrations.AlterModelOptions(
            name="documenttype",
            options={
                "ordering": ("name",),
                "verbose_name": "document type",
                "verbose_name_plural": "document types",
            },
        ),
        migrations.AlterModelOptions(
            name="tag",
            options={
                "ordering": ("name",),
                "verbose_name": "tag",
                "verbose_name_plural": "tags",
            },
        ),
        migrations.AlterField(
            model_name="correspondent",
            name="name",
            field=models.CharField(max_length=128, verbose_name="name"),
        ),
        migrations.AlterField(
            model_name="documenttype",
            name="name",
            field=models.CharField(max_length=128, verbose_name="name"),
        ),
        migrations.AlterField(
            model_name="storagepath",
            name="name",
            field=models.CharField(max_length=128, verbose_name="name"),
        ),
        migrations.AlterField(
            model_name="tag",
            name="name",
            field=models.CharField(max_length=128, verbose_name="name"),
        ),
        migrations.AddConstraint(
            model_name="correspondent",
            constraint=models.UniqueConstraint(
                fields=("name", "owner"),
                name="documents_correspondent_unique_name_owner",
            ),
        ),
        migrations.AddConstraint(
            model_name="correspondent",
            constraint=models.UniqueConstraint(
                condition=models.Q(("owner__isnull", True)),
                fields=("name",),
                name="documents_correspondent_name_uniq",
            ),
        ),
        migrations.AddConstraint(
            model_name="documenttype",
            constraint=models.UniqueConstraint(
                fields=("name", "owner"),
                name="documents_documenttype_unique_name_owner",
            ),
        ),
        migrations.AddConstraint(
            model_name="documenttype",
            constraint=models.UniqueConstraint(
                condition=models.Q(("owner__isnull", True)),
                fields=("name",),
                name="documents_documenttype_name_uniq",
            ),
        ),
        migrations.AddConstraint(
            model_name="storagepath",
            constraint=models.UniqueConstraint(
                fields=("name", "owner"),
                name="documents_storagepath_unique_name_owner",
            ),
        ),
        migrations.AddConstraint(
            model_name="storagepath",
            constraint=models.UniqueConstraint(
                condition=models.Q(("owner__isnull", True)),
                fields=("name",),
                name="documents_storagepath_name_uniq",
            ),
        ),
        migrations.AddConstraint(
            model_name="tag",
            constraint=models.UniqueConstraint(
                fields=("name", "owner"),
                name="documents_tag_unique_name_owner",
            ),
        ),
        migrations.AddConstraint(
            model_name="tag",
            constraint=models.UniqueConstraint(
                condition=models.Q(("owner__isnull", True)),
                fields=("name",),
                name="documents_tag_name_uniq",
            ),
        ),
    ]
