# Generated by Django 3.2.20 on 2023-07-28 14:18

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


class Migration(migrations.Migration):
    dependencies = [
        ("django_future_tasks", "0001_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="PeriodicFutureTask",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "periodic_task_id",
                    models.CharField(
                        max_length=255, unique=True, verbose_name="periodic task ID"
                    ),
                ),
                ("type", models.CharField(max_length=255, verbose_name="Task type")),
                (
                    "data",
                    models.JSONField(
                        blank=True, null=True, verbose_name="Various execution data"
                    ),
                ),
                (
                    "cron_string",
                    cronfield.models.CronField(
                        default="* * * * *",
                        help_text="Minute Hour Day Month Weekday",
                        max_length=100,
                    ),
                ),
                ("is_active", models.BooleanField(default=True, verbose_name="Active")),
                (
                    "last_task_creation",
                    models.DateTimeField(
                        auto_now_add=True,
                        help_text="The last time corresponding single tasks where created.",
                        verbose_name="Last single task creation",
                    ),
                ),
            ],
        ),
        migrations.AddField(
            model_name="futuretask",
            name="periodic_parent_task",
            field=models.ForeignKey(
                default=None,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="django_future_tasks.periodicfuturetask",
            ),
        ),
    ]
