Browse Source

api_check.code should be indexed

pull/7/head
Pēteris Caune 9 years ago
parent
commit
88bd760925
2 changed files with 21 additions and 1 deletions
  1. +20
    -0
      hc/api/migrations/0014_auto_20151019_2039.py
  2. +1
    -1
      hc/api/models.py

+ 20
- 0
hc/api/migrations/0014_auto_20151019_2039.py 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),
),
]

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

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


Loading…
Cancel
Save