# Generated by Django 5.2.5 on 2025-09-03 06:55

import django.db.models.deletion
import simple_history.models
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):
    replaces = [
        ("sample_project", "0001_initial"),
        ("sample_project", "0002_iscousinof_ispartof_issiblingof_livesin"),
        ("sample_project", "0003_alter_versiongroup_options_and_more"),
        ("sample_project", "0004_remove_versiongroup_self_contenttype_and_more"),
        ("sample_project", "0005_place_feature_code_versionplace_feature_code"),
        (
            "sample_project",
            "0006_alter_group_label_alter_person_date_of_birth_and_more",
        ),
        ("sample_project", "0007_alter_person_forename_alter_versionperson_forename"),
        ("sample_project", "0008_remove_versiongroup_version_tag_and_more"),
        ("sample_project", "0009_versionprofession"),
        ("sample_project", "0010_alter_group_options_alter_person_options_and_more"),
        ("sample_project", "0011_alter_place_feature_code_and_more"),
    ]

    initial = True

    dependencies = [
        ("apis_metainfo", "0012_remove_rootobject_deprecated_name"),
        ("contenttypes", "0002_remove_content_type_name"),
        ("relations", "0001_initial"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="Profession",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(blank=True, default="", max_length=1024)),
            ],
        ),
        migrations.CreateModel(
            name="Person",
            fields=[
                (
                    "rootobject_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="apis_metainfo.rootobject",
                    ),
                ),
                (
                    "forename",
                    models.CharField(
                        blank=True, default="", max_length=4096, verbose_name="forename"
                    ),
                ),
                (
                    "surname",
                    models.CharField(
                        blank=True, default="", max_length=4096, verbose_name="surname"
                    ),
                ),
                (
                    "gender",
                    models.CharField(
                        blank=True, default="", max_length=4096, verbose_name="gender"
                    ),
                ),
                (
                    "date_of_birth",
                    models.DateField(
                        blank=True, null=True, verbose_name="date of birth"
                    ),
                ),
                (
                    "date_of_death",
                    models.DateField(
                        blank=True, null=True, verbose_name="date of death"
                    ),
                ),
                (
                    "profession",
                    models.ManyToManyField(blank=True, to="sample_project.profession"),
                ),
            ],
            options={
                "abstract": False,
                "ordering": ["surname", "forename"],
                "verbose_name": "person",
                "verbose_name_plural": "persons",
            },
            bases=("apis_metainfo.rootobject", models.Model),
        ),
        migrations.CreateModel(
            name="VersionPerson",
            fields=[
                (
                    "rootobject_ptr",
                    models.ForeignKey(
                        auto_created=True,
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        parent_link=True,
                        related_name="+",
                        to="apis_metainfo.rootobject",
                    ),
                ),
                (
                    "id",
                    models.IntegerField(
                        auto_created=True, blank=True, db_index=True, verbose_name="ID"
                    ),
                ),
                (
                    "forename",
                    models.CharField(
                        blank=True, default="", max_length=4096, verbose_name="forename"
                    ),
                ),
                (
                    "surname",
                    models.CharField(
                        blank=True, default="", max_length=4096, verbose_name="surname"
                    ),
                ),
                (
                    "gender",
                    models.CharField(
                        blank=True, default="", max_length=4096, verbose_name="gender"
                    ),
                ),
                (
                    "date_of_birth",
                    models.DateField(
                        blank=True, null=True, verbose_name="date of birth"
                    ),
                ),
                (
                    "date_of_death",
                    models.DateField(
                        blank=True, null=True, verbose_name="date of death"
                    ),
                ),
                ("history_id", models.AutoField(primary_key=True, serialize=False)),
                ("history_date", models.DateTimeField(db_index=True)),
                ("history_change_reason", models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "historical person",
                "verbose_name_plural": "historical persons",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": ("history_date", "history_id"),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="VersionPerson_profession",
            fields=[
                (
                    "id",
                    models.BigIntegerField(
                        auto_created=True, blank=True, db_index=True, verbose_name="ID"
                    ),
                ),
                ("m2m_history_id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "history",
                    models.ForeignKey(
                        db_constraint=False,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to="sample_project.versionperson",
                    ),
                ),
                (
                    "person",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        db_tablespace="",
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="sample_project.person",
                    ),
                ),
                (
                    "profession",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        db_tablespace="",
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="sample_project.profession",
                    ),
                ),
            ],
            options={
                "verbose_name": "VersionPerson_profession",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="IsCousinOf",
            fields=[
                (
                    "relation_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="relations.relation",
                    ),
                ),
            ],
            bases=("relations.relation",),
        ),
        migrations.CreateModel(
            name="IsPartOf",
            fields=[
                (
                    "relation_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="relations.relation",
                    ),
                ),
            ],
            bases=("relations.relation",),
        ),
        migrations.CreateModel(
            name="IsSiblingOf",
            fields=[
                (
                    "relation_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="relations.relation",
                    ),
                ),
            ],
            bases=("relations.relation",),
        ),
        migrations.CreateModel(
            name="LivesIn",
            fields=[
                (
                    "relation_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="relations.relation",
                    ),
                ),
            ],
            bases=("relations.relation",),
        ),
        migrations.CreateModel(
            name="VersionGroup",
            fields=[
                (
                    "rootobject_ptr",
                    models.ForeignKey(
                        auto_created=True,
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        parent_link=True,
                        related_name="+",
                        to="apis_metainfo.rootobject",
                    ),
                ),
                (
                    "id",
                    models.IntegerField(
                        auto_created=True, blank=True, db_index=True, verbose_name="ID"
                    ),
                ),
                (
                    "label",
                    models.CharField(
                        blank=True, default="", max_length=4096, verbose_name="label"
                    ),
                ),
                ("history_id", models.AutoField(primary_key=True, serialize=False)),
                ("history_date", models.DateTimeField(db_index=True)),
                ("history_change_reason", models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "historical group",
                "verbose_name_plural": "historical groups",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": ("history_date", "history_id"),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="VersionProfession",
            fields=[
                (
                    "id",
                    models.BigIntegerField(
                        auto_created=True, blank=True, db_index=True, verbose_name="ID"
                    ),
                ),
                ("name", models.CharField(blank=True, default="", max_length=1024)),
                ("history_id", models.AutoField(primary_key=True, serialize=False)),
                ("history_date", models.DateTimeField(db_index=True)),
                ("history_change_reason", models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "historical profession",
                "verbose_name_plural": "historical professions",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": ("history_date", "history_id"),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="Group",
            fields=[
                (
                    "rootobject_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="apis_metainfo.rootobject",
                    ),
                ),
                (
                    "label",
                    models.CharField(
                        blank=True, default="", max_length=4096, verbose_name="label"
                    ),
                ),
            ],
            options={
                "abstract": False,
                "ordering": ["label"],
                "verbose_name": "group",
                "verbose_name_plural": "groups",
            },
            bases=("apis_metainfo.rootobject", models.Model),
        ),
        migrations.CreateModel(
            name="Place",
            fields=[
                (
                    "rootobject_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="apis_metainfo.rootobject",
                    ),
                ),
                (
                    "label",
                    models.CharField(
                        blank=True, default="", max_length=4096, verbose_name="label"
                    ),
                ),
                (
                    "longitude",
                    models.FloatField(blank=True, null=True, verbose_name="longitude"),
                ),
                (
                    "latitude",
                    models.FloatField(blank=True, null=True, verbose_name="latitude"),
                ),
                (
                    "feature_code",
                    models.CharField(
                        blank=True,
                        default="",
                        help_text='<a href="https://www.geonames.org/export/codes.html" target="_blank">Geonames Feature Code List</a>',
                        max_length=16,
                        verbose_name="feature code",
                    ),
                ),
            ],
            options={
                "abstract": False,
                "ordering": ["label"],
                "verbose_name": "place",
                "verbose_name_plural": "places",
            },
            bases=("apis_metainfo.rootobject", models.Model),
        ),
        migrations.CreateModel(
            name="VersionPlace",
            fields=[
                (
                    "rootobject_ptr",
                    models.ForeignKey(
                        auto_created=True,
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        parent_link=True,
                        related_name="+",
                        to="apis_metainfo.rootobject",
                    ),
                ),
                (
                    "id",
                    models.IntegerField(
                        auto_created=True, blank=True, db_index=True, verbose_name="ID"
                    ),
                ),
                (
                    "label",
                    models.CharField(
                        blank=True, default="", max_length=4096, verbose_name="label"
                    ),
                ),
                (
                    "longitude",
                    models.FloatField(blank=True, null=True, verbose_name="longitude"),
                ),
                (
                    "latitude",
                    models.FloatField(blank=True, null=True, verbose_name="latitude"),
                ),
                ("history_id", models.AutoField(primary_key=True, serialize=False)),
                ("history_date", models.DateTimeField(db_index=True)),
                ("history_change_reason", models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "feature_code",
                    models.CharField(
                        blank=True,
                        default="",
                        help_text='<a href="https://www.geonames.org/export/codes.html" target="_blank">Geonames Feature Code List</a>',
                        max_length=16,
                        verbose_name="feature code",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical place",
                "verbose_name_plural": "historical places",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": ("history_date", "history_id"),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
