Browse Source

Index Channel.code

pull/211/head
Pēteris Caune 6 years ago
parent
commit
c225a67a3a
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
2 changed files with 20 additions and 1 deletions
  1. +19
    -0
      hc/api/migrations/0047_auto_20181225_2315.py
  2. +1
    -1
      hc/api/models.py

+ 19
- 0
hc/api/migrations/0047_auto_20181225_2315.py View File

@ -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),
),
]

+ 1
- 1
hc/api/models.py View File

@ -273,7 +273,7 @@ class Ping(models.Model):
class Channel(models.Model): class Channel(models.Model):
name = models.CharField(max_length=100, blank=True) 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) user = models.ForeignKey(User, models.CASCADE)
created = models.DateTimeField(auto_now_add=True) created = models.DateTimeField(auto_now_add=True)
kind = models.CharField(max_length=20, choices=CHANNEL_KINDS) kind = models.CharField(max_length=20, choices=CHANNEL_KINDS)


Loading…
Cancel
Save