# Generated by Django 5.2.12 on 2026-03-27 17:31

import mojo.models.rest
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('incident', '0021_alter_event_id_alter_incident_id'),
    ]

    operations = [
        migrations.CreateModel(
            name='IPSet',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('modified', models.DateTimeField(auto_now=True, db_index=True)),
                ('name', models.CharField(help_text='ipset name, e.g. country_cn, abuse_ips, azure', max_length=100, unique=True)),
                ('kind', models.CharField(choices=[('country', 'Country'), ('datacenter', 'Datacenter'), ('abuse', 'Abuse List'), ('custom', 'Custom')], db_index=True, max_length=20)),
                ('description', models.CharField(blank=True, max_length=255, null=True)),
                ('source', models.CharField(choices=[('ipdeny', 'ipdeny.com'), ('abuseipdb', 'AbuseIPDB'), ('manual', 'Manual')], default='manual', max_length=20)),
                ('source_url', models.CharField(blank=True, help_text='URL to fetch CIDR list from (ipdeny, etc.)', max_length=500, null=True)),
                ('source_key', models.CharField(blank=True, help_text='API key or identifier for the source', max_length=255, null=True)),
                ('data', models.TextField(blank=True, default='', help_text='CIDR list, one per line')),
                ('is_enabled', models.BooleanField(db_index=True, default=True)),
                ('cidr_count', models.IntegerField(default=0)),
                ('last_synced', models.DateTimeField(blank=True, null=True)),
                ('sync_error', models.TextField(blank=True, null=True)),
            ],
            options={
                'verbose_name': 'IP Set',
                'verbose_name_plural': 'IP Sets',
            },
            bases=(models.Model, mojo.models.rest.MojoModel),
        ),
    ]
