# Generated by Django 5.2.6 on 2026-01-23 19:15

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('api_login', '0001_initial'),
        ('contenttypes', '0002_remove_content_type_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='AuditLog',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('action', models.CharField(choices=[('CREATE', 'Creación'), ('UPDATE', 'Actualización'), ('DELETE', 'Eliminación'), ('RESTORE', 'Restauración'), ('LOGIN', 'Inicio de sesión'), ('LOGOUT', 'Cierre de sesión'), ('NOTIFICATION', 'Notificación'), ('CLOSE', 'Cierre'), ('OTHER', 'Otra acción')], max_length=20)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('ip_address', models.GenericIPAddressField(blank=True, null=True)),
                ('object_id', models.PositiveIntegerField(blank=True, null=True)),
                ('data_before', models.JSONField(blank=True, null=True)),
                ('data_after', models.JSONField(blank=True, null=True)),
                ('description', models.TextField(blank=True)),
                ('content_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='audit_logs', to='api_login.usuario')),
            ],
            options={
                'ordering': ['-timestamp'],
            },
        ),
    ]
