# Generated by Django 5.1.3 on 2024-11-19 09:33

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("models", "11613_nodegroup_grouping_node"),
    ]

    operations = [
        migrations.AddConstraint(
            model_name="node",
            constraint=models.CheckConstraint(
                condition=models.Q(
                    ("istopnode", True), ("nodegroup__isnull", False), _connector="OR"
                ),
                name="has_nodegroup_or_istopnode",
            ),
        ),
        migrations.AddConstraint(
            model_name="nodegroup",
            constraint=models.CheckConstraint(
                condition=models.Q(
                    ("grouping_node", models.F("pk")),
                    ("grouping_node__isnull", True),
                    _connector="OR",
                ),
                name="grouping_node_matches_pk_or_null",
            ),
        ),
    ]
