# Generated by Django 4.0.1 on 2022-01-06 20:34

from django.db import migrations, models


class Migration(migrations.Migration):
    # replaces = [('scheduler', '0001_initial'), ('scheduler', '0002_add_timeout'),
    #             ('scheduler', '0003_remove_queue_choices'), ('scheduler', '0004_add_cron_jobs'),
    #             ('scheduler', '0005_added_result_ttl')]

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='CronJob',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', models.DateTimeField(auto_now=True, verbose_name='modified')),
                ('name', models.CharField(max_length=128, unique=True, verbose_name='name')),
                ('callable', models.CharField(max_length=2048, verbose_name='callable')),
                ('enabled', models.BooleanField(default=True, verbose_name='enabled')),
                ('queue', models.CharField(max_length=16, verbose_name='queue')),
                ('job_id',
                 models.CharField(blank=True, editable=False, max_length=128, null=True, verbose_name='job id')),
                ('timeout', models.IntegerField(blank=True,
                                                help_text="Timeout specifies the maximum runtime, in seconds, for the job before it'll be considered 'lost'. Blank uses the default timeout.",
                                                null=True, verbose_name='timeout')),
                ('repeat', models.PositiveIntegerField(blank=True, null=True, verbose_name='repeat')),
                ('cron_string',
                 models.CharField(help_text='Define the schedule in a crontab like syntax.', max_length=64,
                                  verbose_name='cron string')),
            ],
            options={
                'ordering': ('name',),
                'verbose_name': 'Cron Job',
                'verbose_name_plural': 'Cron Jobs',
            },
        ),
        migrations.CreateModel(
            name='RepeatableJob',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', models.DateTimeField(auto_now=True, verbose_name='modified')),
                ('name', models.CharField(max_length=128, unique=True, verbose_name='name')),
                ('callable', models.CharField(max_length=2048, verbose_name='callable')),
                ('enabled', models.BooleanField(default=True, verbose_name='enabled')),
                ('queue', models.CharField(max_length=16, verbose_name='queue')),
                ('job_id',
                 models.CharField(blank=True, editable=False, max_length=128, null=True, verbose_name='job id')),
                ('scheduled_time', models.DateTimeField(verbose_name='scheduled time')),
                ('interval', models.PositiveIntegerField(verbose_name='interval')),
                ('interval_unit', models.CharField(
                    choices=[('minutes', 'minutes'), ('hours', 'hours'), ('days', 'days'), ('weeks', 'weeks')],
                    default='hours', max_length=12, verbose_name='interval unit')),
                ('repeat', models.PositiveIntegerField(blank=True, null=True, verbose_name='repeat')),
                ('timeout', models.IntegerField(blank=True,
                                                help_text="Timeout specifies the maximum runtime, in seconds, for the job before it'll be considered 'lost'. Blank uses the default timeout.",
                                                null=True, verbose_name='timeout')),
                ('result_ttl', models.IntegerField(blank=True,
                                                   help_text='The TTL value (in seconds) of the job result. -1: Result never expires, you should delete jobs manually. 0: Result gets deleted immediately. >0: Result expires after n seconds.',
                                                   null=True, verbose_name='result ttl')),
            ],
            options={
                'ordering': ('name',),
                'verbose_name': 'Repeatable Job',
                'verbose_name_plural': 'Repeatable Jobs',
            },
        ),
        migrations.CreateModel(
            name='ScheduledJob',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', models.DateTimeField(auto_now=True, verbose_name='modified')),
                ('name', models.CharField(max_length=128, unique=True, verbose_name='name')),
                ('callable', models.CharField(max_length=2048, verbose_name='callable')),
                ('enabled', models.BooleanField(default=True, verbose_name='enabled')),
                ('queue', models.CharField(max_length=16, verbose_name='queue')),
                ('job_id',
                 models.CharField(blank=True, editable=False, max_length=128, null=True, verbose_name='job id')),
                ('scheduled_time', models.DateTimeField(verbose_name='scheduled time')),
                ('timeout', models.IntegerField(blank=True,
                                                help_text="Timeout specifies the maximum runtime, in seconds, for the job before it'll be considered 'lost'. Blank uses the default timeout.",
                                                null=True, verbose_name='timeout')),
                ('result_ttl', models.IntegerField(blank=True,
                                                   help_text='The TTL value (in seconds) of the job result. -1: Result never expires, you should delete jobs manually. 0: Result gets deleted immediately. >0: Result expires after n seconds.',
                                                   null=True, verbose_name='result ttl')),
            ],
            options={
                'ordering': ('name',),
                'verbose_name': 'Scheduled Job',
                'verbose_name_plural': 'Scheduled Jobs',
            },
        ),
    ]
