# Generated by Django 4.2.20 on 2025-05-05 05:25

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


class Migration(migrations.Migration):

    dependencies = [
        ("ledger", "0008_alter_characterminingledger_date"),
    ]

    operations = [
        migrations.RemoveField(
            model_name="characteraudit",
            name="last_update_mining",
        ),
        migrations.RemoveField(
            model_name="characteraudit",
            name="last_update_planetary",
        ),
        migrations.RemoveField(
            model_name="characteraudit",
            name="last_update_wallet",
        ),
        migrations.RemoveField(
            model_name="characterplanet",
            name="last_update",
        ),
        migrations.RemoveField(
            model_name="characterplanetdetails",
            name="last_update",
        ),
        migrations.AddField(
            model_name="characterplanetdetails",
            name="character",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="ledger_character_planet_details",
                to="ledger.characteraudit",
            ),
        ),
        migrations.AlterField(
            model_name="characteraudit",
            name="active",
            field=models.BooleanField(default=True),
        ),
        migrations.AlterField(
            model_name="characterminingledger",
            name="character",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="ledger_character_mining",
                to="ledger.characteraudit",
            ),
        ),
        migrations.AlterField(
            model_name="characterplanet",
            name="character",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="ledger_character_planet",
                to="ledger.characteraudit",
            ),
        ),
        migrations.AlterField(
            model_name="characterplanetdetails",
            name="planet",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="ledger_planet_details",
                to="ledger.characterplanet",
            ),
        ),
        migrations.AlterField(
            model_name="characterwalletjournalentry",
            name="character",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="ledger_character_journal",
                to="ledger.characteraudit",
            ),
        ),
        migrations.CreateModel(
            name="CharacterUpdateStatus",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "section",
                    models.CharField(
                        choices=[
                            ("wallet_journal", "Wallet Journal"),
                            ("mining_ledger", "Mining Ledger"),
                            ("planets", "Planets"),
                            ("planets_details", "Planets Details"),
                        ],
                        db_index=True,
                        max_length=32,
                    ),
                ),
                (
                    "is_success",
                    models.BooleanField(db_index=True, default=None, null=True),
                ),
                ("error_message", models.TextField()),
                ("has_token_error", models.BooleanField(default=False)),
                (
                    "last_run_at",
                    models.DateTimeField(
                        db_index=True,
                        default=None,
                        help_text="Last run has been started at this time",
                        null=True,
                    ),
                ),
                (
                    "last_run_finished_at",
                    models.DateTimeField(
                        db_index=True,
                        default=None,
                        help_text="Last run has been successful finished at this time",
                        null=True,
                    ),
                ),
                (
                    "last_update_at",
                    models.DateTimeField(
                        db_index=True,
                        default=None,
                        help_text="Last update has been started at this time",
                        null=True,
                    ),
                ),
                (
                    "last_update_finished_at",
                    models.DateTimeField(
                        db_index=True,
                        default=None,
                        help_text="Last update has been successful finished at this time",
                        null=True,
                    ),
                ),
                (
                    "character",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ledger_update_status",
                        to="ledger.characteraudit",
                    ),
                ),
            ],
            options={
                "default_permissions": (),
            },
        ),
        migrations.RenameField(
            model_name="corporationwalletdivision",
            old_name="division",
            new_name="division_id",
        ),
        migrations.RemoveField(
            model_name="corporationaudit",
            name="last_update_wallet",
        ),
        migrations.AddField(
            model_name="corporationaudit",
            name="active",
            field=models.BooleanField(default=True),
        ),
        migrations.CreateModel(
            name="CorporationUpdateStatus",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "section",
                    models.CharField(
                        choices=[
                            ("wallet_division", "Divisions"),
                            ("wallet_journal", "Wallet Journal"),
                        ],
                        db_index=True,
                        max_length=32,
                    ),
                ),
                (
                    "is_success",
                    models.BooleanField(db_index=True, default=None, null=True),
                ),
                ("error_message", models.TextField()),
                ("has_token_error", models.BooleanField(default=False)),
                (
                    "last_run_at",
                    models.DateTimeField(
                        db_index=True,
                        default=None,
                        help_text="Last run has been started at this time",
                        null=True,
                    ),
                ),
                (
                    "last_run_finished_at",
                    models.DateTimeField(
                        db_index=True,
                        default=None,
                        help_text="Last run has been successful finished at this time",
                        null=True,
                    ),
                ),
                (
                    "last_update_at",
                    models.DateTimeField(
                        db_index=True,
                        default=None,
                        help_text="Last update has been started at this time",
                        null=True,
                    ),
                ),
                (
                    "last_update_finished_at",
                    models.DateTimeField(
                        db_index=True,
                        default=None,
                        help_text="Last update has been successful finished at this time",
                        null=True,
                    ),
                ),
                (
                    "corporation",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ledger_corporation_update_status",
                        to="ledger.corporationaudit",
                    ),
                ),
            ],
            options={
                "default_permissions": (),
            },
        ),
    ]
