<reponame>mohdbakhrayba/it-assets<filename>status/migrations/0001_initial.py
# Generated by Django 2.0.9 on 2019-01-23 09:47

import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Host',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=256)),
                ('type', models.SmallIntegerField(choices=[(0, 'Server'), (1, 'Embedded device')], default=0)),
                ('ping_status', models.SmallIntegerField(choices=[(0, 'N/A'), (1, 'Failure'), (2, 'Unhealthy'), (3, 'OK')], default=0)),
                ('monitor_status', models.SmallIntegerField(choices=[(0, 'N/A'), (1, 'Failure'), (2, 'Unhealthy'), (3, 'OK')])),
                ('monitor_info', django.contrib.postgres.fields.jsonb.JSONField()),
                ('patching_status', models.SmallIntegerField(choices=[(0, 'N/A'), (1, 'Failure'), (2, 'Unhealthy'), (3, 'OK')])),
                ('patching_info', django.contrib.postgres.fields.jsonb.JSONField()),
                ('vulnerability_status', models.SmallIntegerField(choices=[(0, 'N/A'), (1, 'Failure'), (2, 'Unhealthy'), (3, 'OK')])),
                ('vulnerability_info', django.contrib.postgres.fields.jsonb.JSONField()),
                ('backup_status', models.SmallIntegerField(choices=[(0, 'N/A'), (1, 'Failure'), (2, 'Unhealthy'), (3, 'OK')])),
                ('backup_info', django.contrib.postgres.fields.jsonb.JSONField()),
            ],
        ),
        migrations.CreateModel(
            name='HostIP',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ip', models.GenericIPAddressField(unique=True)),
                ('last_seen', models.DateTimeField(auto_now=True)),
                ('host', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='host_ips', to='status.Host')),
            ],
        ),
        migrations.CreateModel(
            name='ScanRange',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=256)),
                ('range', models.CharField(max_length=256)),
            ],
        ),
        migrations.AddField(
            model_name='host',
            name='ping_scan_range',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='hosts', to='status.ScanRange'),
        ),
    ]
