# Generated by Django 4.2.1 on 2024-04-02 23:28

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


class Migration(migrations.Migration):

    dependencies = [
        ('i3tasks', '0001_initial'),
    ]

    operations = [
        migrations.RenameField(
            model_name='taskexecution',
            old_name='created',
            new_name='created_at',
        ),
        migrations.RenameField(
            model_name='taskexecution',
            old_name='updated',
            new_name='updated_at',
        ),
        migrations.RemoveField(
            model_name='taskexecution',
            name='asked_at',
        ),
        migrations.RemoveField(
            model_name='taskexecution',
            name='finished_at',
        ),
        migrations.RemoveField(
            model_name='taskexecution',
            name='started_at',
        ),
        migrations.AlterField(
            model_name='taskexecution',
            name='task_kwargs',
            field=models.JSONField(default=dict),
        ),
        migrations.CreateModel(
            name='TaskExecutionResult',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('result', models.JSONField(default=dict)),
                ('task_execution_try', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='result', to='i3tasks.taskexecution')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='TaskExecutionTry',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('try_number', models.IntegerField(default=1)),
                ('asked_at', models.DateTimeField(auto_now_add=True)),
                ('started_at', models.DateTimeField(blank=True)),
                ('finished_at', models.DateTimeField(blank=True)),
                ('is_completed', models.BooleanField(default=False)),
                ('is_success', models.BooleanField(default=False)),
                ('task_execution', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tries', to='i3tasks.taskexecution')),
            ],
            options={
                'unique_together': {('task_execution', 'try_number')},
            },
        ),
    ]
