# Generated by Django 5.0.6 on 2024-10-02 07:46

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


class Migration(migrations.Migration):

    dependencies = [
        ('dcim', '0187_alter_device_vc_position'),
        ('extras', '0115_convert_dashboard_widgets'),
        ('ipam', '0069_gfk_indexes'),
        ('netbox_svm', '0009_remove_softwareproductinstallation_netbox_slm_softwareproductinstallation_platform_and_more'),
        ('virtualization', '0038_virtualdisk'),
    ]

    operations = [
        migrations.RemoveConstraint(
            model_name='softwareproductinstallation',
            name='netbox_svm_softwareproductinstallation_resource',
        ),
        migrations.AddField(
            model_name='softwareproductinstallation',
            name='ipaddress',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='ipam.ipaddress'),
        ),
        migrations.AlterField(
            model_name='softwarelicense',
            name='stored_location_url',
            field=netbox_svm.models.softwarelicense.LaxURLField(blank=True, max_length=1024, null=True),
        ),
        migrations.AddConstraint(
            model_name='softwareproductinstallation',
            constraint=models.CheckConstraint(check=models.Q(models.Q(('cluster__isnull', True), ('device__isnull', False), ('ipaddress__isnull', True), ('virtualmachine__isnull', True)), models.Q(('cluster__isnull', True), ('device__isnull', True), ('ipaddress__isnull', True), ('virtualmachine__isnull', False)), models.Q(('cluster__isnull', False), ('device__isnull', True), ('ipaddress__isnull', True), ('virtualmachine__isnull', True)), models.Q(('cluster__isnull', True), ('device__isnull', True), ('ipaddress__isnull', False), ('virtualmachine__isnull', True)), _connector='OR'), name='netbox_svm_softwareproductinstallation_resource', violation_error_message='Installation requires exactly one resource destination.'),
        ),
    ]
