From 64bd77b4f482440a5090844f623f6f01600c405d Mon Sep 17 00:00:00 2001 From: TyVik Date: Sun, 17 Nov 2019 07:09:27 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BE=D0=B3=D1=80=D0=B0=D0=BD=D0=B8=D1=87=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20unique=20=D0=BD=D0=B0=20=D0=BF=D0=BE=D0=BB=D0=B5=20qti?= =?UTF-8?q?cket=5Fid.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0006_auto_20191117_0408.py | 23 +++++++++++++++++++ checkout/models.py | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 checkout/migrations/0006_auto_20191117_0408.py diff --git a/checkout/migrations/0006_auto_20191117_0408.py b/checkout/migrations/0006_auto_20191117_0408.py new file mode 100644 index 0000000..af54ec4 --- /dev/null +++ b/checkout/migrations/0006_auto_20191117_0408.py @@ -0,0 +1,23 @@ +# Generated by Django 2.2.1 on 2019-11-17 04:08 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('checkout', '0005_auto_20190820_0612'), + ] + + operations = [ + migrations.AlterField( + model_name='order', + name='qticket_id', + field=models.PositiveIntegerField(db_index=True, unique=True), + ), + migrations.AlterField( + model_name='ticket', + name='qticket_id', + field=models.PositiveIntegerField(db_index=True, unique=True), + ), + ] diff --git a/checkout/models.py b/checkout/models.py index 78095a9..e24496a 100644 --- a/checkout/models.py +++ b/checkout/models.py @@ -10,7 +10,7 @@ class ContactsMixin(models.Model): first_name = models.CharField(max_length=30, null=True, blank=True) last_name = models.CharField(max_length=150, null=True, blank=True) client_phone = models.CharField(max_length=20, null=True, blank=True) - qticket_id = models.PositiveIntegerField(db_index=True) + qticket_id = models.PositiveIntegerField(db_index=True, unique=True) created_at = models.DateTimeField(null=True, blank=True) updated_at = models.DateTimeField(null=True, blank=True) deleted_at = models.DateTimeField(null=True, blank=True)