# Generated migration for django-cronjob-utils

from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='CronExecution',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('task_code', models.CharField(db_index=True, help_text='Unique task code', max_length=50)),
                ('task_name', models.CharField(db_index=True, help_text='Human-readable task name', max_length=100)),
                ('started', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('ended', models.DateTimeField(blank=True, null=True)),
                ('completed', models.BooleanField(db_index=True, default=False)),
                ('success', models.BooleanField(default=False)),
                ('message', models.TextField(blank=True)),
                ('error_code', models.CharField(blank=True, max_length=50)),
                ('execution_date', models.DateField(db_index=True, help_text='Date for which the task was executed')),
                ('retry_count', models.IntegerField(default=0)),
                ('pid', models.IntegerField(blank=True, help_text='Process ID for timeout handling', null=True)),
            ],
            options={
                'verbose_name': 'Cron Execution',
                'verbose_name_plural': 'Cron Executions',
                'db_table': 'cron_execution',
                'ordering': ['-started'],
            },
        ),
        migrations.AddIndex(
            model_name='cronexecution',
            index=models.Index(fields=['task_code', 'execution_date'], name='cron_execut_task_c_0a1b2c_idx'),
        ),
        migrations.AddIndex(
            model_name='cronexecution',
            index=models.Index(fields=['task_code', 'success', 'execution_date'], name='cron_execut_task_c_1d2e3f_idx'),
        ),
        migrations.AddIndex(
            model_name='cronexecution',
            index=models.Index(fields=['completed'], name='cron_execut_complet_4g5h6i_idx'),
        ),
        migrations.AddIndex(
            model_name='cronexecution',
            index=models.Index(fields=['started'], name='cron_execut_started_7j8k9l_idx'),
        ),
    ]
