# Generated by Django 4.0.10 on 2023-09-28 12:03

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("memberaudit", "0011_add_standings_index"),
    ]

    operations = [
        migrations.AddField(
            model_name="character",
            name="token_error_notified_at",
            field=models.DateTimeField(
                default=None,
                help_text="Time when user was last notified about a token error.",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="characterupdatestatus",
            name="has_token_error",
            field=models.BooleanField(
                default=False, help_text="Whether this section has a token error."
            ),
        ),
        migrations.AlterField(
            model_name="characterupdatestatus",
            name="section",
            field=models.CharField(
                choices=[
                    ("assets", "assets"),
                    ("attributes", "attributes"),
                    ("character_details", "character details"),
                    ("contacts", "contacts"),
                    ("contracts", "contracts"),
                    ("corporation_history", "corporation history"),
                    ("fw_stats", "faction warfare statistics"),
                    ("implants", "implants"),
                    ("jump_clones", "jump clones"),
                    ("location", "location"),
                    ("loyalty", "loyalty"),
                    ("mails", "mails"),
                    ("mining_ledger", "mining ledger"),
                    ("online_status", "online status"),
                    ("planets", "planets"),
                    ("roles", "roles"),
                    ("ship", "ship"),
                    ("skills", "skills"),
                    ("skill_queue", "skill queue"),
                    ("skill_sets", "skill sets"),
                    ("standings", "standings"),
                    ("wallet_balance", "wallet balance"),
                    ("wallet_journal", "wallet journal"),
                    ("wallet_transactions", "wallet transactions"),
                ],
                db_index=True,
                max_length=64,
            ),
        ),
        migrations.CreateModel(
            name="CharacterRole",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "location",
                    models.CharField(
                        choices=[
                            ("BS", "base"),
                            ("HQ", "headquarters"),
                            ("OT", "other"),
                            ("UV", "universal"),
                        ],
                        help_text="Location where this role is applicable.",
                        max_length=2,
                    ),
                ),
                (
                    "role",
                    models.CharField(
                        choices=[
                            ("AT1", "account take 1"),
                            ("AT2", "account take 2"),
                            ("AT3", "account take 3"),
                            ("AT4", "account take 4"),
                            ("AT5", "account take 5"),
                            ("AT6", "account take 6"),
                            ("AT7", "account take 7"),
                            ("ACT", "accountant"),
                            ("AUD", "auditor"),
                            ("COM", "communications officer"),
                            ("CEQ", "config equipment"),
                            ("CSE", "config starbase equipment"),
                            ("CT1", "container take 1"),
                            ("CT2", "container take 2"),
                            ("CT3", "container take 3"),
                            ("CT4", "container take 4"),
                            ("CT5", "container take 5"),
                            ("CT6", "container take 6"),
                            ("CT7", "container take 7"),
                            ("CMG", "contract manager"),
                            ("DPL", "diplomat"),
                            ("DRT", "director"),
                            ("FCM", "factory manager"),
                            ("FTM", "fitting manager"),
                            ("HQ1", "hangar query 1"),
                            ("HQ2", "hangar query 2"),
                            ("HQ3", "hangar query 3"),
                            ("HQ4", "hangar query 4"),
                            ("HQ5", "hangar query 5"),
                            ("HQ6", "hangar query 6"),
                            ("HQ7", "hangar query 7"),
                            ("HT1", "hangar take 1"),
                            ("HT2", "hangar take 2"),
                            ("HT3", "hangar take 3"),
                            ("HT4", "hangar take 4"),
                            ("HT5", "hangar take 5"),
                            ("HT6", "hangar take 6"),
                            ("HT7", "hangar take 7"),
                            ("JAC", "junior accountant"),
                            ("PSM", "personnel manager"),
                            ("RFF", "rent factory facility"),
                            ("RFC", "rent office"),
                            ("RRF", "rent research facility"),
                            ("SCO", "security officer"),
                            ("SPM", "skill plan manager"),
                            ("SDO", "starbase defense operator"),
                            ("SFT", "starbase fuel technician"),
                            ("STM", "station manager"),
                            ("TRD", "trader"),
                        ],
                        help_text="Role of a character",
                        max_length=3,
                    ),
                ),
                (
                    "character",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="roles",
                        related_query_name="role",
                        to="memberaudit.character",
                    ),
                ),
            ],
            options={
                "default_permissions": (),
            },
        ),
        migrations.AddConstraint(
            model_name="characterrole",
            constraint=models.UniqueConstraint(
                fields=("character", "location", "role"),
                name="functional_pk_characterrole",
            ),
        ),
    ]
