# Generated by Django 5.1.10 on 2025-08-15 03:21

import access.models.tenancy_abstract
import assistance.models.model_knowledge_base_article
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("access", "0011_remove_entitynotes_model_and_more"),
        ("assistance", "0006_alter_knowledgebase_organization_and_more"),
        ("core", "0024_centurionaudit_centurionmodelnote_and_more"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.RemoveField(
            model_name="knowledgebase",
            name="is_global",
        ),
        migrations.RemoveField(
            model_name="knowledgebasecategory",
            name="is_global",
        ),
        migrations.AddField(
            model_name="knowledgebase",
            name="model_notes",
            field=models.TextField(
                blank=True,
                help_text="Tid bits of information",
                null=True,
                verbose_name="Notes",
            ),
        ),
        migrations.AlterField(
            model_name="knowledgebase",
            name="category",
            field=models.ForeignKey(
                help_text="Article Category",
                max_length=50,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="assistance.knowledgebasecategory",
                verbose_name="Category",
            ),
        ),
        migrations.AlterField(
            model_name="knowledgebase",
            name="content",
            field=models.TextField(
                blank=True,
                help_text="Content of the article. Markdown is supported",
                null=True,
                verbose_name="Article Content",
            ),
        ),
        migrations.AlterField(
            model_name="knowledgebase",
            name="expiry_date",
            field=models.DateTimeField(
                blank=True,
                help_text="Date the article will be removed from published articles",
                null=True,
                verbose_name="End Date",
            ),
        ),
        migrations.AlterField(
            model_name="knowledgebase",
            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="knowledgebase",
            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="knowledgebase",
            name="release_date",
            field=models.DateTimeField(
                blank=True,
                help_text="Date the article will be published",
                null=True,
                verbose_name="Publish Date",
            ),
        ),
        migrations.AlterField(
            model_name="knowledgebase",
            name="responsible_teams",
            field=models.ManyToManyField(
                blank=True,
                help_text="Team(s) whom is considered the articles owner.",
                related_name="responsible_teams",
                to="access.team",
                verbose_name="Responsible Team(s)",
            ),
        ),
        migrations.AlterField(
            model_name="knowledgebase",
            name="responsible_user",
            field=models.ForeignKey(
                blank=True,
                help_text="User(s) whom is considered the articles owner.",
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="responsible_user",
                to=settings.AUTH_USER_MODEL,
                verbose_name="Responsible User",
            ),
        ),
        migrations.AlterField(
            model_name="knowledgebase",
            name="summary",
            field=models.TextField(
                blank=True,
                help_text="Short Summary of the article",
                null=True,
                verbose_name="Summary",
            ),
        ),
        migrations.AlterField(
            model_name="knowledgebase",
            name="target_team",
            field=models.ManyToManyField(
                blank=True,
                help_text="Team(s) to grant access to the article",
                to="access.team",
                verbose_name="Target Team(s)",
            ),
        ),
        migrations.AlterField(
            model_name="knowledgebase",
            name="target_user",
            field=models.ForeignKey(
                blank=True,
                help_text="User(s) to grant access to the article",
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to=settings.AUTH_USER_MODEL,
                verbose_name="Target Users(s)",
            ),
        ),
        migrations.AlterField(
            model_name="knowledgebasecategory",
            name="model_notes",
            field=models.TextField(
                blank=True,
                help_text="Tid bits of information",
                null=True,
                verbose_name="Notes",
            ),
        ),
        migrations.AlterField(
            model_name="knowledgebasecategory",
            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="knowledgebasecategory",
            name="parent_category",
            field=models.ForeignKey(
                blank=True,
                help_text="Category this category belongs to",
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to="assistance.knowledgebasecategory",
                verbose_name="Parent Category",
            ),
        ),
        migrations.AlterField(
            model_name="knowledgebasecategory",
            name="target_team",
            field=models.ManyToManyField(
                blank=True,
                help_text="Team(s) to grant access to the article",
                to="access.team",
                verbose_name="Target Team(s)",
            ),
        ),
        migrations.AlterField(
            model_name="knowledgebasecategory",
            name="target_user",
            field=models.ForeignKey(
                blank=True,
                help_text="User(s) to grant access to the article",
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to=settings.AUTH_USER_MODEL,
                verbose_name="Target Users(s)",
            ),
        ),
        migrations.AlterField(
            model_name="modelknowledgebasearticle",
            name="model",
            field=models.CharField(
                choices=assistance.models.model_knowledge_base_article.all_models,
                help_text="Model type to link to article article",
                max_length=80,
                verbose_name="Model Type",
            ),
        ),
        migrations.CreateModel(
            name="KnowledgeBaseAuditHistory",
            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="assistance.knowledgebase",
                        verbose_name="Model",
                    ),
                ),
            ],
            options={
                "verbose_name": "Knowledge Base History",
                "verbose_name_plural": "Knowledge Base Histories",
                "db_table": "assistance_knowledgebase_audithistory",
                "managed": True,
            },
            bases=("core.centurionaudit",),
        ),
        migrations.CreateModel(
            name="KnowledgeBaseCategoryAuditHistory",
            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="assistance.knowledgebasecategory",
                        verbose_name="Model",
                    ),
                ),
            ],
            options={
                "verbose_name": "Knowledge Base Category History",
                "verbose_name_plural": "Knowledge Base Category Histories",
                "db_table": "assistance_knowledgebasecategory_audithistory",
                "managed": True,
            },
            bases=("core.centurionaudit",),
        ),
        migrations.CreateModel(
            name="KnowledgeBaseCategoryCenturionModelNote",
            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="assistance.knowledgebasecategory",
                        verbose_name="Model",
                    ),
                ),
            ],
            options={
                "verbose_name": "Knowledge Base Category Note",
                "verbose_name_plural": "Knowledge Base Category Notes",
                "db_table": "assistance_knowledgebasecategory_centurionmodelnote",
                "managed": True,
            },
            bases=("core.centurionmodelnote",),
        ),
        migrations.CreateModel(
            name="KnowledgeBaseCenturionModelNote",
            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="assistance.knowledgebase",
                        verbose_name="Model",
                    ),
                ),
            ],
            options={
                "verbose_name": "Knowledge Base Note",
                "verbose_name_plural": "Knowledge Base Notes",
                "db_table": "assistance_knowledgebase_centurionmodelnote",
                "managed": True,
            },
            bases=("core.centurionmodelnote",),
        ),
    ]
