# Generated by Django 6.0 on 2026-03-23 15:59

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


class Migration(migrations.Migration):

    dependencies = [
        ('api', '0326_decodoipblock_proxy_type'),
    ]

    operations = [
        migrations.CreateModel(
            name='PersistentAgentInboundWebhook',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=128)),
                ('secret_encrypted', models.BinaryField(blank=True, null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('last_triggered_at', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('agent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='inbound_webhooks', to='api.persistentagent')),
            ],
            options={
                'ordering': ['name'],
                'indexes': [models.Index(fields=['agent', 'created_at'], name='pa_inbound_hook_agent_idx'), models.Index(fields=['agent', 'is_active'], name='pa_inbound_hook_active_idx')],
                'constraints': [models.UniqueConstraint(fields=('agent', 'name'), name='uniq_agent_inbound_webhook_name')],
            },
        ),
    ]
