# Generated by Django 5.1.9 on 2025-06-17 07:32

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


class Migration(migrations.Migration):

    dependencies = [
        ("access", "0017_remove_entitynotes_model_and_more"),
        ("core", "0033_alter_ticketcommentcategory_parent_and_more"),
    ]

    operations = [
        migrations.RemoveField(
            model_name="entity",
            name="is_global",
        ),
        migrations.AlterField(
            model_name="entity",
            name="id",
            field=models.AutoField(
                help_text="ID of the item",
                primary_key=True,
                serialize=False,
                unique=True,
                verbose_name="ID",
            ),
        ),
        migrations.AlterField(
            model_name="entity",
            name="model_notes",
            field=models.TextField(
                blank=True,
                help_text="Tid bits of information",
                null=True,
                verbose_name="Notes",
            ),
        ),
        migrations.AlterField(
            model_name="entity",
            name="organization",
            field=models.ForeignKey(
                help_text="Tenant this belongs to",
                on_delete=django.db.models.deletion.CASCADE,
                related_name="+",
                to="access.tenant",
                validators=[
                    access.models.tenancy_abstract.TenancyAbstractModel.validatate_organization_exists
                ],
                verbose_name="Tenant",
            ),
        ),
        migrations.CreateModel(
            name="ContactAuditHistory",
            fields=[
                (
                    "centurionaudit_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="core.centurionaudit",
                    ),
                ),
                (
                    "model",
                    models.ForeignKey(
                        help_text="Model this history belongs to",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="access.contact",
                        verbose_name="Model",
                    ),
                ),
            ],
            options={
                "verbose_name": "Contact History",
                "verbose_name_plural": "Contact Histories",
                "db_table": "access_contact_audithistory",
                "managed": True,
            },
            bases=("core.centurionaudit",),
        ),
        migrations.CreateModel(
            name="ContactCenturionModelNote",
            fields=[
                (
                    "centurionmodelnote_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="core.centurionmodelnote",
                    ),
                ),
                (
                    "model",
                    models.ForeignKey(
                        help_text="Model this note belongs to",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="access.contact",
                        verbose_name="Model",
                    ),
                ),
            ],
            options={
                "verbose_name": "Contact Note",
                "verbose_name_plural": "Contact Notes",
                "db_table": "access_contact_centurionmodelnote",
                "managed": True,
            },
            bases=("core.centurionmodelnote",),
        ),
        migrations.CreateModel(
            name="EntityAuditHistory",
            fields=[
                (
                    "centurionaudit_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="core.centurionaudit",
                    ),
                ),
                (
                    "model",
                    models.ForeignKey(
                        help_text="Model this history belongs to",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="audit_history",
                        to="access.entity",
                        verbose_name="Model",
                    ),
                ),
            ],
            options={
                "verbose_name": "Entity History",
                "verbose_name_plural": "Entity Histories",
                "db_table": "access_entity_audithistory",
                "managed": True,
            },
            bases=("core.centurionaudit",),
        ),
        migrations.CreateModel(
            name="EntityCenturionModelNote",
            fields=[
                (
                    "centurionmodelnote_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="core.centurionmodelnote",
                    ),
                ),
                (
                    "model",
                    models.ForeignKey(
                        help_text="Model this note belongs to",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="access.entity",
                        verbose_name="Model",
                    ),
                ),
            ],
            options={
                "verbose_name": "Entity Note",
                "verbose_name_plural": "Entity Notes",
                "db_table": "access_entity_centurionmodelnote",
                "managed": True,
            },
            bases=("core.centurionmodelnote",),
        ),
        migrations.CreateModel(
            name="PersonAuditHistory",
            fields=[
                (
                    "centurionaudit_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="core.centurionaudit",
                    ),
                ),
                (
                    "model",
                    models.ForeignKey(
                        help_text="Model this history belongs to",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="access.person",
                        verbose_name="Model",
                    ),
                ),
            ],
            options={
                "verbose_name": "Person History",
                "verbose_name_plural": "Person Histories",
                "db_table": "access_person_audithistory",
                "managed": True,
            },
            bases=("core.centurionaudit",),
        ),
        migrations.CreateModel(
            name="PersonCenturionModelNote",
            fields=[
                (
                    "centurionmodelnote_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="core.centurionmodelnote",
                    ),
                ),
                (
                    "model",
                    models.ForeignKey(
                        help_text="Model this note belongs to",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="access.person",
                        verbose_name="Model",
                    ),
                ),
            ],
            options={
                "verbose_name": "Person Note",
                "verbose_name_plural": "Person Notes",
                "db_table": "access_person_centurionmodelnote",
                "managed": True,
            },
            bases=("core.centurionmodelnote",),
        ),
    ]
