# Generated by Django 5.0.9 on 2024-11-04 03:31

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Organization',
            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)),
                ('org_id', models.CharField(max_length=200)),
                ('name', models.CharField(max_length=200)),
                ('ext_url', models.CharField(blank=True, max_length=200)),
                ('parent_rir', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='rpki_certs', to='ipam.rir')),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
            ],
            options={
                'ordering': ('name',),
            },
        ),
        migrations.CreateModel(
            name='Certificate',
            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=200)),
                ('issuer', models.CharField(blank=True, max_length=200)),
                ('subject', models.CharField(blank=True, max_length=200)),
                ('serial', models.CharField(blank=True, max_length=200)),
                ('valid_from', models.DateField(blank=True, null=True)),
                ('valid_to', models.DateField(blank=True, null=True)),
                ('auto_renews', models.BooleanField()),
                ('public_key', models.CharField(blank=True)),
                ('private_key', models.CharField(blank=True)),
                ('publication_url', models.CharField(blank=True)),
                ('ca_repository', models.CharField(blank=True)),
                ('self_hosted', models.BooleanField()),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
                ('rpki_org', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='certificates', to='netbox_rpki.organization')),
            ],
            options={
                'ordering': ('name',),
            },
        ),
        migrations.CreateModel(
            name='Roa',
            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=200)),
                ('valid_from', models.DateField(blank=True, null=True)),
                ('valid_to', models.DateField(blank=True, null=True)),
                ('auto_renews', models.BooleanField()),
                ('origin_as', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='roas', to='ipam.asn')),
                ('signed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='roas', to='netbox_rpki.certificate')),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
            ],
            options={
                'ordering': ('name',),
            },
        ),
        migrations.CreateModel(
            name='RoaPrefix',
            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)),
                ('max_length', models.IntegerField()),
                ('prefix', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='RoaPrefices', to='ipam.prefix')),
                ('roa_name', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='prefices', to='netbox_rpki.roa')),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
            ],
            options={
                'ordering': ('prefix',),
            },
        ),
    ]
