# Generated by Django 5.0.6 on 2024-07-10 21:09

import django.db.models.deletion
import taggit.managers
import utilities.json
from django.db import migrations, models

import netbox_swupdate.utils.keys


class Migration(migrations.Migration):
    dependencies = [
        ("dcim", "0187_alter_device_vc_position"),
        ("extras", "0115_convert_dashboard_widgets"),
        ("netbox_swupdate", "0001_initial"),
    ]

    operations = [
        migrations.AddField(
            model_name="monitoring",
            name="created",
            field=models.DateTimeField(auto_now_add=True, null=True),
        ),
        migrations.AddField(
            model_name="monitoring",
            name="custom_field_data",
            field=models.JSONField(
                blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder
            ),
        ),
        migrations.AddField(
            model_name="monitoring",
            name="last_updated",
            field=models.DateTimeField(auto_now=True, null=True),
        ),
        migrations.AddField(
            model_name="monitoring",
            name="tags",
            field=taggit.managers.TaggableManager(
                through="extras.TaggedItem", to="extras.Tag"
            ),
        ),
        migrations.CreateModel(
            name="FirmwareRequest",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False
                    ),
                ),
                ("created", models.DateTimeField(auto_now_add=True, null=True)),
                ("last_updated", models.DateTimeField(auto_now=True, null=True)),
                (
                    "custom_field_data",
                    models.JSONField(
                        blank=True,
                        default=dict,
                        encoder=utilities.json.CustomFieldJSONEncoder,
                    ),
                ),
                (
                    "firmware_request_id",
                    models.UUIDField(
                        default=netbox_swupdate.utils.keys.generate_uuid,
                        editable=False,
                        unique=True,
                    ),
                ),
                ("deploy_time", models.DateTimeField(blank=True, null=True)),
                ("status", models.CharField(default=0, max_length=50)),
                (
                    "deploy",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="netbox_swupdate.deploy",
                    ),
                ),
                (
                    "device",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE, to="dcim.device"
                    ),
                ),
                (
                    "tags",
                    taggit.managers.TaggableManager(
                        through="extras.TaggedItem", to="extras.Tag"
                    ),
                ),
            ],
            options={
                "ordering": ("pk",),
            },
        ),
    ]
