# Generated by Django 5.2.10 on 2026-01-31 02:28

from django.db import migrations


def update_platforms(apps, schema_editor):
    Platform = apps.get_model("nodes", "Platform")

    Platform.objects.filter(
        hardware="Raspberry Pi 4B",
        os_name="Ubuntu",
        os_version="22.04",
    ).update(
        name="Debian 12 on Raspberry Pi 4B",
        os_name="Debian",
        os_version="12",
    )

    Platform.objects.filter(name="Ubuntu 22 on Raspberry Pi 4B").update(
        name="Debian 12 on Raspberry Pi 4B",
        os_name="Debian",
        os_version="12",
        hardware="Raspberry Pi 4B",
        architecture="ARM64",
    )

    Platform.objects.update_or_create(
        hardware="PC",
        architecture="x64",
        os_name="Ubuntu",
        os_version="22.04",
        defaults={
            "name": "Ubuntu 22 x64-based PC",
            "is_seed_data": True,
            "is_deleted": False,
        },
    )


def noop_reverse(apps, schema_editor):
    return None


class Migration(migrations.Migration):

    dependencies = [
        ("nodes", "0021_add_charge_points_feature"),
    ]

    operations = [
        migrations.RunPython(update_platforms, noop_reverse),
    ]
