# Generated by Django 5.1.1 on 2024-10-01 14:14

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


class Migration(migrations.Migration):

    dependencies = [
        ("items", "0005_alter_property_type"),
        ("users", "0006_historicalusersettings"),
    ]

    operations = [
        migrations.CreateModel(
            name="HistoricalItem",
            fields=[
                ("id", models.UUIDField(db_index=True, default=uuid.uuid4, editable=False)),
                ("custom_identifier", models.TextField(blank=True, max_length=2048, null=True)),
                ("created_at", models.DateTimeField(blank=True, editable=False)),
                ("last_modified_at", models.DateTimeField(blank=True, editable=False)),
                ("name", models.TextField(max_length=2048)),
                ("description", models.TextField(max_length=2048)),
                ("history_id", models.UUIDField(default=uuid.uuid4, editable=False, 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)),
                (
                    "author",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="users.usersettings",
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="+", to="users.usersettings"),
                ),
                (
                    "type",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="items.itemtype",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical item",
                "verbose_name_plural": "historical items",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": ("history_date", "history_id"),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="HistoricalItemRelation",
            fields=[
                ("id", models.UUIDField(db_index=True, default=uuid.uuid4, editable=False)),
                ("name", models.TextField(blank=True, max_length=2048, null=True)),
                ("description", models.TextField(blank=True, max_length=2048, null=True)),
                ("custom_identifier", models.TextField(blank=True, max_length=2048, null=True)),
                ("created_at", models.DateTimeField(blank=True, editable=False)),
                ("last_modified_at", models.DateTimeField(blank=True, editable=False)),
                ("history_id", models.UUIDField(default=uuid.uuid4, editable=False, 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)),
                (
                    "author",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="users.usersettings",
                    ),
                ),
                (
                    "child",
                    models.ForeignKey(
                        blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", to="items.item"
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="+", to="users.usersettings"),
                ),
                (
                    "parent",
                    models.ForeignKey(
                        blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", to="items.item"
                    ),
                ),
            ],
            options={
                "verbose_name": "historical item relation",
                "verbose_name_plural": "historical item relations",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": ("history_date", "history_id"),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="HistoricalItemType",
            fields=[
                ("id", models.UUIDField(db_index=True, default=uuid.uuid4, editable=False)),
                ("name", models.TextField(blank=True, max_length=2048, null=True)),
                ("description", models.TextField(blank=True, max_length=2048, null=True)),
                ("custom_identifier", models.TextField(blank=True, max_length=2048, null=True)),
                ("created_at", models.DateTimeField(blank=True, editable=False)),
                ("last_modified_at", models.DateTimeField(blank=True, editable=False)),
                ("history_id", models.UUIDField(default=uuid.uuid4, editable=False, 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)),
                (
                    "author",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="users.usersettings",
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="+", to="users.usersettings"),
                ),
            ],
            options={
                "verbose_name": "historical item type",
                "verbose_name_plural": "historical item types",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": ("history_date", "history_id"),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="HistoricalLinkedProperty",
            fields=[
                ("id", models.UUIDField(db_index=True, default=uuid.uuid4, editable=False)),
                ("name", models.TextField(blank=True, max_length=2048, null=True)),
                ("description", models.TextField(blank=True, max_length=2048, null=True)),
                ("custom_identifier", models.TextField(blank=True, max_length=2048, null=True)),
                ("created_at", models.DateTimeField(blank=True, editable=False)),
                ("last_modified_at", models.DateTimeField(blank=True, editable=False)),
                ("value", models.TextField(max_length=2048)),
                ("history_id", models.UUIDField(default=uuid.uuid4, editable=False, 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)),
                (
                    "author",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="users.usersettings",
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="+", to="users.usersettings"),
                ),
                (
                    "item",
                    models.ForeignKey(
                        blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", to="items.item"
                    ),
                ),
                (
                    "property",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="items.property",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical linked property",
                "verbose_name_plural": "historical linked propertys",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": ("history_date", "history_id"),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="HistoricalProperty",
            fields=[
                ("id", models.UUIDField(db_index=True, default=uuid.uuid4, editable=False)),
                ("name", models.TextField(blank=True, max_length=2048, null=True)),
                ("description", models.TextField(blank=True, max_length=2048, null=True)),
                ("custom_identifier", models.TextField(blank=True, max_length=2048, null=True)),
                ("created_at", models.DateTimeField(blank=True, editable=False)),
                ("last_modified_at", models.DateTimeField(blank=True, editable=False)),
                (
                    "type",
                    models.CharField(
                        choices=[
                            ("text", "Text"),
                            ("date", "Date"),
                            ("datetime", "Date & time"),
                            ("time", "Time"),
                            ("duration", "Duration"),
                            ("uuid", "UUID"),
                            ("number", "Number"),
                            ("float", "Float"),
                            ("boolean", "Boolean"),
                            ("email", "Email"),
                            ("ipv4", "IPv4 address"),
                            ("ipv6", "IPv6 address"),
                            ("json", "JSON"),
                        ],
                        default="text",
                        max_length=32,
                    ),
                ),
                ("history_id", models.UUIDField(default=uuid.uuid4, editable=False, 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)),
                (
                    "author",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="users.usersettings",
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="+", to="users.usersettings"),
                ),
            ],
            options={
                "verbose_name": "historical property",
                "verbose_name_plural": "historical propertys",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": ("history_date", "history_id"),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="HistoricalRelationProperty",
            fields=[
                ("id", models.UUIDField(db_index=True, default=uuid.uuid4, editable=False)),
                ("name", models.TextField(blank=True, max_length=2048, null=True)),
                ("description", models.TextField(blank=True, max_length=2048, null=True)),
                ("custom_identifier", models.TextField(blank=True, max_length=2048, null=True)),
                ("created_at", models.DateTimeField(blank=True, editable=False)),
                ("last_modified_at", models.DateTimeField(blank=True, editable=False)),
                ("value", models.TextField(max_length=2048)),
                ("history_id", models.UUIDField(default=uuid.uuid4, editable=False, 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)),
                (
                    "author",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="users.usersettings",
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="+", to="users.usersettings"),
                ),
                (
                    "property",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="items.property",
                    ),
                ),
                (
                    "relation",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="items.itemrelation",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical relation property",
                "verbose_name_plural": "historical relation propertys",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": ("history_date", "history_id"),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
