# Generated by Django 4.2.1 on 2023-11-26 14:43

from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("mesh", "0011_meshnode_address_validate"),
    ]

    operations = [
        migrations.AddField(
            model_name="otaupdaterecipient",
            name="status",
            field=models.CharField(
                choices=[
                    ("running", "running"),
                    ("replaced", "replaced"),
                    ("canceled", "canceled"),
                    ("failed", "failed"),
                    ("success", "success"),
                ],
                default="running",
                max_length=10,
                verbose_name="status",
            ),
        ),
        migrations.AlterField(
            model_name="nodemessage",
            name="message_type",
            field=models.CharField(
                choices=[
                    ("NOOP", "noop"),
                    ("ECHO_REQUEST", "echo request"),
                    ("ECHO_RESPONSE", "echo response"),
                    ("MESH_SIGNIN", "mesh signin"),
                    ("MESH_LAYER_ANNOUNCE", "mesh layer announce"),
                    ("MESH_ADD_DESTINATIONS", "mesh add destinations"),
                    ("MESH_REMOVE_DESTINATIONS", "mesh remove destinations"),
                    ("MESH_ROUTE_REQUEST", "mesh route request"),
                    ("MESH_ROUTE_RESPONSE", "mesh route response"),
                    ("MESH_ROUTE_TRACE", "mesh route trace"),
                    ("MESH_ROUTING_FAILED", "mesh routing failed"),
                    ("CONFIG_DUMP", "dump config"),
                    ("CONFIG_HARDWARE", "hardware config"),
                    ("CONFIG_BOARD", "board config"),
                    ("CONFIG_FIRMWARE", "firmware config"),
                    ("CONFIG_UPLINK", "uplink config"),
                    ("CONFIG_POSITION", "position config"),
                    ("OTA_STATUS", "ota status"),
                    ("OTA_REQUEST_STATUS", "ota request status"),
                    ("OTA_START", "ota start"),
                    ("OTA_URL", "ota url"),
                    ("OTA_FRAGMENT", "ota fragment"),
                    ("OTA_REQUEST_FRAGMENTS", "ota request fragments"),
                    ("OTA_SETTING", "ota setting"),
                    ("OTA_APPLY", "ota apply"),
                    ("OTA_ABORT", "ota abort"),
                    ("LOCATE_REQUEST_RANGE", "locate request range"),
                    ("LOCATE_RANGE_RESULTS", "locate range results"),
                    ("LOCATE_RAW_FTM_RESULTS", "locate raw ftm results"),
                    ("REBOOT", "reboot"),
                    ("REPORT_ERROR", "report error"),
                ],
                db_index=True,
                max_length=24,
                verbose_name="message type",
            ),
        ),
        migrations.AddConstraint(
            model_name="otaupdaterecipient",
            constraint=models.UniqueConstraint(
                condition=models.Q(("status", "running")),
                fields=("node",),
                name="only_one_active_ota",
            ),
        ),
    ]
