# Generated by Django 5.2.4 on 2025-09-20 01:08

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("core", "0035_clientreport_disable_emails_clientreport_owner_and_more"),
        ("ocpp", "0012_charger_last_error_code_charger_last_status_and_more"),
    ]

    operations = [
        migrations.RemoveConstraint(
            model_name="charger",
            name="charger_connector_unique",
        ),
        migrations.AddConstraint(
            model_name="charger",
            constraint=models.UniqueConstraint(
                condition=models.Q(("connector_id__isnull", False)),
                fields=("charger_id", "connector_id"),
                name="charger_connector_unique",
            ),
        ),
        migrations.AddConstraint(
            model_name="charger",
            constraint=models.UniqueConstraint(
                condition=models.Q(("connector_id__isnull", True)),
                fields=("charger_id",),
                name="charger_unique_without_connector",
            ),
        ),
    ]
