# Generated by ChatGPT on 2026-02-07

# Django
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("indy_hub", "0080_industry_skill_snapshot"),
    ]

    operations = [
        migrations.CreateModel(
            name="CharacterRoles",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("character_id", models.BigIntegerField(unique=True)),
                ("corporation_id", models.BigIntegerField(blank=True, null=True)),
                ("roles", models.JSONField(blank=True, default=list)),
                ("roles_at_hq", models.JSONField(blank=True, default=list)),
                ("roles_at_base", models.JSONField(blank=True, default=list)),
                ("roles_at_other", models.JSONField(blank=True, default=list)),
                ("last_updated", models.DateTimeField(auto_now=True)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                (
                    "owner_user",
                    models.ForeignKey(
                        on_delete=models.deletion.CASCADE,
                        related_name="character_roles",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "Character Roles",
                "verbose_name_plural": "Character Roles",
                "default_permissions": (),
                "indexes": [
                    models.Index(
                        fields=["owner_user", "character_id"],
                        name="indy_hub_roles_user_char_idx",
                    ),
                    models.Index(
                        fields=["corporation_id"],
                        name="indy_hub_roles_corp_idx",
                    ),
                    models.Index(
                        fields=["last_updated"],
                        name="indy_hub_roles_updated_idx",
                    ),
                ],
            },
        ),
    ]
