# Generated by Django 5.0.4 on 2024-05-14 08:14

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


class Migration(migrations.Migration):
    initial = True

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

    operations = [
        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)),
            ],
            options={
                "abstract": False,
            },
            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)),
                ("longitude", models.FloatField(blank=True, null=True)),
                ("latitude", models.FloatField(blank=True, null=True)),
            ],
            options={
                "abstract": False,
            },
            bases=("apis_metainfo.rootobject", models.Model),
        ),
        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)),
            ],
            bases=(models.Model,),
        ),
        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)),
                ("surname", models.CharField(blank=True, default="", max_length=4096)),
                ("gender", models.CharField(blank=True, default="", max_length=4096)),
                ("date_of_birth", models.DateField(blank=True, null=True)),
                ("date_of_death", models.DateField(blank=True, null=True)),
                (
                    "profession",
                    models.ManyToManyField(blank=True, to="sample_project.profession"),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=("apis_metainfo.rootobject", models.Model),
        ),
        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"
                    ),
                ),
                (
                    "version_tag",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                ("label", models.CharField(blank=True, default="", max_length=4096)),
                ("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,
                    ),
                ),
                (
                    "self_contenttype",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="contenttypes.contenttype",
                    ),
                ),
            ],
            options={
                "verbose_name": "Version",
                "verbose_name_plural": "Versions",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": ("history_date", "history_id"),
            },
            bases=(
                simple_history.models.HistoricalChanges,
                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"
                    ),
                ),
                (
                    "version_tag",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                ("forename", models.CharField(blank=True, default="", max_length=4096)),
                ("surname", models.CharField(blank=True, default="", max_length=4096)),
                ("gender", models.CharField(blank=True, default="", max_length=4096)),
                ("date_of_birth", models.DateField(blank=True, null=True)),
                ("date_of_death", models.DateField(blank=True, null=True)),
                ("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,
                    ),
                ),
                (
                    "self_contenttype",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="contenttypes.contenttype",
                    ),
                ),
            ],
            options={
                "verbose_name": "Version",
                "verbose_name_plural": "Versions",
                "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="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"
                    ),
                ),
                (
                    "version_tag",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                ("label", models.CharField(blank=True, default="", max_length=4096)),
                ("longitude", models.FloatField(blank=True, null=True)),
                ("latitude", models.FloatField(blank=True, null=True)),
                ("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,
                    ),
                ),
                (
                    "self_contenttype",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="contenttypes.contenttype",
                    ),
                ),
            ],
            options={
                "verbose_name": "Version",
                "verbose_name_plural": "Versions",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": ("history_date", "history_id"),
            },
            bases=(
                simple_history.models.HistoricalChanges,
                models.Model,
            ),
        ),
    ]
