forked from GithubBackups/healthchecks
Add index on api_check (status, user, alert_after), will be used in sendalerts management command.
This commit is contained in:
parent
88bd760925
commit
a4afd70fef
18
hc/api/migrations/0015_auto_20151022_1008.py
Normal file
18
hc/api/migrations/0015_auto_20151022_1008.py
Normal file
@ -0,0 +1,18 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('api', '0014_auto_20151019_2039'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterIndexTogether(
|
||||
name='check',
|
||||
index_together=set([('status', 'user', 'alert_after')]),
|
||||
),
|
||||
]
|
@ -25,6 +25,11 @@ CHANNEL_KINDS = (("email", "Email"), ("webhook", "Webhook"),
|
||||
|
||||
|
||||
class Check(models.Model):
|
||||
|
||||
class Meta:
|
||||
# sendalerts command will query using these
|
||||
index_together = ["status", "user", "alert_after"]
|
||||
|
||||
name = models.CharField(max_length=100, blank=True)
|
||||
code = models.UUIDField(default=uuid.uuid4, editable=False, db_index=True)
|
||||
user = models.ForeignKey(User, blank=True, null=True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user