"""Add JobRun — scheduled-job health tracking.

Hand-written. The autodetector mistook JobRun for a rename of SystemConfig and
generated RemoveField operations that would have dropped `speedtest_requested`
and `updated_at` from the live systemconfig table. This migration only creates
the new model; it touches nothing that already exists.
"""
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0008_systemconfig_autoreply_confidence_and_more'),
    ]

    operations = [
        migrations.CreateModel(
            name='JobRun',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True,
                                           serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=60, unique=True)),
                ('status', models.CharField(choices=[('ok', 'OK'), ('failed', 'Failed')],
                                            default='ok', max_length=10)),
                ('last_run_at', models.DateTimeField(blank=True, null=True)),
                ('last_ok_at', models.DateTimeField(blank=True, null=True)),
                ('detail', models.CharField(blank=True, default='', max_length=500)),
                ('error', models.TextField(blank=True, default='')),
                ('run_count', models.PositiveIntegerField(default=0)),
                ('fail_count', models.PositiveIntegerField(default=0)),
                ('expected_every_minutes', models.PositiveIntegerField(default=15)),
            ],
            options={'ordering': ['name']},
        ),
    ]
