# Generated by Django 5.2.4 on 2025-07-03 21:51

import django.db.models.deletion
import uuid
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='BatfishServiceSetting',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='Unique identifier for this Batfish service setting', max_length=100, unique=True)),
                ('address', models.CharField(blank=True, help_text='Batfish service address (optional)', max_length=255, null=True)),
                ('network_name', models.CharField(blank=True, help_text='Batfish network name (optional)', max_length=100, null=True)),
                ('snapshot_name', models.CharField(blank=True, help_text='Batfish snapshot name (optional)', max_length=100, null=True)),
                ('port_v1', models.IntegerField(blank=True, help_text='Batfish API v1 port (optional)', null=True)),
                ('port_v2', models.IntegerField(blank=True, help_text='Batfish API v2 port (optional)', null=True)),
                ('use_ssl', models.BooleanField(blank=True, help_text='Whether to use SSL (optional)', null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'Batfish Service Setting',
                'verbose_name_plural': 'Batfish Service Settings',
            },
        ),
        migrations.CreateModel(
            name='NetworkImporterInventorySettings',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='Unique identifier for this inventory setting', max_length=100, unique=True)),
                ('address', models.URLField(help_text='Base URL for the inventory system (e.g., https://nautobot.example.com)')),
                ('verify_ssl', models.BooleanField(default=True, help_text='Whether to verify SSL certificates')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'Network Importer Inventory Setting',
                'verbose_name_plural': 'Network Importer Inventory Settings',
            },
        ),
        migrations.CreateModel(
            name='NetworkImporterNetCreds',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='Unique identifier for this network credential set', max_length=100, unique=True)),
                ('description', models.TextField(blank=True, help_text='Optional description for this credential set')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'Network Importer Network Credential',
                'verbose_name_plural': 'Network Importer Network Credentials',
            },
        ),
        migrations.CreateModel(
            name='NetworkImporterJob',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('site_code', models.CharField(max_length=50)),
                ('mode', models.CharField(choices=[('apply', 'Apply'), ('check', 'Check')], max_length=10)),
                ('status', models.CharField(choices=[('pending', 'Pending'), ('queued', 'Queued'), ('running', 'Running'), ('completed', 'Completed'), ('failed', 'Failed')], default='pending', max_length=20)),
                ('config_data', models.JSONField()),
                ('celery_task_id', models.CharField(blank=True, help_text='Celery task ID for tracking', max_length=255, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('started_at', models.DateTimeField(blank=True, null=True)),
                ('completed_at', models.DateTimeField(blank=True, null=True)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='JobLog',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('level', models.CharField(choices=[('DEBUG', 'Debug'), ('INFO', 'Info'), ('WARNING', 'Warning'), ('ERROR', 'Error'), ('CRITICAL', 'Critical')], max_length=10)),
                ('message', models.TextField()),
                ('source', models.CharField(blank=True, max_length=100)),
                ('job', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='logs', to='api.networkimporterjob')),
            ],
            options={
                'ordering': ['timestamp'],
            },
        ),
        migrations.AddIndex(
            model_name='networkimporterjob',
            index=models.Index(fields=['site_code', '-created_at'], name='api_network_site_co_3ec8d5_idx'),
        ),
        migrations.AddIndex(
            model_name='networkimporterjob',
            index=models.Index(fields=['status'], name='api_network_status_4260e7_idx'),
        ),
        migrations.AddIndex(
            model_name='networkimporterjob',
            index=models.Index(fields=['celery_task_id'], name='api_network_celery__ec0cd3_idx'),
        ),
        migrations.AddIndex(
            model_name='joblog',
            index=models.Index(fields=['job', 'timestamp'], name='api_joblog_job_id_585f9e_idx'),
        ),
        migrations.AddIndex(
            model_name='joblog',
            index=models.Index(fields=['level'], name='api_joblog_level_b41dfb_idx'),
        ),
    ]
