# Generated by Django 3.1.4 on 2021-02-12 14:08

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


class Migration(migrations.Migration):

    dependencies = [
        ('agents', '0029_delete_agentoutage'),
        ('clients', '0008_auto_20201103_1430'),
        ('autotasks', '0017_auto_20210210_1512'),
        ('scripts', '0005_auto_20201207_1606'),
        ('alerts', '0003_auto_20201021_1815'),
    ]

    operations = [
        migrations.AddField(
            model_name='alert',
            name='action_execution_time',
            field=models.CharField(blank=True, max_length=100, null=True),
        ),
        migrations.AddField(
            model_name='alert',
            name='action_retcode',
            field=models.IntegerField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='alert',
            name='action_run',
            field=models.DateTimeField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='alert',
            name='action_stderr',
            field=models.TextField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='alert',
            name='action_stdout',
            field=models.TextField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='alert',
            name='action_timeout',
            field=models.PositiveIntegerField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='alert',
            name='alert_type',
            field=models.CharField(choices=[('availability', 'Availability'), ('check', 'Check'), ('task', 'Task'), ('custom', 'Custom')], default='availability', max_length=20),
        ),
        migrations.AddField(
            model_name='alert',
            name='assigned_task',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='alert', to='autotasks.automatedtask'),
        ),
        migrations.AddField(
            model_name='alert',
            name='email_sent',
            field=models.DateTimeField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='alert',
            name='hidden',
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name='alert',
            name='resolved_action_execution_time',
            field=models.CharField(blank=True, max_length=100, null=True),
        ),
        migrations.AddField(
            model_name='alert',
            name='resolved_action_retcode',
            field=models.IntegerField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='alert',
            name='resolved_action_run',
            field=models.DateTimeField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='alert',
            name='resolved_action_stderr',
            field=models.TextField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='alert',
            name='resolved_action_stdout',
            field=models.TextField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='alert',
            name='resolved_action_timeout',
            field=models.PositiveIntegerField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='alert',
            name='resolved_email_sent',
            field=models.DateTimeField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='alert',
            name='resolved_on',
            field=models.DateTimeField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='alert',
            name='resolved_sms_sent',
            field=models.DateTimeField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='alert',
            name='sms_sent',
            field=models.DateTimeField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='alert',
            name='snoozed',
            field=models.BooleanField(default=False),
        ),
        migrations.AlterField(
            model_name='alert',
            name='severity',
            field=models.CharField(choices=[('info', 'Informational'), ('warning', 'Warning'), ('error', 'Error')], default='info', max_length=30),
        ),
        migrations.CreateModel(
            name='AlertTemplate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('is_active', models.BooleanField(default=True)),
                ('action_args', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(blank=True, max_length=255, null=True), blank=True, default=list, null=True, size=None)),
                ('resolved_action_args', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(blank=True, max_length=255, null=True), blank=True, default=list, null=True, size=None)),
                ('email_recipients', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(blank=True, max_length=100), blank=True, default=list, null=True, size=None)),
                ('text_recipients', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(blank=True, max_length=100), blank=True, default=list, null=True, size=None)),
                ('email_from', models.EmailField(blank=True, max_length=254, null=True)),
                ('agent_email_on_resolved', models.BooleanField(blank=True, default=False, null=True)),
                ('agent_text_on_resolved', models.BooleanField(blank=True, default=False, null=True)),
                ('agent_include_desktops', models.BooleanField(blank=True, default=False, null=True)),
                ('agent_always_email', models.BooleanField(blank=True, default=False, null=True)),
                ('agent_always_text', models.BooleanField(blank=True, default=False, null=True)),
                ('agent_always_alert', models.BooleanField(blank=True, default=False, null=True)),
                ('agent_periodic_alert_days', models.PositiveIntegerField(blank=True, default=0, null=True)),
                ('check_email_alert_severity', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(blank=True, choices=[('info', 'Informational'), ('warning', 'Warning'), ('error', 'Error')], max_length=25), blank=True, default=list, size=None)),
                ('check_text_alert_severity', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(blank=True, choices=[('info', 'Informational'), ('warning', 'Warning'), ('error', 'Error')], max_length=25), blank=True, default=list, size=None)),
                ('check_dashboard_alert_severity', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(blank=True, choices=[('info', 'Informational'), ('warning', 'Warning'), ('error', 'Error')], max_length=25), blank=True, default=list, size=None)),
                ('check_email_on_resolved', models.BooleanField(blank=True, default=False, null=True)),
                ('check_text_on_resolved', models.BooleanField(blank=True, default=False, null=True)),
                ('check_always_email', models.BooleanField(blank=True, default=False, null=True)),
                ('check_always_text', models.BooleanField(blank=True, default=False, null=True)),
                ('check_always_alert', models.BooleanField(blank=True, default=False, null=True)),
                ('check_periodic_alert_days', models.PositiveIntegerField(blank=True, default=0, null=True)),
                ('task_email_alert_severity', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(blank=True, choices=[('info', 'Informational'), ('warning', 'Warning'), ('error', 'Error')], max_length=25), blank=True, default=list, size=None)),
                ('task_text_alert_severity', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(blank=True, choices=[('info', 'Informational'), ('warning', 'Warning'), ('error', 'Error')], max_length=25), blank=True, default=list, size=None)),
                ('task_dashboard_alert_severity', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(blank=True, choices=[('info', 'Informational'), ('warning', 'Warning'), ('error', 'Error')], max_length=25), blank=True, default=list, size=None)),
                ('task_email_on_resolved', models.BooleanField(blank=True, default=False, null=True)),
                ('task_text_on_resolved', models.BooleanField(blank=True, default=False, null=True)),
                ('task_always_email', models.BooleanField(blank=True, default=False, null=True)),
                ('task_always_text', models.BooleanField(blank=True, default=False, null=True)),
                ('task_always_alert', models.BooleanField(blank=True, default=False, null=True)),
                ('task_periodic_alert_days', models.PositiveIntegerField(blank=True, default=0, null=True)),
                ('action', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='alert_template', to='scripts.script')),
                ('excluded_agents', models.ManyToManyField(blank=True, related_name='alert_exclusions', to='agents.Agent')),
                ('excluded_clients', models.ManyToManyField(blank=True, related_name='alert_exclusions', to='clients.Client')),
                ('excluded_sites', models.ManyToManyField(blank=True, related_name='alert_exclusions', to='clients.Site')),
                ('resolved_action', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='resolved_alert_template', to='scripts.script')),
            ],
        ),
    ]
