# Generated by Django 4.0.4 on 2022-04-26 03:27

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

class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('tenancy', '0010_tenant_relax_uniqueness'),
        ('extras', '0073_journalentry_tags_custom_fields'),
        ('dcim', '0153_created_datetimefield'),
        ('virtualization', '0029_created_datetimefield'),
        ('ipam', '0057_created_datetimefield'),
    ]

    operations = [
        migrations.CreateModel(
            name='NASCluster',
            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=100, unique=True)),
                ('description', models.CharField(blank=True, max_length=500)),
                ('comments', models.TextField(blank=True)),
                ('devices', models.ManyToManyField(blank=True, related_name='devices', to='dcim.device')),
                ('tags', taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='extras.TaggedItem', to='extras.Tag', verbose_name='Tags')),
                ('access_ips', models.ManyToManyField(blank=True, related_name='nas_cluster_access_ips', to='ipam.ipaddress')),
                ('tenant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='nas_clusters', to='tenancy.tenant')),
            ],
            options={
                'ordering': ('name',),
            },
        ),
        migrations.CreateModel(
            name='NASVolume',
            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)),
                ('size_gb', models.PositiveIntegerField()),
                ('local_directory', models.CharField(max_length=200)),
                ('description', models.CharField(blank=True, max_length=500)),
                ('comments', models.TextField(blank=True)),
                ('nas_cluster', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='volumes', to='netbox_nas.nascluster')),
                ('tags', taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='extras.TaggedItem', to='extras.Tag', verbose_name='Tags')),
                ('base_unix_permissions', models.CharField(default='2770', max_length=100)),
                ('security_style', models.CharField(default='unix', max_length=30)),
                ('group', models.CharField(max_length=100)),
                ('owner', models.CharField(max_length=100)),
                ('name', models.CharField(max_length=100)),
                ('export_id', models.PositiveIntegerField()),
                ('tenant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='nas_volumes', to='tenancy.tenant')),
            ],
            options={
                'ordering': ('nas_cluster', 'local_directory'),
                'unique_together': {('nas_cluster', 'local_directory'), ('nas_cluster', 'export_id')},
            },
        ),
        migrations.CreateModel(
            name='NASShare',
            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=50)),
                ('type', models.CharField(max_length=30)),
                ('description', models.CharField(blank=True, max_length=500)),
                ('comments', models.TextField(blank=True)),
                ('nas_volume', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='shares', to='netbox_nas.nasvolume')),
                ('tags', taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='extras.TaggedItem', to='extras.Tag', verbose_name='Tags')),
                ('mount_options', models.CharField(blank=True, max_length=100)),
                ('volume_subdirectory', models.CharField(default='/', max_length=200)),
                ('access_level', models.CharField(default='rw', max_length=30)),
                ('access_prefixes', models.ManyToManyField(blank=True, related_name='nas_share_access_prefixes', to='ipam.prefix')),
                ('access_ips', models.ManyToManyField(blank=True, related_name='nas_share_access_ips', to='ipam.ipaddress')),
                ('tenant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='nas_shares', to='tenancy.tenant')),
            ],
            options={
                'ordering': ('nas_volume', 'name'),
                'unique_together': {('nas_volume', 'name')},
            },
        ),
        migrations.CreateModel(
            name='NASMount',
            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)),
                ('local_directory', models.CharField(max_length=200)),
                ('description', models.CharField(blank=True, max_length=500)),
                ('comments', models.TextField(blank=True)),
                ('devices', models.ManyToManyField(blank=True, related_name='nas_mount_devices', to='dcim.device')),
                ('nas_share', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='mounts', to='netbox_nas.nasshare')),
                ('tags', taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='extras.TaggedItem', to='extras.Tag', verbose_name='Tags')),
                ('virtual_machines', models.ManyToManyField(blank=True, related_name='nas_mount_virtual_machines', to='virtualization.virtualmachine')),
                ('mount_options', models.CharField(blank=True, max_length=100)),
                ('tenant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='nas_mounts', to='tenancy.tenant')),
            ],
            options={
                'ordering': ('nas_share', 'local_directory'),
                'unique_together': {('nas_share', 'local_directory')},
            },
        ),
    ]
