# Generated by Django 2.2.20 on 2021-04-26 19:50

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('django_celery_beat', '0015_edit_solarschedule_events_choices'),
    ]

    operations = [
        migrations.CreateModel(
            name='Cog',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_date', models.DateTimeField(auto_now_add=True)),
                ('modified_date', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=4096)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='EntityRun',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_date', models.DateTimeField(auto_now_add=True)),
                ('modified_date', models.DateTimeField(auto_now=True)),
                ('started_on', models.DateTimeField(auto_now_add=True)),
                ('completed_on', models.DateTimeField(blank=True, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Pipeline',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_date', models.DateTimeField(auto_now_add=True)),
                ('modified_date', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=4096)),
                ('enabled', models.BooleanField(default=True)),
                ('prevent_overlapping_runs', models.BooleanField(default=True)),
                ('schedule', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='django_celery_beat.CrontabSchedule')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Stage',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_date', models.DateTimeField(auto_now_add=True)),
                ('modified_date', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=4096)),
                ('launch_after_stage', models.ManyToManyField(related_name='next_stage', to='django_cog.Stage', blank=True)),
                ('pipeline', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stages', to='django_cog.Pipeline')),
            ],
            options={
                'ordering': ['pipeline', 'name'],
            },
        ),
        migrations.CreateModel(
            name='PipelineRun',
            fields=[
                ('entityrun_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='django_cog.EntityRun')),
                ('pipeline', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='runs', to='django_cog.Pipeline')),
            ],
            options={
                'abstract': False,
            },
            bases=('django_cog.entityrun',),
        ),
        migrations.CreateModel(
            name='StageRun',
            fields=[
                ('entityrun_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='django_cog.EntityRun')),
                ('pipeline_run', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stage_runs', to='django_cog.PipelineRun')),
                ('stage', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='runs', to='django_cog.Stage')),
            ],
            options={
                'abstract': False,
            },
            bases=('django_cog.entityrun',),
        ),
        migrations.CreateModel(
            name='Task',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_date', models.DateTimeField(auto_now_add=True)),
                ('modified_date', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(blank=True, max_length=4096, null=True)),
                ('arguments_as_json', models.TextField(blank=True, null=True)),
                ('prevent_overlapping_calls', models.BooleanField(default=True)),
                ('enabled', models.BooleanField(default=True)),
                ('cog', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='assigned_tasks', to='django_cog.Cog')),
                ('stage', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='assigned_tasks', to='django_cog.Stage')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='TaskRun',
            fields=[
                ('entityrun_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='django_cog.EntityRun')),
                ('stage_run', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='task_runs', to='django_cog.StageRun')),
                ('task', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='runs', to='django_cog.Task')),
            ],
            options={
                'abstract': False,
            },
            bases=('django_cog.entityrun',),
        ),
    ]