# Generated by Django 5.2.9 on 2026-02-13 18:07

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


class Migration(migrations.Migration):

    dependencies = [
        ('extras', '0134_owner'),
        ('netbox_rir_manager', '0012_rircontact_last_name_allow_blank'),
        ('tenancy', '0022_add_comments_to_organizationalmodel'),
    ]

    operations = [
        migrations.CreateModel(
            name='RIRCustomer',
            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)),
                ('handle', models.CharField(max_length=50, unique=True)),
                ('customer_name', models.CharField(max_length=255)),
                ('street_address', models.TextField(blank=True, default='')),
                ('city', models.CharField(blank=True, default='', max_length=100)),
                ('state_province', models.CharField(blank=True, default='', max_length=100)),
                ('postal_code', models.CharField(blank=True, default='', max_length=20)),
                ('country', models.CharField(blank=True, default='', max_length=2)),
                ('raw_data', models.JSONField(blank=True, default=dict)),
                ('created_date', models.DateTimeField()),
                ('network', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='customers', to='netbox_rir_manager.rirnetwork')),
                ('rir_config', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='customers', to='netbox_rir_manager.rirconfig')),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
                ('tenant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='rir_customers', to='tenancy.tenant')),
            ],
            options={
                'verbose_name': 'RIR customer',
                'verbose_name_plural': 'RIR customers',
                'ordering': ['-created_date'],
            },
            bases=(netbox.models.deletion.DeleteMixin, models.Model),
        ),
    ]
