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

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


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="Language",
            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)),
                ("code", models.SlugField(max_length=12, unique=True)),
                ("english_name", models.CharField(max_length=100)),
                ("native_name", models.CharField(blank=True, max_length=100)),
                ("is_default", models.BooleanField(default=False)),
            ],
            options={
                "verbose_name": "Language",
                "verbose_name_plural": "Languages",
                "ordering": ["code"],
                "constraints": [
                    models.UniqueConstraint(
                        condition=models.Q(("is_default", True)),
                        fields=("is_default",),
                        name="locale_language_single_default",
                    )
                ],
            },
        ),
        migrations.CreateModel(
            name="Documentation",
            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)),
                ("title", models.CharField(max_length=200)),
                ("description", models.TextField(blank=True)),
                (
                    "default_language",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="default_documents",
                        to="locale.language",
                        verbose_name="Default language",
                    ),
                ),
            ],
            options={
                "verbose_name": "Documentation",
                "verbose_name_plural": "Documentation",
                "ordering": ["slug"],
            },
        ),
        migrations.CreateModel(
            name="DocumentationTranslation",
            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)),
                (
                    "source_path",
                    models.CharField(
                        blank=True,
                        help_text="Repository path to the localized document.",
                        max_length=255,
                    ),
                ),
                (
                    "body",
                    models.TextField(
                        blank=True,
                        help_text="Optional cached content for the localized document.",
                    ),
                ),
                (
                    "documentation",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="translations",
                        to="locale.documentation",
                    ),
                ),
                (
                    "language",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="documentation_translations",
                        to="locale.language",
                    ),
                ),
            ],
            options={
                "verbose_name": "Documentation Translation",
                "verbose_name_plural": "Documentation Translations",
                "ordering": ["documentation__slug", "language__code"],
                "unique_together": {("documentation", "language")},
            },
        ),
    ]
