# Generated by Django 6.0.3 on 2026-03-10 10:00

import django.db.models.deletion
import uuid
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='AuditLog',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('is_active', models.BooleanField(db_index=True, default=True)),
                ('action', models.CharField(db_index=True, max_length=150)),
                ('entity_type', models.CharField(blank=True, db_index=True, max_length=150, null=True)),
                ('entity_id', models.CharField(blank=True, db_index=True, max_length=255, null=True)),
                ('description', models.TextField(blank=True)),
                ('ip_address', models.CharField(blank=True, max_length=100, null=True)),
                ('user_agent', models.CharField(blank=True, max_length=512, null=True)),
                ('metadata', models.JSONField(blank=True, default=dict, null=True)),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='audit_logs', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'indexes': [models.Index(fields=['action'], name='audit_audit_action_86e815_idx'), models.Index(fields=['user'], name='audit_audit_user_id_292c79_idx'), models.Index(fields=['created_at'], name='audit_audit_created_2c1626_idx')],
            },
        ),
    ]
