Remove unique=True

huangqimin 5 年之前
父节点
当前提交
237d6c256d
共有 2 个文件被更改,包括 22 次插入1 次删除
  1. 21 0
      coupon/migrations/0005_auto_20191223_1830.py
  2. 1 1
      coupon/models.py

+ 21 - 0
coupon/migrations/0005_auto_20191223_1830.py

@@ -0,0 +1,21 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.11.26 on 2019-12-23 10:30
3
+from __future__ import unicode_literals
4
+
5
+from django.db import migrations
6
+import shortuuidfield.fields
7
+
8
+
9
+class Migration(migrations.Migration):
10
+
11
+    dependencies = [
12
+        ('coupon', '0004_usercouponinfo_coupon_image'),
13
+    ]
14
+
15
+    operations = [
16
+        migrations.AlterField(
17
+            model_name='usercouponinfo',
18
+            name='coupon_id',
19
+            field=shortuuidfield.fields.ShortUUIDField(blank=True, db_index=True, editable=False, help_text='\u5238\u552f\u4e00\u6807\u8bc6', max_length=22, null=True),
20
+        ),
21
+    ]

+ 1 - 1
coupon/models.py

@@ -47,7 +47,7 @@ class UserCouponInfo(BaseModelMixin):
47 47
     brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True)
48 48
     brand_name = models.CharField(_(u'brand_name'), max_length=255, blank=True, null=True, help_text=u'品牌名称')
49 49
 
50
-    coupon_id = ShortUUIDField(_(u'coupon_id'), max_length=32, blank=True, null=True, help_text=u'券唯一标识', db_index=True, unique=True)
50
+    coupon_id = ShortUUIDField(_(u'coupon_id'), max_length=32, blank=True, null=True, help_text=u'券唯一标识', db_index=True)
51 51
     user_id = models.CharField(_(u'user_id'), max_length=32, blank=True, null=True, help_text=u'用户唯一标识', db_index=True)
52 52
 
53 53
     coupon_title = models.CharField(_(u'coupon_title'), max_length=255, blank=True, null=True, help_text=u'券标题')