api_check.code should be indexed

This commit is contained in:
Pēteris Caune 2015-10-19 23:41:04 +03:00
parent 34060b7968
commit 88bd760925
2 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import uuid
class Migration(migrations.Migration):
dependencies = [
('api', '0013_auto_20151001_2029'),
]
operations = [
migrations.AlterField(
model_name='check',
name='code',
field=models.UUIDField(default=uuid.uuid4, db_index=True, editable=False),
),
]

View File

@ -26,7 +26,7 @@ CHANNEL_KINDS = (("email", "Email"), ("webhook", "Webhook"),
class Check(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, db_index=True)
user = models.ForeignKey(User, blank=True, null=True)
created = models.DateTimeField(auto_now_add=True)
timeout = models.DurationField(default=DEFAULT_TIMEOUT)