From 420393a437068790054fc5f0ee525d143a0c66e6 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 17 Nov 2018 10:01:24 +0100 Subject: [PATCH] Update models / create migration --- ungleichotp/otpauth/migrations/0001_initial.py | 14 ++++++++------ ungleichotp/otpauth/models.py | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ungleichotp/otpauth/migrations/0001_initial.py b/ungleichotp/otpauth/migrations/0001_initial.py index 29d70d1..17505ad 100644 --- a/ungleichotp/otpauth/migrations/0001_initial.py +++ b/ungleichotp/otpauth/migrations/0001_initial.py @@ -1,7 +1,6 @@ -# Generated by Django 2.1.2 on 2018-10-26 19:55 +# Generated by Django 2.1.3 on 2018-11-17 09:01 from django.db import migrations, models -import uuid class Migration(migrations.Migration): @@ -15,11 +14,14 @@ class Migration(migrations.Migration): migrations.CreateModel( name='OTPSeed', fields=[ - ('appuuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('appname', models.CharField(max_length=128)), - ('username', models.CharField(max_length=128)), + ('id', models.AutoField(primary_key=True, serialize=False)), + ('name', models.CharField(max_length=128)), + ('realm', models.CharField(max_length=128)), ('seed', models.CharField(max_length=128)), - ('trusted', models.BooleanField(default=False)), ], ), + migrations.AlterUniqueTogether( + name='otpseed', + unique_together={('name', 'realm')}, + ), ] diff --git a/ungleichotp/otpauth/models.py b/ungleichotp/otpauth/models.py index 59c5fae..d93fbbe 100644 --- a/ungleichotp/otpauth/models.py +++ b/ungleichotp/otpauth/models.py @@ -2,6 +2,7 @@ from django.db import models # Create your models here. class OTPSeed(models.Model): + id = models.AutoField(primary_key=True) name = models.CharField(max_length=128) realm = models.CharField(max_length=128) seed = models.CharField(max_length=128)