# Generated by Django 4.2.28 on 2026-02-26 12:41

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


class Migration(migrations.Migration):

    replaces = [
        ("sovtimer", "0001_initial"),
        ("sovtimer", "0002_aasovtimercampaigns_aasovtimerstructures"),
        ("sovtimer", "0003_auto_20201113_1033"),
        ("sovtimer", "0004_auto_20201113_1856"),
        ("sovtimer", "0005_auto_20201114_0720"),
        ("sovtimer", "0006_rename_models"),
        ("sovtimer", "0007_cleanup_models"),
        ("sovtimer", "0008_fix_campaign_attackers_score"),
        ("sovtimer", "0009_alter_campaign_options_and_more"),
        ("sovtimer", "0010_alter_campaign_event_type"),
        ("sovtimer", "0011_alliance_alter_campaign_event_type_and_more"),
    ]

    initial = True

    dependencies = [("eve_sde", "0012_alter_constellation_region")]

    operations = [
        migrations.CreateModel(
            name="AaSovtimer",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
            ],
            options={
                "verbose_name": "Sovereignty Timer",
                "permissions": (
                    ("basic_access", "Can access the Sovereignty Timer module"),
                ),
                "managed": False,
                "default_permissions": (),
            },
        ),
        migrations.CreateModel(
            name="Alliance",
            fields=[
                (
                    "alliance_id",
                    models.PositiveBigIntegerField(
                        db_index=True, primary_key=True, serialize=False, unique=True
                    ),
                ),
                ("name", models.CharField(max_length=255)),
            ],
            options={
                "verbose_name": "Alliance",
                "verbose_name_plural": "Alliances",
                "default_permissions": (),
            },
        ),
        migrations.CreateModel(
            name="SovereigntyStructure",
            fields=[
                (
                    "structure_id",
                    models.PositiveBigIntegerField(
                        db_index=True, primary_key=True, serialize=False, unique=True
                    ),
                ),
                ("structure_type_id", models.PositiveBigIntegerField()),
                ("vulnerability_occupancy_level", models.FloatField(default=1)),
                ("vulnerable_end_time", models.DateTimeField(blank=True, null=True)),
                ("vulnerable_start_time", models.DateTimeField(blank=True, null=True)),
                (
                    "alliance",
                    models.ForeignKey(
                        blank=True,
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="sov_structure_alliance",
                        to="sovtimer.alliance",
                    ),
                ),
                (
                    "solar_system",
                    models.ForeignKey(
                        blank=True,
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="sov_structure_solar_system",
                        to="eve_sde.solarsystem",
                    ),
                ),
            ],
            options={
                "verbose_name": "Sovereignty structure",
                "verbose_name_plural": "Sovereignty structures",
                "default_permissions": (),
            },
        ),
        migrations.CreateModel(
            name="Campaign",
            fields=[
                (
                    "campaign_id",
                    models.PositiveBigIntegerField(
                        db_index=True, primary_key=True, serialize=False, unique=True
                    ),
                ),
                ("attackers_score", models.FloatField(default=0.4)),
                ("defender_score", models.FloatField(default=0.6)),
                (
                    "event_type",
                    models.CharField(
                        choices=[("sovhub", "Sov Hub defense")],
                        default="sovhub",
                        max_length=12,
                    ),
                ),
                ("start_time", models.DateTimeField()),
                ("progress_current", models.FloatField(default=0.6)),
                ("progress_previous", models.FloatField(default=0.6)),
                (
                    "structure",
                    models.OneToOneField(
                        blank=True,
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="sov_capaign_structure",
                        to="sovtimer.sovereigntystructure",
                    ),
                ),
            ],
            options={
                "verbose_name": "Sovereignty campaign",
                "verbose_name_plural": "Sovereignty campaigns",
                "default_permissions": (),
            },
        ),
    ]
