# Generated by Django 2.1.4 on 2018-12-09 19:11

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name="MagicToken",
            fields=[
                (
                    "key",
                    models.CharField(
                        default=magicauth.utils.generate_token,
                        max_length=255,
                        primary_key=True,
                        serialize=False,
                        verbose_name="Key",
                    ),
                ),
                ("created", models.DateTimeField(auto_now_add=True)),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="magic_token",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "Magic Token",
                "verbose_name_plural": "Magic Tokens",
                "ordering": ("-created",),
            },
        )
    ]
