# Generated by Django 5.2.4 on 2025-08-24 14:01

import django.contrib.sites.models
import django.db.models.deletion
from django.db import migrations, models
from django.conf import settings


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("sites", "0002_alter_domain_unique"),
        ("nodes", "0001_initial"),
        ("contenttypes", "0002_remove_content_type_name"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="Application",
            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_deleted", models.BooleanField(default=False, editable=False)),
                ("name", models.CharField(max_length=100, unique=True)),
                ("description", models.TextField(blank=True)),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="SiteProxy",
            fields=[],
            options={
                "verbose_name": "Site",
                "verbose_name_plural": "Sites",
                "proxy": True,
                "indexes": [],
                "constraints": [],
            },
            bases=("sites.site",),
            managers=[
                ("objects", django.contrib.sites.models.SiteManager()),
            ],
        ),
        migrations.CreateModel(
            name="Module",
            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_deleted", models.BooleanField(default=False, editable=False)),
                (
                    "path",
                    models.CharField(
                        blank=True,
                        help_text="Base path for the app, starting with /",
                        max_length=100,
                    ),
                ),
                (
                    "menu",
                    models.CharField(
                        blank=True,
                        help_text="Text used for the navbar pill; defaults to the application name.",
                        max_length=100,
                    ),
                ),
                ("is_default", models.BooleanField(default=False)),
                (
                    "favicon",
                    models.ImageField(blank=True, upload_to="modules/favicons/"),
                ),
                (
                    "application",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="modules",
                        to="pages.application",
                    ),
                ),
                (
                    "node_role",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="modules",
                        to="nodes.noderole",
                    ),
                ),
            ],
            options={
                "verbose_name": "Module",
                "verbose_name_plural": "Modules",
                "unique_together": {("node_role", "path")},
            },
        ),
        migrations.CreateModel(
            name="Landing",
            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_deleted", models.BooleanField(default=False, editable=False)),
                ("path", models.CharField(max_length=200)),
                ("label", models.CharField(max_length=100)),
                ("enabled", models.BooleanField(default=True)),
                ("description", models.TextField(blank=True)),
                (
                    "module",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="landings",
                        to="pages.module",
                    ),
                ),
            ],
            options={
                "abstract": False,
                "unique_together": {("module", "path")},
            },
        ),
        migrations.CreateModel(
            name="SiteBadge",
            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_deleted", models.BooleanField(default=False, editable=False)),
                ("badge_color", models.CharField(default="#28a745", max_length=7)),
                ("favicon", models.ImageField(blank=True, upload_to="sites/favicons/")),
                (
                    "landing_override",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="pages.landing",
                    ),
                ),
                (
                    "site",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="badge",
                        to="sites.site",
                    ),
                ),
            ],
            options={
                "abstract": False,
                "verbose_name": "Site Badge",
                "verbose_name_plural": "Site Badges",
            },
        ),
        migrations.CreateModel(
            name="Favorite",
            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_deleted", models.BooleanField(default=False, editable=False)),
                ("custom_label", models.CharField(blank=True, max_length=100)),
                ("user_data", models.BooleanField(default=False)),
                (
                    "content_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="contenttypes.contenttype",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="favorites",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "abstract": False,
                "unique_together": {("user", "content_type")},
            },
        ),
    ]
