# Generated by Django 3.2.18 on 2023-03-07 16:02

import uuid

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):
    dependencies = [
        ("dcim", "0040_remove_region_and_site"),
        ("virtualization", "0018_related_name_changes"),
        ("ipam", "0023_delete_aggregate"),
    ]

    operations = [
        migrations.CreateModel(
            name="IPAddressToInterface",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True
                    ),
                ),
                ("is_source", models.BooleanField(default=False)),
                ("is_destination", models.BooleanField(default=False)),
                ("is_default", models.BooleanField(default=False)),
                ("is_preferred", models.BooleanField(default=False)),
                ("is_primary", models.BooleanField(default=False)),
                ("is_secondary", models.BooleanField(default=False)),
                ("is_standby", models.BooleanField(default=False)),
                (
                    "interface",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ip_address_assignments",
                        to="dcim.interface",
                    ),
                ),
                (
                    "ip_address",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE, related_name="+", to="ipam.ipaddress"
                    ),
                ),
                (
                    "vm_interface",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ip_address_assignments",
                        to="virtualization.vminterface",
                    ),
                ),
            ],
            options={
                "abstract": False,
                "verbose_name": "IP Address Assignment",
                "verbose_name_plural": "IP Address Assignments",
            },
        ),
    ]
