# Generated by Django 3.2.5 on 2022-05-31 14:46

import apps.base.models.live_setting
import apps.base.models.user_notification_policy
import datetime
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django_migration_linter as linter


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('alerts', '0001_squashed_initial'),
    ]

    operations = [
        linter.IgnoreMigration(),
        migrations.CreateModel(
            name='DynamicSetting',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('boolean_value', models.BooleanField(default=None, null=True)),
                ('numeric_value', models.IntegerField(default=None, null=True)),
                ('json_value', models.JSONField(blank=True, default=None, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='FailedToInvokeCeleryTask',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=500)),
                ('parameters', models.JSONField()),
                ('is_sent', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='LiveSetting',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('public_primary_key', models.CharField(default=apps.base.models.live_setting.generate_public_primary_key_for_live_setting, max_length=20, unique=True, validators=[django.core.validators.MinLengthValidator(13)])),
                ('name', models.CharField(max_length=50, unique=True)),
                ('value', models.JSONField(default=None, null=True)),
                ('error', models.TextField(default=None, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='OrganizationLogRecord',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('public_primary_key', models.CharField(max_length=20, null=True, default=None)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('description', models.TextField(default=None, null=True)),
                ('_labels', models.JSONField(default=list)),
            ],
        ),
        migrations.CreateModel(
            name='UserNotificationPolicy',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order', models.PositiveIntegerField(db_index=True, editable=False, verbose_name='order')),
                ('public_primary_key', models.CharField(default=apps.base.models.user_notification_policy.generate_public_primary_key_for_notification_policy, max_length=20, unique=True, validators=[django.core.validators.MinLengthValidator(13)])),
                ('step', models.PositiveSmallIntegerField(choices=[(0, 'Wait'), (1, 'Notify by')], default=None, null=True)),
                ('notify_by', models.PositiveSmallIntegerField(default=0, validators=[apps.base.models.user_notification_policy.validate_channel_choice])),
                ('wait_delay', models.DurationField(choices=[(datetime.timedelta(seconds=60), '1 min'), (datetime.timedelta(seconds=300), '5 min'), (datetime.timedelta(seconds=900), '15 min'), (datetime.timedelta(seconds=1800), '30 min'), (datetime.timedelta(seconds=3600), '60 min')], default=None, null=True)),
                ('important', models.BooleanField(default=False)),
            ],
            options={
                'ordering': ('order',),
            },
        ),
        migrations.CreateModel(
            name='UserNotificationPolicyLogRecord',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.IntegerField(choices=[(0, 'Personal notification triggered'), (1, 'Personal notification finished'), (2, 'Personal notification success'), (3, 'Personal notification failed')])),
                ('slack_prevent_posting', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('reason', models.TextField(default=None, null=True)),
                ('notification_error_code', models.PositiveIntegerField(default=None, null=True)),
                ('notification_step', models.IntegerField(choices=[(0, 'Wait'), (1, 'Notify by')], default=None, null=True)),
                ('notification_channel', models.IntegerField(default=None, null=True, validators=[apps.base.models.user_notification_policy.validate_channel_choice])),
                ('alert_group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='personal_log_records', to='alerts.alertgroup')),
            ],
        ),
    ]
