# Generated by Django 5.1.9 on 2025-06-13 06:05

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


class Migration(migrations.Migration):

    dependencies = [
        ("access", "0016_remove_tenant_slug_alter_tenant_manager_and_more"),
        ("core", "0033_alter_ticketcommentcategory_parent_and_more"),
        ("project_management", "0006_alter_project_organization_and_more"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.RemoveField(
            model_name="project",
            name="is_global",
        ),
        migrations.RemoveField(
            model_name="project",
            name="slug",
        ),
        migrations.AlterField(
            model_name="project",
            name="description",
            field=models.TextField(
                blank=True,
                help_text="Outline of this Project",
                null=True,
                verbose_name="Description",
            ),
        ),
        migrations.AlterField(
            model_name="project",
            name="external_ref",
            field=models.IntegerField(
                blank=True,
                help_text="External System reference",
                null=True,
                verbose_name="Reference Number",
            ),
        ),
        migrations.AlterField(
            model_name="project",
            name="external_system",
            field=models.IntegerField(
                blank=True,
                choices=[
                    (1, "Github"),
                    (2, "Gitlab"),
                    (9999, "Custom #1 (Imported)"),
                    (9998, "Custom #2 (Imported)"),
                    (9997, "Custom #3 (Imported)"),
                    (9996, "Custom #4 (Imported)"),
                    (9995, "Custom #5 (Imported)"),
                    (9994, "Custom #6 (Imported)"),
                    (9993, "Custom #7 (Imported)"),
                    (9992, "Custom #8 (Imported)"),
                    (9991, "Custom #9 (Imported)"),
                ],
                help_text="External system this item derives",
                null=True,
                verbose_name="External System",
            ),
        ),
        migrations.AlterField(
            model_name="project",
            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="project",
            name="manager_team",
            field=models.ForeignKey(
                blank=True,
                help_text="Team which contains the Project Managers",
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="access.team",
                verbose_name="Project Manager Team",
            ),
        ),
        migrations.AlterField(
            model_name="project",
            name="manager_user",
            field=models.ForeignKey(
                blank=True,
                help_text="User who is the Project Manager",
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="manager_user",
                to=settings.AUTH_USER_MODEL,
                verbose_name="Manager",
            ),
        ),
        migrations.AlterField(
            model_name="project",
            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="project",
            name="project_type",
            field=models.ForeignKey(
                blank=True,
                help_text="Type of project",
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="project_management.projecttype",
                verbose_name="Project Type",
            ),
        ),
        migrations.AlterField(
            model_name="project",
            name="state",
            field=models.ForeignKey(
                blank=True,
                help_text="State of the project",
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="project_management.projectstate",
                verbose_name="Project State",
            ),
        ),
        migrations.CreateModel(
            name="ProjectAuditHistory",
            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.project",
                        verbose_name="Model",
                    ),
                ),
            ],
            options={
                "verbose_name": "Project History",
                "verbose_name_plural": "Project Histories",
                "db_table": "project_management_project_audithistory",
                "managed": True,
            },
            bases=("core.centurionaudit",),
        ),
        migrations.CreateModel(
            name="ProjectCenturionModelNote",
            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.project",
                        verbose_name="Model",
                    ),
                ),
            ],
            options={
                "verbose_name": "Project Note",
                "verbose_name_plural": "Project Notes",
                "db_table": "project_management_project_centurionmodelnote",
                "managed": True,
            },
            bases=("core.centurionmodelnote",),
        ),
    ]
