# Generated by Django 4.1.5 on 2023-01-28 14:15

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Log',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('execution_time', models.DateTimeField()),
                ('run_id', models.UUIDField()),
            ],
            options={
                'ordering': ('pk',),
            },
        ),
        migrations.CreateModel(
            name='Task',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('function', models.CharField(max_length=255, unique=True)),
                ('pid', models.IntegerField(null=True)),
                ('shutdown_command', models.DateTimeField(null=True)),
                ('next_execution_time', models.DateTimeField(null=True)),
                ('last_checked', models.DateTimeField(null=True)),
                ('interval', models.DurationField()),
                ('disabled', models.BooleanField(default=False)),
                ('current_run_id', models.UUIDField(null=True)),
                ('environment', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='LogItem',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('data', models.TextField()),
                ('log', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='urd.log')),
            ],
        ),
        migrations.AddField(
            model_name='log',
            name='task',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='logs', to='urd.task'),
        ),
    ]
