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

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("pages", "0001_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="Site",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "domain",
                    models.CharField(
                        max_length=100,
                        unique=True,
                        validators=[
                            django.contrib.sites.models._simple_domain_name_validator
                        ],
                        verbose_name="domain name",
                    ),
                ),
                ("name", models.CharField(max_length=50, verbose_name="display name")),
                (
                    "managed",
                    models.BooleanField(
                        db_default=False,
                        default=False,
                        help_text="Include this site when staging the local NGINX configuration.",
                        verbose_name="Managed by local NGINX",
                    ),
                ),
                (
                    "require_https",
                    models.BooleanField(
                        db_default=False,
                        default=False,
                        help_text="Redirect HTTP traffic to HTTPS when the staged NGINX configuration is applied.",
                        verbose_name="Require HTTPS",
                    ),
                ),
                (
                    "default_landing",
                    models.ForeignKey(
                        blank=True,
                        help_text="Landing visitors should be redirected to by default.",
                        limit_choices_to={"enabled": True, "is_deleted": False},
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="default_for_sites",
                        to="pages.landing",
                        verbose_name="Default landing",
                    ),
                ),
                (
                    "template",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="sites",
                        to="pages.sitetemplate",
                        verbose_name="Template",
                    ),
                ),
            ],
            options={
                "verbose_name": "site",
                "verbose_name_plural": "sites",
                "db_table": "django_site",
                "ordering": ["domain"],
            },
            managers=[
                ("objects", django.contrib.sites.models.SiteManager()),
            ],
        ),
    ]
