# Generated by Django 4.1.7 on 2023-04-18 20:30

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('extras', '0084_staging'),
        ('ipam', '0064_clear_search_cache'),
        ('contenttypes', '0002_remove_content_type_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='TunnelType',
            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)),
                ('description', models.CharField(blank=True, max_length=200)),
                ('name', models.CharField(max_length=100, unique=True)),
                ('slug', models.SlugField(max_length=100, unique=True)),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Tunnel',
            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)),
                ('status', models.CharField(default='pending-config', max_length=30)),
                ('side_a_assigned_object_id', models.PositiveBigIntegerField(blank=True, null=True)),
                ('side_b_assigned_object_id', models.PositiveBigIntegerField(blank=True, null=True)),
                ('description', models.CharField(blank=True, max_length=200)),
                ('psk', models.CharField(blank=True, max_length=100)),
                ('comments', models.TextField(blank=True)),
                ('a_pub_address', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='tunnel_a_pub_address', to='ipam.ipaddress')),
                ('b_pub_address', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='tunnel_b_pub_address', to='ipam.ipaddress')),
                ('side_a_assigned_object_type', models.ForeignKey(blank=True, limit_choices_to=models.Q(models.Q(('app_label', 'dcim'), ('model', 'interface'))), null=True, on_delete=django.db.models.deletion.PROTECT, related_name='side_a_assigned_object_type', to='contenttypes.contenttype')),
                ('side_b_assigned_object_type', models.ForeignKey(blank=True, limit_choices_to=models.Q(models.Q(('app_label', 'dcim'), ('model', 'interface'))), null=True, on_delete=django.db.models.deletion.PROTECT, related_name='side_b_assigned_object_type', to='contenttypes.contenttype')),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
                ('tunnel_type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='tunnels', to='netbox_tunnels2.tunneltype')),
            ],
            options={
                'verbose_name_plural': 'Tunnels',
            },
        ),
    ]
