# Generated by Django 5.2.8 on 2025-11-10 21:53

from django.db import migrations


def purge_net_messages(apps, schema_editor):
    NetMessage = apps.get_model("nodes", "NetMessage")
    PendingNetMessage = apps.get_model("nodes", "PendingNetMessage")

    # Delete pending deliveries first to avoid triggering cascade side-effects
    # that may re-query stale relations while the NetMessage rows disappear.
    PendingNetMessage.objects.all().delete()
    NetMessage.objects.all().delete()


class Migration(migrations.Migration):

    dependencies = [
        ("nodes", "0033_alter_contentclassifier_kind_and_more"),
    ]

    operations = [
        migrations.RunPython(purge_net_messages, migrations.RunPython.noop),
    ]
