diff --git a/hc/api/migrations/0047_auto_20181225_2315.py b/hc/api/migrations/0047_auto_20181225_2315.py new file mode 100644 index 00000000..24dd6c0c --- /dev/null +++ b/hc/api/migrations/0047_auto_20181225_2315.py @@ -0,0 +1,19 @@ +# Generated by Django 2.1.4 on 2018-12-25 23:15 + +from django.db import migrations, models +import uuid + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0046_auto_20181218_1245'), + ] + + operations = [ + migrations.AlterField( + model_name='channel', + name='code', + field=models.UUIDField(default=uuid.uuid4, editable=False, unique=True), + ), + ] diff --git a/hc/api/models.py b/hc/api/models.py index 75d91710..02f2c429 100644 --- a/hc/api/models.py +++ b/hc/api/models.py @@ -273,7 +273,7 @@ class Ping(models.Model): class Channel(models.Model): name = models.CharField(max_length=100, blank=True) - code = models.UUIDField(default=uuid.uuid4, editable=False) + code = models.UUIDField(default=uuid.uuid4, editable=False, unique=True) user = models.ForeignKey(User, models.CASCADE) created = models.DateTimeField(auto_now_add=True) kind = models.CharField(max_length=20, choices=CHANNEL_KINDS)