# Generated by Django 4.2.11 on 2024-08-20 16:13

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("authentication", "0023_alter_userprofile_language"),
        ("eveuniverse", "0010_alter_eveindustryactivityduration_eve_type_and_more"),
        ("eveonline", "0017_alliance_and_corp_names_are_not_unique"),
    ]

    operations = [
        migrations.CreateModel(
            name="General",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
            ],
            options={
                "permissions": (
                    ("basic_access", "Can access this app"),
                    ("add_personal_owner", "Can add personal owners"),
                    ("add_corporate_owner", "Can add corporate owners"),
                    ("manage_requests", "Can manage requests"),
                ),
                "managed": False,
                "default_permissions": (),
            },
        ),
        migrations.CreateModel(
            name="Request",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("order", models.JSONField(help_text="Order details")),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("OP", "Open"),
                            ("IP", "In Progress"),
                            ("CD", "Completed"),
                            ("CL", "Cancelled"),
                        ],
                        db_index=True,
                        help_text="Status of the Order request",
                        max_length=2,
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                (
                    "closed_at",
                    models.DateTimeField(blank=True, db_index=True, null=True),
                ),
                (
                    "approver_user",
                    models.ForeignKey(
                        blank=True,
                        help_text="The user that manage the request",
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "requesting_user",
                    models.ForeignKey(
                        help_text="The requesting user",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "default_permissions": (),
            },
        ),
        migrations.CreateModel(
            name="Owner",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "is_active",
                    models.BooleanField(
                        default=True,
                        help_text="whether this owner is currently included in the sync process",
                    ),
                ),
                ("last_update", models.DateTimeField(auto_now=True)),
                (
                    "character",
                    models.ForeignKey(
                        blank=True,
                        default=None,
                        help_text="character used for syncing",
                        null=True,
                        on_delete=django.db.models.deletion.SET_DEFAULT,
                        related_name="+",
                        to="authentication.characterownership",
                    ),
                ),
                (
                    "corporation",
                    models.OneToOneField(
                        blank=True,
                        default=None,
                        help_text="Corporation used for syncing",
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="eveonline.evecorporationinfo",
                    ),
                ),
            ],
            options={
                "default_permissions": (),
            },
        ),
        migrations.CreateModel(
            name="Location",
            fields=[
                (
                    "id",
                    models.PositiveBigIntegerField(
                        help_text="Eve Online location ID, either item ID for stations or structure ID for structures",
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        help_text="In-game name of this station or structure",
                        max_length=100,
                    ),
                ),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "eve_solar_system",
                    models.ForeignKey(
                        blank=True,
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.SET_DEFAULT,
                        related_name="+",
                        to="eveuniverse.evesolarsystem",
                    ),
                ),
                (
                    "eve_type",
                    models.ForeignKey(
                        blank=True,
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.SET_DEFAULT,
                        related_name="+",
                        to="eveuniverse.evetype",
                    ),
                ),
                (
                    "owner",
                    models.ForeignKey(
                        blank=True,
                        default=None,
                        help_text="corporation this station or structure belongs to",
                        null=True,
                        on_delete=django.db.models.deletion.SET_DEFAULT,
                        related_name="+",
                        to="eveuniverse.eveentity",
                    ),
                ),
                (
                    "parent",
                    models.ForeignKey(
                        blank=True,
                        default=None,
                        help_text="Eve Online location ID of the parent object",
                        null=True,
                        on_delete=django.db.models.deletion.SET_DEFAULT,
                        related_name="+",
                        to="assets.location",
                    ),
                ),
            ],
            options={
                "default_permissions": (),
            },
        ),
        migrations.CreateModel(
            name="Assets",
            fields=[
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                (
                    "item_id",
                    models.PositiveBigIntegerField(
                        help_text="The EVE Item ID of the asset"
                    ),
                ),
                (
                    "location_flag",
                    models.CharField(
                        choices=[
                            ("AssetSafety", "Asset Safety"),
                            ("AutoFit", "Auto Fit"),
                            ("Bonus", "Bonus"),
                            ("Booster", "Booster"),
                            ("BoosterBay", "Booster Hold"),
                            ("Capsule", "Capsule"),
                            ("Cargo", "Cargo"),
                            ("CorpDeliveries", "Corp Deliveries"),
                            ("CorpSAG1", "Corp Security Access Group 1"),
                            ("CorpSAG2", "Corp Security Access Group 2"),
                            ("CorpSAG3", "Corp Security Access Group 3"),
                            ("CorpSAG4", "Corp Security Access Group 4"),
                            ("CorpSAG5", "Corp Security Access Group 5"),
                            ("CorpSAG6", "Corp Security Access Group 6"),
                            ("CorpSAG7", "Corp Security Access Group 7"),
                            ("CrateLoot", "Crate Loot"),
                            ("Deliveries", "Deliveries"),
                            ("DroneBay", "Drone Bay"),
                            ("DustBattle", "Dust Battle"),
                            ("DustDatabank", "Dust Databank"),
                            ("FighterBay", "Fighter Bay"),
                            ("FighterTube0", "Fighter Tube 0"),
                            ("FighterTube1", "Fighter Tube 1"),
                            ("FighterTube2", "Fighter Tube 2"),
                            ("FighterTube3", "Fighter Tube 3"),
                            ("FighterTube4", "Fighter Tube 4"),
                            ("FleetHangar", "Fleet Hangar"),
                            ("FrigateEscapeBay", "Frigate escape bay Hangar"),
                            ("Hangar", "Hangar"),
                            ("HangarAll", "Hangar All"),
                            ("HiSlot0", "High power slot 1"),
                            ("HiSlot1", "High power slot 2"),
                            ("HiSlot2", "High power slot 3"),
                            ("HiSlot3", "High power slot 4"),
                            ("HiSlot4", "High power slot 5"),
                            ("HiSlot5", "High power slot 6"),
                            ("HiSlot6", "High power slot 7"),
                            ("HiSlot7", "High power slot 8"),
                            ("HiddenModifiers", "Hidden Modifiers"),
                            ("Implant", "Implant"),
                            ("Impounded", "Impounded"),
                            (
                                "JunkyardReprocessed",
                                "This item was put into a junkyard through reprocessing.",
                            ),
                            (
                                "JunkyardTrashed",
                                "This item was put into a junkyard through being trashed by its owner.",
                            ),
                            ("LoSlot0", "Low power slot 1"),
                            ("LoSlot1", "Low power slot 2"),
                            ("LoSlot2", "Low power slot 3"),
                            ("LoSlot3", "Low power slot 4"),
                            ("LoSlot4", "Low power slot 5"),
                            ("LoSlot5", "Low power slot 6"),
                            ("LoSlot6", "Low power slot 7"),
                            ("LoSlot7", "Low power slot 8"),
                            ("Locked", "Locked item, can not be moved unless unlocked"),
                            ("MedSlot0", "Medium power slot 1"),
                            ("MedSlot1", "Medium power slot 2"),
                            ("MedSlot2", "Medium power slot 3"),
                            ("MedSlot3", "Medium power slot 4"),
                            ("MedSlot4", "Medium power slot 5"),
                            ("MedSlot5", "Medium power slot 6"),
                            ("MedSlot6", "Medium power slot 7"),
                            ("MedSlot7", "Medium power slot 8"),
                            ("OfficeFolder", "Office Folder"),
                            ("Pilot", "Pilot"),
                            ("PlanetSurface", "Planet Surface"),
                            ("QuafeBay", "Quafe Bay"),
                            ("QuantumCoreRoom", "Quantum Core Room"),
                            ("Reward", "Reward"),
                            ("RigSlot0", "Rig power slot 1"),
                            ("RigSlot1", "Rig power slot 2"),
                            ("RigSlot2", "Rig power slot 3"),
                            ("RigSlot3", "Rig power slot 4"),
                            ("RigSlot4", "Rig power slot 5"),
                            ("RigSlot5", "Rig power slot 6"),
                            ("RigSlot6", "Rig power slot 7"),
                            ("RigSlot7", "Rig power slot 8"),
                            ("SecondaryStorage", "Secondary Storage"),
                            ("ServiceSlot0", "Service Slot 0"),
                            ("ServiceSlot1", "Service Slot 1"),
                            ("ServiceSlot2", "Service Slot 2"),
                            ("ServiceSlot3", "Service Slot 3"),
                            ("ServiceSlot4", "Service Slot 4"),
                            ("ServiceSlot5", "Service Slot 5"),
                            ("ServiceSlot6", "Service Slot 6"),
                            ("ServiceSlot7", "Service Slot 7"),
                            ("ShipHangar", "Ship Hangar"),
                            ("ShipOffline", "Ship Offline"),
                            ("Skill", "Skill"),
                            ("SkillInTraining", "Skill In Training"),
                            ("SpecializedAmmoHold", "Specialized Ammo Hold"),
                            (
                                "SpecializedCommandCenterHold",
                                "Specialized Command Center Hold",
                            ),
                            ("SpecializedFuelBay", "Specialized Fuel Bay"),
                            ("SpecializedGasHold", "Specialized Gas Hold"),
                            (
                                "SpecializedIndustrialShipHold",
                                "Specialized Industrial Ship Hold",
                            ),
                            ("SpecializedLargeShipHold", "Specialized Large Ship Hold"),
                            ("SpecializedMaterialBay", "Specialized Material Bay"),
                            (
                                "SpecializedMediumShipHold",
                                "Specialized Medium Ship Hold",
                            ),
                            ("SpecializedMineralHold", "Specialized Mineral Hold"),
                            ("SpecializedOreHold", "Specialized Ore Hold"),
                            (
                                "SpecializedPlanetaryCommoditiesHold",
                                "Specialized Planetary Commodities Hold",
                            ),
                            ("SpecializedSalvageHold", "Specialized Salvage Hold"),
                            ("SpecializedShipHold", "Specialized Ship Hold"),
                            ("SpecializedSmallShipHold", "Specialized Small Ship Hold"),
                            ("StructureActive", "Structure Active"),
                            ("StructureFuel", "Structure Fuel"),
                            ("StructureInactive", "Structure Inactive"),
                            ("StructureOffline", "Structure Offline"),
                            ("SubSystemBay", "Sub System Bay"),
                            ("SubSystemSlot0", "Sub System Slot 0"),
                            ("SubSystemSlot1", "Sub System Slot 1"),
                            ("SubSystemSlot2", "Sub System Slot 2"),
                            ("SubSystemSlot3", "Sub System Slot 3"),
                            ("SubSystemSlot4", "Sub System Slot 4"),
                            ("SubSystemSlot5", "Sub System Slot 5"),
                            ("SubSystemSlot6", "Sub System Slot 6"),
                            ("SubSystemSlot7", "Sub System Slot 7"),
                            ("Unlocked", "Unlocked item, can be moved"),
                            ("Wallet", "Wallet"),
                            ("Wardrobe", "Wardrobe"),
                            ("Undefined", "undefined"),
                        ],
                        help_text="Additional location information",
                        max_length=36,
                    ),
                ),
                (
                    "location_type",
                    models.CharField(help_text="location type", max_length=100),
                ),
                (
                    "quantity",
                    models.PositiveIntegerField(
                        default=1, help_text="Number of assets"
                    ),
                ),
                ("singleton", models.BooleanField(help_text="Singleton")),
                (
                    "blueprint_copy",
                    models.BooleanField(
                        default=None, help_text="Blueprint Copy", null=True
                    ),
                ),
                ("price", models.FloatField(default=None, null=True)),
                (
                    "eve_type",
                    models.ForeignKey(
                        help_text="asset type",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="eveuniverse.evetype",
                    ),
                ),
                (
                    "location",
                    models.ForeignKey(
                        help_text="asset location",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="assets",
                        to="assets.location",
                    ),
                ),
                (
                    "owner",
                    models.ForeignKey(
                        help_text="Corporation that owns the asset",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="assets",
                        to="assets.owner",
                    ),
                ),
            ],
            options={
                "default_permissions": (),
                "indexes": [
                    models.Index(
                        fields=["location_id"], name="assets_asse_locatio_3b2423_idx"
                    ),
                    models.Index(
                        fields=["item_id"], name="assets_asse_item_id_db6c43_idx"
                    ),
                ],
            },
        ),
    ]
