<gh_stars>1-10
# Generated by Django 2.2.13 on 2021-02-24 23:49

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='ActionLog',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('action', models.CharField(max_length=256, verbose_name='操作')),
                ('op_host', models.CharField(max_length=128, verbose_name='操作')),
                ('gmt_update', models.DateTimeField(auto_now=True)),
                ('gmt_created', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='DelayedJob',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('job_name', models.CharField(max_length=128)),
                ('version', models.IntegerField()),
                ('enable', models.BooleanField(default=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('job_function', models.CharField(max_length=128)),
                ('job_parameters', models.TextField(blank=True)),
                ('retry', models.IntegerField(default=0)),
                ('retry_cnt', models.IntegerField(default=0)),
                ('gmt_update', models.DateTimeField(auto_now=True)),
                ('gmt_created', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'ordering': ('gmt_update',),
            },
        ),
        migrations.CreateModel(
            name='DjangoJob',
            fields=[
                ('id', models.CharField(max_length=64, primary_key=True, serialize=False)),
                ('job_name', models.CharField(max_length=128)),
                ('version', models.IntegerField()),
                ('enable', models.BooleanField(default=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('job_function', models.CharField(max_length=128)),
                ('job_parameters', models.TextField(blank=True)),
                ('trigger_type', models.CharField(choices=[['cron', 'cron'], ['interval', 'interval'], ['once', 'once'], ['boot_once', 'boot_once']], max_length=128)),
                ('trigger_expression', models.CharField(max_length=128)),
                ('max_instances', models.IntegerField(default=1)),
                ('misfire_grace_time', models.IntegerField(default=0)),
                ('coalesce', models.BooleanField(default=False)),
                ('log_succ_interval', models.IntegerField(default=0)),
                ('log_err_interval', models.IntegerField(default=0)),
                ('gmt_update', models.DateTimeField(auto_now=True)),
                ('gmt_created', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'ordering': ('gmt_update',),
            },
        ),
        migrations.CreateModel(
            name='JobExecHistory',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('job_name', models.CharField(max_length=128, verbose_name='任务名称')),
                ('trigger_type', models.CharField(max_length=128, verbose_name='任务类型')),
                ('version', models.IntegerField()),
                ('status', models.CharField(choices=[['New', 'New'], ['Running', 'Running'], ['Success', 'Success'], ['Error!', 'Error!'], ['Max instances reached!', 'Max instances reached!'], ['Missed!', 'Missed!']], max_length=50)),
                ('result', models.TextField(blank=True, verbose_name='执行返回结果')),
                ('start_tm', models.DateTimeField(auto_now_add=True)),
                ('end_tm', models.DateTimeField(auto_now=True)),
                ('trace_message', models.TextField(blank=True, verbose_name='追踪日志')),
                ('gmt_update', models.DateTimeField(auto_now=True)),
                ('gmt_created', models.DateTimeField(auto_now_add=True)),
                ('job', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='background_job.DjangoJob')),
            ],
            options={
                'ordering': ('-start_tm',),
            },
        ),
    ]
