# Generated by Django 3.2.12 on 2023-04-05 11:02

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='AccessSession',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ip', models.CharField(max_length=256)),
                ('failed_in_row', models.IntegerField(default=0)),
                ('last_access', models.DateTimeField()),
                ('resource', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Lockout',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('unlocks_on', models.DateTimeField()),
                ('active', models.BooleanField(default=True)),
                ('session', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='lockouts', to='anon_lockout.accesssession')),
            ],
        ),
        migrations.CreateModel(
            name='Attempt',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('failed', models.BooleanField()),
                ('date', models.DateTimeField(auto_now_add=True)),
                ('session', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='attempts', to='anon_lockout.accesssession')),
            ],
        ),
    ]
