# Generated by Django 3.2.10 on 2021-12-30 18:43

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


class Migration(migrations.Migration):

    dependencies = [
        ('user', '0002_device_verbose_name'),
    ]

    operations = [
        migrations.AlterField(
            model_name='device',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='devices', to=settings.AUTH_USER_MODEL),
        ),
        migrations.CreateModel(
            name='Access',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('token', models.CharField(auto_created=True, db_index=True, editable=False, max_length=128, verbose_name='Token')),
                ('ip', models.GenericIPAddressField(blank=True, null=True)),
                ('last_used', models.DateTimeField(blank=True, help_text='Last time this token used', null=True, verbose_name='Last used')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
                ('device', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='accesses', to='user.device')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='accesses', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
    ]

# Generated by Django 3.2.10 on 2021-12-30 18:43

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


class Migration(migrations.Migration):

    dependencies = [
        ('user', '0002_device_verbose_name'),
    ]

    operations = [
        migrations.AlterField(
            model_name='device',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='devices', to=settings.AUTH_USER_MODEL),
        ),
        migrations.CreateModel(
            name='Access',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('token', models.CharField(auto_created=True, db_index=True, editable=False, max_length=128, verbose_name='Token')),
                ('ip', models.GenericIPAddressField(blank=True, null=True)),
                ('last_used', models.DateTimeField(blank=True, help_text='Last time this token used', null=True, verbose_name='Last used')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
                ('device', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='accesses', to='user.device')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='accesses', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
    ]

# Generated by Django 3.2.10 on 2021-12-30 18:43