# Generated by Django 3.2.20 on 2023-07-16 19:26

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='AuthLogEntry',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('action', models.PositiveSmallIntegerField(choices=[(0, 'login'), (1, 'login_failure'), (2, 'logout'), (3, 'logout_failure'), (4, 'password_change_success'), (5, 'password_change_failure'), (6, 'password_reset_success'), (7, 'password_reset_failure'), (8, 'email_validation_success'), (9, 'email_validation_failure'), (10, 'email_reset_password_success'), (11, 'email_reset_password_failure'), (12, 'upload_success'), (13, 'upload_failure')], db_index=True, verbose_name='action')),
                ('cid', models.CharField(blank=True, db_index=True, max_length=255, null=True, verbose_name='Correlation ID')),
                ('changes', models.JSONField(null=True, verbose_name='change message')),
                ('timestamp', models.DateTimeField(db_index=True, default=django.utils.timezone.now, verbose_name='timestamp')),
                ('actor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='actor')),
            ],
            options={
                'verbose_name': 'authlog entry',
                'verbose_name_plural': 'authlog entries',
                'ordering': ['-timestamp'],
                'get_latest_by': 'timestamp',
            },
        ),
    ]
