# Generated by Django 3.2.9 on 2025-02-07 13:43

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='GroupUrlPermissions',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('url', models.CharField(help_text='URL pattern (can include wildcards like /api/*/users/)', max_length=255)),
                ('http_method', models.CharField(choices=[('GET', 'GET'), ('POST', 'POST'), ('PUT', 'PUT'), ('PATCH', 'PATCH'), ('DELETE', 'DELETE'), ('HEAD', 'HEAD'), ('OPTIONS', 'OPTIONS'), ('ALL', 'ALL')], default='GET', help_text='HTTP method this permission applies to', max_length=10)),
                ('is_active', models.BooleanField(default=True, help_text='Whether this permission is currently active')),
                ('description', models.TextField(blank=True, help_text='Optional description of what this permission does', null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='url_permissions', to='auth.group')),
            ],
            options={
                'verbose_name': 'URL Permission',
                'verbose_name_plural': 'URL Permissions',
                'ordering': ('group__name', 'url'),
            },
        ),
        migrations.AddIndex(
            model_name='groupurlpermissions',
            index=models.Index(fields=['url'], name='django_url__url_7c741b_idx'),
        ),
        migrations.AddIndex(
            model_name='groupurlpermissions',
            index=models.Index(fields=['http_method'], name='django_url__http_me_61e08d_idx'),
        ),
        migrations.AlterUniqueTogether(
            name='groupurlpermissions',
            unique_together={('group', 'url', 'http_method')},
        ),
    ]
