# Generated by ChatGPT on 2025-10-17
# Django
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("indy_hub", "0030_corporation_assets"),
    ]

    operations = [
        migrations.CreateModel(
            name="CorporationSharingSetting",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("corporation_id", models.BigIntegerField()),
                ("corporation_name", models.CharField(blank=True, max_length=255)),
                (
                    "share_scope",
                    models.CharField(
                        choices=[
                            ("none", "None"),
                            ("corporation", "Corporation"),
                            ("alliance", "Alliance"),
                        ],
                        default="none",
                        max_length=20,
                    ),
                ),
                ("allow_copy_requests", models.BooleanField(default=False)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=models.CASCADE,
                        related_name="indy_corporation_sharing",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={"default_permissions": ()},
        ),
        migrations.AddConstraint(
            model_name="corporationsharingsetting",
            constraint=models.UniqueConstraint(
                fields=("user", "corporation_id"),
                name="corp_sharing_user_corp_uq",
            ),
        ),
        migrations.AddIndex(
            model_name="corporationsharingsetting",
            index=models.Index(
                fields=("user", "corporation_id"),
                name="corp_sharing_user_corp_idx",
            ),
        ),
    ]
