# Generated by Django 5.0.9 on 2024-11-19 10:51

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('dcim', '0191_module_bay_rebuild'),
        ('extras', '0121_customfield_related_object_filter'),
        ('ipam', '0070_vlangroup_vlan_id_ranges'),
    ]

    operations = [
        migrations.CreateModel(
            name='SoftwareProduct',
            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)),
                ('name', models.CharField(max_length=128)),
                ('comments', models.TextField(blank=True)),
                ('description', models.CharField(blank=True, max_length=255, null=True)),
                ('manufacturer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='dcim.manufacturer')),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SoftwareProductVersion',
            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)),
                ('name', models.CharField(max_length=64)),
                ('comments', models.TextField(blank=True)),
                ('release_date', models.DateField(blank=True, null=True)),
                ('documentation_url', netbox_svm.models.softwareproductversion.LaxURLField(blank=True, max_length=1024, null=True)),
                ('end_of_support', models.DateField(blank=True, null=True)),
                ('filename', models.CharField(blank=True, max_length=64, null=True)),
                ('file_checksum', models.CharField(blank=True, max_length=128, null=True)),
                ('file_link', netbox_svm.models.softwareproductversion.LaxURLField(blank=True, max_length=1024, null=True)),
                ('release_type', models.CharField(default='S', max_length=3)),
                ('software_product', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='netbox_svm.softwareproduct')),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SoftwareProductInstallation',
            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)),
                ('comments', models.TextField(blank=True)),
                ('owner', models.CharField(blank=True, default='', max_length=255, null=True)),
                ('ipaddress', models.ForeignKey(blank=True, default=None, on_delete=django.db.models.deletion.PROTECT, related_name='software_installed', to='ipam.ipaddress')),
                ('software_product', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='netbox_svm.softwareproduct')),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
                ('version', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='netbox_svm.softwareproductversion')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SoftwareLicense',
            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)),
                ('name', models.CharField(max_length=128)),
                ('comments', models.TextField(blank=True)),
                ('description', models.CharField(blank=True, max_length=255, null=True)),
                ('type', models.CharField(max_length=128)),
                ('stored_location', models.CharField(blank=True, max_length=255, null=True)),
                ('stored_location_url', netbox_svm.models.softwarelicense.LaxURLField(blank=True, max_length=1024, null=True)),
                ('start_date', models.DateField(blank=True, null=True)),
                ('expiration_date', models.DateField(blank=True, null=True)),
                ('support', models.BooleanField(blank=True, default=None, null=True)),
                ('license_amount', models.PositiveIntegerField(blank=True, default=None, null=True)),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
                ('software_product', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='netbox_svm.softwareproduct')),
                ('installation', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='netbox_svm.softwareproductinstallation')),
                ('version', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='netbox_svm.softwareproductversion')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
