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

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


class Migration(migrations.Migration):

    dependencies = [
        ("access", "0011_remove_entitynotes_model_and_more"),
        ("config_management", "0008_alter_configgrouphosts_organization_and_more"),
        ("core", "0024_centurionaudit_centurionmodelnote_and_more"),
        ("itam", "0012_remove_device_is_global_remove_device_slug_and_more"),
    ]

    operations = [
        migrations.RemoveField(
            model_name="configgrouphosts",
            name="is_global",
        ),
        migrations.RemoveField(
            model_name="configgroups",
            name="is_global",
        ),
        migrations.RemoveField(
            model_name="configgroupsoftware",
            name="is_global",
        ),
        migrations.AlterField(
            model_name="configgrouphosts",
            name="group",
            field=models.ForeignKey(
                help_text="Group that this host is part of",
                on_delete=django.db.models.deletion.PROTECT,
                to="config_management.configgroups",
                verbose_name="Group",
            ),
        ),
        migrations.AlterField(
            model_name="configgrouphosts",
            name="host",
            field=models.ForeignKey(
                help_text="Host that will be apart of this config group",
                on_delete=django.db.models.deletion.PROTECT,
                to="itam.device",
                validators=[
                    config_management.models.groups.ConfigGroupHosts.validate_host_no_parent_group
                ],
                verbose_name="Host",
            ),
        ),
        migrations.AlterField(
            model_name="configgrouphosts",
            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="configgrouphosts",
            name="model_notes",
            field=models.TextField(
                blank=True,
                help_text="Tid bits of information",
                null=True,
                verbose_name="Notes",
            ),
        ),
        migrations.AlterField(
            model_name="configgrouphosts",
            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="configgroups",
            name="config",
            field=models.JSONField(
                blank=True,
                help_text="Configuration for this Group",
                null=True,
                validators=[
                    config_management.models.groups.ConfigGroups.validate_config_keys_not_reserved
                ],
                verbose_name="Configuration",
            ),
        ),
        migrations.AlterField(
            model_name="configgroups",
            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="configgroups",
            name="model_notes",
            field=models.TextField(
                blank=True,
                help_text="Tid bits of information",
                null=True,
                verbose_name="Notes",
            ),
        ),
        migrations.AlterField(
            model_name="configgroups",
            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="configgroups",
            name="parent",
            field=models.ForeignKey(
                blank=True,
                help_text="Parent of this Group",
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="config_management.configgroups",
                verbose_name="Parent Group",
            ),
        ),
        migrations.AlterField(
            model_name="configgroupsoftware",
            name="action",
            field=models.IntegerField(
                blank=True,
                choices=[(1, "Install"), (0, "Remove")],
                help_text="ACtion to perform with this software",
                null=True,
                verbose_name="Action",
            ),
        ),
        migrations.AlterField(
            model_name="configgroupsoftware",
            name="config_group",
            field=models.ForeignKey(
                help_text="Config group this softwre will be linked to",
                on_delete=django.db.models.deletion.PROTECT,
                to="config_management.configgroups",
                verbose_name="Config Group",
            ),
        ),
        migrations.AlterField(
            model_name="configgroupsoftware",
            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="configgroupsoftware",
            name="model_notes",
            field=models.TextField(
                blank=True,
                help_text="Tid bits of information",
                null=True,
                verbose_name="Notes",
            ),
        ),
        migrations.AlterField(
            model_name="configgroupsoftware",
            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="configgroupsoftware",
            name="software",
            field=models.ForeignKey(
                help_text="Software to add to this config Group",
                on_delete=django.db.models.deletion.PROTECT,
                to="itam.software",
                verbose_name="Software",
            ),
        ),
        migrations.AlterField(
            model_name="configgroupsoftware",
            name="version",
            field=models.ForeignKey(
                blank=True,
                help_text="Software Version for this config group",
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="itam.softwareversion",
                verbose_name="Verrsion",
            ),
        ),
        migrations.CreateModel(
            name="ConfigGroupHostsAuditHistory",
            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="config_management.configgrouphosts",
                        verbose_name="Model",
                    ),
                ),
            ],
            options={
                "verbose_name": "config group hosts History",
                "verbose_name_plural": "config group hosts Histories",
                "db_table": "config_management_configgrouphosts_audithistory",
                "managed": True,
            },
            bases=("core.centurionaudit",),
        ),
        migrations.CreateModel(
            name="ConfigGroupsAuditHistory",
            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="config_management.configgroups",
                        verbose_name="Model",
                    ),
                ),
            ],
            options={
                "verbose_name": "Config Group History",
                "verbose_name_plural": "Config Group Histories",
                "db_table": "config_management_configgroups_audithistory",
                "managed": True,
            },
            bases=("core.centurionaudit",),
        ),
        migrations.CreateModel(
            name="ConfigGroupsCenturionModelNote",
            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="config_management.configgroups",
                        verbose_name="Model",
                    ),
                ),
            ],
            options={
                "verbose_name": "Config Group Note",
                "verbose_name_plural": "Config Group Notes",
                "db_table": "config_management_configgroups_centurionmodelnote",
                "managed": True,
            },
            bases=("core.centurionmodelnote",),
        ),
        migrations.CreateModel(
            name="ConfigGroupSoftwareAuditHistory",
            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="config_management.configgroupsoftware",
                        verbose_name="Model",
                    ),
                ),
            ],
            options={
                "verbose_name": "Config Group Software History",
                "verbose_name_plural": "Config Group Software Histories",
                "db_table": "config_management_configgroupsoftware_audithistory",
                "managed": True,
            },
            bases=("core.centurionaudit",),
        ),
    ]
