# Generated by Django 5.1.9 on 2025-06-14 03:56

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


class Migration(migrations.Migration):

    dependencies = [
        ("access", "0016_remove_tenant_slug_alter_tenant_manager_and_more"),
        ("assistance", "0013_alter_modelknowledgebasearticle_model"),
        ("core", "0033_alter_ticketcommentcategory_parent_and_more"),
        ("project_management", "0008_remove_projectmilestone_is_global_and_more"),
    ]

    operations = [
        migrations.RemoveField(
            model_name="projectstate",
            name="is_global",
        ),
        migrations.AlterField(
            model_name="projectstate",
            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="projectstate",
            name="model_notes",
            field=models.TextField(
                blank=True,
                help_text="Tid bits of information",
                null=True,
                verbose_name="Notes",
            ),
        ),
        migrations.AlterField(
            model_name="projectstate",
            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.AlterField(
            model_name="projectstate",
            name="runbook",
            field=models.ForeignKey(
                blank=True,
                help_text="The runbook for this project state",
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="assistance.knowledgebase",
                verbose_name="Runbook",
            ),
        ),
        migrations.CreateModel(
            name="ProjectStateAuditHistory",
            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="project_management.projectstate",
                        verbose_name="Model",
                    ),
                ),
            ],
            options={
                "verbose_name": "Project State History",
                "verbose_name_plural": "Project State Histories",
                "db_table": "project_management_projectstate_audithistory",
                "managed": True,
            },
            bases=("core.centurionaudit",),
        ),
        migrations.CreateModel(
            name="ProjectStateCenturionModelNote",
            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="project_management.projectstate",
                        verbose_name="Model",
                    ),
                ),
            ],
            options={
                "verbose_name": "Project State Note",
                "verbose_name_plural": "Project State Notes",
                "db_table": "project_management_projectstate_centurionmodelnote",
                "managed": True,
            },
            bases=("core.centurionmodelnote",),
        ),
    ]
