# Generated by Django 5.2.8 on 2025-12-06 15:03

import apps.base.models
import django.contrib.auth.models
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("chats", "0003_initial"),
        ("groups", "0002_initial"),
        ("nodes", "0001_initial"),
        ("users", "0001_initial"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="User",
            fields=[],
            options={
                "verbose_name": "User",
                "verbose_name_plural": "Users",
                "proxy": True,
                "indexes": [],
                "constraints": [],
            },
            bases=("users.user",),
            managers=[
                ("objects", apps.base.models.EntityUserManager()),
                ("all_objects", django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.AddField(
            model_name="netmessage",
            name="filter_node",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="filtered_net_messages",
                to="nodes.node",
                verbose_name="Node",
            ),
        ),
        migrations.AddField(
            model_name="netmessage",
            name="node_origin",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="originated_net_messages",
                to="nodes.node",
            ),
        ),
        migrations.AddField(
            model_name="netmessage",
            name="propagated_to",
            field=models.ManyToManyField(
                blank=True, related_name="received_net_messages", to="nodes.node"
            ),
        ),
        migrations.AddField(
            model_name="netmessage",
            name="filter_node_feature",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to="nodes.nodefeature",
                verbose_name="Node feature",
            ),
        ),
        migrations.AddField(
            model_name="nodefeatureassignment",
            name="feature",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="node_assignments",
                to="nodes.nodefeature",
            ),
        ),
        migrations.AddField(
            model_name="nodefeatureassignment",
            name="node",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="feature_assignments",
                to="nodes.node",
            ),
        ),
        migrations.AddField(
            model_name="node",
            name="features",
            field=models.ManyToManyField(
                blank=True,
                related_name="nodes",
                through="nodes.NodeFeatureAssignment",
                to="nodes.nodefeature",
            ),
        ),
        migrations.AddField(
            model_name="nodemanager",
            name="avatar",
            field=models.ForeignKey(
                blank=True,
                help_text="Avatar that owns this profile when not linked directly to a user or group.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="+",
                to="chats.chatavatar",
            ),
        ),
        migrations.AddField(
            model_name="nodemanager",
            name="group",
            field=models.OneToOneField(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="+",
                to="groups.securitygroup",
            ),
        ),
        migrations.AddField(
            model_name="nodemanager",
            name="user",
            field=models.OneToOneField(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="+",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AddField(
            model_name="nodefeature",
            name="roles",
            field=models.ManyToManyField(
                blank=True, related_name="features", to="nodes.noderole"
            ),
        ),
        migrations.AddField(
            model_name="node",
            name="role",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to="nodes.noderole",
            ),
        ),
        migrations.AddField(
            model_name="netmessage",
            name="filter_node_role",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="filtered_net_messages",
                to="nodes.noderole",
                verbose_name="Node role",
            ),
        ),
        migrations.AddField(
            model_name="netmessage",
            name="reach",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to="nodes.noderole",
            ),
        ),
        migrations.AddField(
            model_name="nodeservice",
            name="feature",
            field=models.ForeignKey(
                blank=True,
                help_text="Limit this service to nodes with the selected feature.",
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to="nodes.nodefeature",
            ),
        ),
        migrations.AddField(
            model_name="pendingnetmessage",
            name="message",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="pending_deliveries",
                to="nodes.netmessage",
            ),
        ),
        migrations.AddField(
            model_name="pendingnetmessage",
            name="node",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="pending_net_messages",
                to="nodes.node",
            ),
        ),
        migrations.AlterUniqueTogether(
            name="nodefeatureassignment",
            unique_together={("node", "feature")},
        ),
        migrations.AlterUniqueTogether(
            name="pendingnetmessage",
            unique_together={("node", "message")},
        ),
    ]
