# Generated by Django 5.1.4 on 2024-12-30 23:31

from __future__ import annotations

import uuid

import django.utils.timezone
from django.db import migrations
from django.db import models


class Migration(migrations.Migration):
    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="TaskResult",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid1,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                        unique=True,
                    ),
                ),
                (
                    "task_id",
                    models.CharField(db_index=True, max_length=255, unique=True),
                ),
                ("task_name", models.CharField(max_length=255)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("PENDING", "Pending"),
                            ("SUCCESS", "Success"),
                            ("FAILURE", "Failure"),
                        ],
                        default="PENDING",
                        max_length=50,
                    ),
                ),
                (
                    "date_created",
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
                ("date_done", models.DateTimeField(null=True)),
                ("result", models.JSONField(null=True)),
                ("traceback", models.TextField(null=True)),
                ("args", models.JSONField(null=True)),
                ("kwargs", models.JSONField(null=True)),
            ],
            options={
                "ordering": ["-date_done"],
            },
        ),
    ]
