# Generated by Django 4.0.8 on 2023-01-10 06:59

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0008_remove_basetreenode_parent_title_uniq_when_parent_is_null_and_more'),
    ]

    operations = [
        migrations.RemoveConstraint(
            model_name='basetreenode',
            name='unique title per parent',
        ),
        migrations.RemoveConstraint(
            model_name='basetreenode',
            name='title_uniq_when_parent_is_null',
        ),
        migrations.AddConstraint(
            model_name='basetreenode',
            constraint=models.UniqueConstraint(fields=('parent', 'title', 'user_id'), name='unique title per parent per user'),
        ),
        migrations.AddConstraint(
            model_name='basetreenode',
            constraint=models.UniqueConstraint(condition=models.Q(('parent__isnull', True)), fields=('title', 'user_id'), name='title_uniq_when_parent_is_null_per_user'),
        ),
    ]
