# Generated by Django 5.2.4 on 2025-10-03 22:39

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("nodes", "0015_netmessage_target_limit"),
    ]

    operations = [
        migrations.CreateModel(
            name="ContentClassifier",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_seed_data", models.BooleanField(default=False, editable=False)),
                ("is_user_data", models.BooleanField(default=False, editable=False)),
                ("is_deleted", models.BooleanField(default=False, editable=False)),
                ("slug", models.SlugField(max_length=100, unique=True)),
                ("label", models.CharField(max_length=150)),
                (
                    "kind",
                    models.CharField(
                        choices=[("TEXT", "Text"), ("IMAGE", "Image")], max_length=10
                    ),
                ),
                (
                    "entrypoint",
                    models.CharField(
                        help_text="Dotted path to classifier callable", max_length=255
                    ),
                ),
                ("run_by_default", models.BooleanField(default=True)),
                ("active", models.BooleanField(default=True)),
            ],
            options={
                "verbose_name": "Content Classifier",
                "verbose_name_plural": "Content Classifiers",
                "ordering": ["label"],
            },
        ),
        migrations.CreateModel(
            name="ContentTag",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_seed_data", models.BooleanField(default=False, editable=False)),
                ("is_user_data", models.BooleanField(default=False, editable=False)),
                ("is_deleted", models.BooleanField(default=False, editable=False)),
                ("slug", models.SlugField(max_length=100, unique=True)),
                ("label", models.CharField(max_length=150)),
            ],
            options={
                "verbose_name": "Content Tag",
                "verbose_name_plural": "Content Tags",
                "ordering": ["label"],
            },
        ),
        migrations.CreateModel(
            name="ContentClassification",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_seed_data", models.BooleanField(default=False, editable=False)),
                ("is_user_data", models.BooleanField(default=False, editable=False)),
                ("is_deleted", models.BooleanField(default=False, editable=False)),
                ("confidence", models.FloatField(blank=True, null=True)),
                ("metadata", models.JSONField(blank=True, null=True)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                (
                    "sample",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="classifications",
                        to="nodes.contentsample",
                    ),
                ),
                (
                    "classifier",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="classifications",
                        to="nodes.contentclassifier",
                    ),
                ),
                (
                    "tag",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="classifications",
                        to="nodes.contenttag",
                    ),
                ),
            ],
            options={
                "verbose_name": "Content Classification",
                "verbose_name_plural": "Content Classifications",
                "ordering": ["-created_at"],
                "unique_together": {("sample", "classifier", "tag")},
            },
        ),
    ]
