0001_initial.py 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # Generated by Django 3.2.3 on 2021-05-25 01:12
  2. from django.conf import settings
  3. from django.db import migrations, models
  4. import django.db.models.deletion
  5. class Migration(migrations.Migration):
  6. initial = True
  7. dependencies = [
  8. migrations.swappable_dependency(settings.AUTH_USER_MODEL),
  9. ]
  10. operations = [
  11. migrations.CreateModel(
  12. name="UserKey",
  13. fields=[
  14. (
  15. "id",
  16. models.BigAutoField(
  17. auto_created=True,
  18. primary_key=True,
  19. serialize=False,
  20. verbose_name="ID",
  21. ),
  22. ),
  23. ("name", models.CharField(blank=True, max_length=255)),
  24. ("created", models.DateTimeField(auto_now_add=True)),
  25. (
  26. "key_type",
  27. models.CharField(
  28. choices=[("FIDO2", "Fido2"), ("TOTP", "Totp")], max_length=25
  29. ),
  30. ),
  31. ("properties", models.JSONField(default=dict)),
  32. (
  33. "last_used",
  34. models.DateTimeField(blank=True, default=None, null=True),
  35. ),
  36. (
  37. "user",
  38. models.ForeignKey(
  39. on_delete=django.db.models.deletion.CASCADE,
  40. to=settings.AUTH_USER_MODEL,
  41. ),
  42. ),
  43. ],
  44. ),
  45. ]