# Generated by Django 4.2.7 on 2025-03-28 07:16

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


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="Region",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "name_uz",
                    models.CharField(
                        db_index=True,
                        help_text="Name in Uzbek language",
                        max_length=255,
                        unique=True,
                    ),
                ),
                (
                    "name_oz",
                    models.CharField(
                        db_index=True,
                        help_text="Name in Uzbek Cyrillic",
                        max_length=255,
                        unique=True,
                    ),
                ),
                (
                    "name_ru",
                    models.CharField(
                        db_index=True,
                        help_text="Name in Russian language",
                        max_length=255,
                        unique=True,
                    ),
                ),
                (
                    "name_en",
                    models.CharField(
                        db_index=True,
                        help_text="Name in English language",
                        max_length=255,
                        unique=True,
                    ),
                ),
            ],
            options={
                "verbose_name": "Region",
                "verbose_name_plural": "Regions",
                "db_table": "regions",
                "indexes": [
                    models.Index(fields=["name_uz"], name="regions_name_uz_459fb7_idx"),
                    models.Index(fields=["name_oz"], name="regions_name_oz_644cfc_idx"),
                    models.Index(fields=["name_ru"], name="regions_name_ru_76ea74_idx"),
                    models.Index(fields=["name_en"], name="regions_name_en_22fa92_idx"),
                ],
            },
        ),
        migrations.CreateModel(
            name="District",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "name_uz",
                    models.CharField(
                        db_index=True,
                        help_text="Name in Uzbek language",
                        max_length=255,
                    ),
                ),
                (
                    "name_oz",
                    models.CharField(
                        db_index=True,
                        help_text="Name in Uzbek Cyrillic",
                        max_length=255,
                    ),
                ),
                (
                    "name_ru",
                    models.CharField(
                        db_index=True,
                        help_text="Name in Russian language",
                        max_length=255,
                    ),
                ),
                (
                    "name_en",
                    models.CharField(
                        blank=True,
                        db_index=True,
                        help_text="Name in English language",
                        max_length=255,
                        null=True,
                    ),
                ),
                (
                    "region",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="districts",
                        to="uzbekistan.region",
                    ),
                ),
            ],
            options={
                "verbose_name": "District",
                "verbose_name_plural": "Districts",
                "db_table": "districts",
            },
        ),
        migrations.CreateModel(
            name="Village",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "name_uz",
                    models.CharField(
                        db_index=True,
                        help_text="Name in Uzbek language",
                        max_length=255,
                    ),
                ),
                (
                    "name_oz",
                    models.CharField(
                        db_index=True,
                        help_text="Name in Uzbek Cyrillic",
                        max_length=255,
                    ),
                ),
                (
                    "name_ru",
                    models.CharField(
                        db_index=True,
                        help_text="Name in Russian language",
                        max_length=255,
                    ),
                ),
                (
                    "district",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="villages",
                        to="uzbekistan.district",
                    ),
                ),
            ],
            options={
                "verbose_name": "Village",
                "verbose_name_plural": "Villages",
                "db_table": "villages",
                "indexes": [
                    models.Index(
                        fields=["name_uz"], name="villages_name_uz_0bece7_idx"
                    ),
                    models.Index(
                        fields=["name_oz"], name="villages_name_oz_c86de0_idx"
                    ),
                    models.Index(
                        fields=["name_ru"], name="villages_name_ru_dcad34_idx"
                    ),
                    models.Index(
                        fields=["district"], name="villages_distric_0f574a_idx"
                    ),
                ],
                "unique_together": {("name_uz", "name_oz", "name_ru", "district")},
            },
        ),
        migrations.AddIndex(
            model_name="district",
            index=models.Index(fields=["name_uz"], name="districts_name_uz_89f6b6_idx"),
        ),
        migrations.AddIndex(
            model_name="district",
            index=models.Index(fields=["name_oz"], name="districts_name_oz_b6d417_idx"),
        ),
        migrations.AddIndex(
            model_name="district",
            index=models.Index(fields=["name_ru"], name="districts_name_ru_3797d9_idx"),
        ),
        migrations.AddIndex(
            model_name="district",
            index=models.Index(fields=["name_en"], name="districts_name_en_4c278c_idx"),
        ),
        migrations.AddIndex(
            model_name="district",
            index=models.Index(fields=["region"], name="districts_region__edd0d7_idx"),
        ),
        migrations.AlterUniqueTogether(
            name="district",
            unique_together={("name_uz", "name_oz", "name_ru", "region")},
        ),
    ]
