Skip to content

Commit

Permalink
[migrations] Updated 0002_devicemonitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Apr 4, 2020
1 parent 938ee12 commit 65cfac7
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions openwisp_monitoring/device/migrations/0002_devicemonitoring.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
from django.utils.translation import ugettext_lazy as _
import model_utils.fields
import uuid

from openwisp_monitoring.device.models import DeviceMonitoring

from .. import settings as app_settings


def create_device_monitoring(apps, schema_editor):
"""
Expand All @@ -29,9 +32,19 @@ class Migration(migrations.Migration):
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
('status', model_utils.fields.StatusField(choices=[('ok', 'ok'), ('problem', 'problem'), ('critical', 'critical')], default='ok', db_index=True,
help_text=DeviceMonitoring._meta.get_field('status').help_text,
max_length=100, no_check_for_status=True, verbose_name='health status')),
('status', model_utils.fields.StatusField(
choices=[
('unknown', _(app_settings.HEALTH_STATUS_LABELS['unknown'])),
('ok', _(app_settings.HEALTH_STATUS_LABELS['ok'])),
('problem', _(app_settings.HEALTH_STATUS_LABELS['problem'])),
('critical', _(app_settings.HEALTH_STATUS_LABELS['critical']))
],
default='unknown', db_index=True,
help_text=DeviceMonitoring._meta.get_field('status').help_text,
max_length=100,
no_check_for_status=True,
verbose_name='health status'
)),
('device', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='monitoring', to='config.Device')),
],
options={
Expand Down

0 comments on commit 65cfac7

Please sign in to comment.