# Generated by Django 4.2.11 on 2024-08-30 14:51

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


class Migration(migrations.Migration):

    dependencies = [
        ("eveuniverse", "0010_alter_eveindustryactivityduration_eve_type_and_more"),
        ("ledger", "0003_alter_characteraudit_options_and_more"),
    ]

    operations = [
        migrations.AddField(
            model_name="characteraudit",
            name="last_update_planetary",
            field=models.DateTimeField(blank=True, default=None, null=True),
        ),
        migrations.CreateModel(
            name="CharacterPlanet",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "upgrade_level",
                    models.IntegerField(
                        default=0, help_text="Upgrade level of the planet"
                    ),
                ),
                (
                    "num_pins",
                    models.IntegerField(
                        default=0, help_text="Number of pins on the planet"
                    ),
                ),
                (
                    "last_update",
                    models.DateTimeField(blank=True, default=None, null=True),
                ),
                (
                    "character",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ledger_characterplanet",
                        to="ledger.characteraudit",
                    ),
                ),
                (
                    "planet",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ledger_planet",
                        to="eveuniverse.eveplanet",
                    ),
                ),
            ],
            options={
                "default_permissions": (),
            },
        ),
        migrations.CreateModel(
            name="CharacterPlanetDetails",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                ("links", models.JSONField(blank=True, default=None, null=True)),
                ("pins", models.JSONField(blank=True, default=None, null=True)),
                ("routes", models.JSONField(blank=True, default=None, null=True)),
                (
                    "last_update",
                    models.DateTimeField(blank=True, default=None, null=True),
                ),
                (
                    "last_alert",
                    models.DateTimeField(blank=True, default=None, null=True),
                ),
                ("notification", models.BooleanField(default=False)),
                ("notification_sent", models.BooleanField(default=False)),
                (
                    "planet",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ledger_characterplanetdetails",
                        to="ledger.characterplanet",
                    ),
                ),
            ],
            options={
                "default_permissions": (),
                "indexes": [
                    models.Index(
                        fields=["planet"], name="ledger_char_planet__6169b9_idx"
                    )
                ],
            },
        ),
        migrations.AddIndex(
            model_name="characterplanet",
            index=models.Index(
                fields=["character"], name="ledger_char_charact_f3af73_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="characterplanet",
            index=models.Index(
                fields=["planet"], name="ledger_char_planet__58a5b6_idx"
            ),
        ),
    ]
