# Generated by Django 5.2.2 on 2025-06-04 14:38

from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [
        ("models", "11954_add_related_names_for_draft_entities"),
    ]

    def set_active_true(apps, schema_editor):
        GraphModel = apps.get_model("models", "GraphModel")
        # Select published graphs without any draft graphs.
        GraphModel.objects.filter(
            draft=None,
            publication__isnull=False,
        ).update(is_active=True)

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