# Generated by Django 2.2 on 2019-04-17 05:26

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


class Migration(migrations.Migration):

    dependencies = [
        ('clouds', '0030_auto_20190417_0157'),
        ('engines', '0037_clustergroupoperation'),
    ]

    operations = [
        migrations.CreateModel(
            name='StepOperation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('batch_uuid', models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False)),
                ('operation', models.CharField(choices=[('start', 'start'), ('reboot', 'reboot'), ('shutdown', 'shutdown'), ('poweroff', 'poweroff'), ('remedy', 'remedy')], default='start', max_length=50)),
                ('script', models.TextField(blank=True, max_length=5120, null=True)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('started_time', models.DateTimeField(blank=True, editable=False, null=True)),
                ('completed_time', models.DateTimeField(blank=True, editable=False, null=True)),
                ('status', models.CharField(choices=[('success', 'success'), ('failed', 'failed'), ('running', 'running'), ('waiting', 'waiting')], default='running', editable=False, max_length=50)),
                ('tidied', models.BooleanField(default=False, editable=False)),
                ('manual', models.BooleanField(default=True, editable=False)),
                ('serial', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, to='engines.StepOperation')),
            ],
            options={
                'verbose_name': 'operation',
                'abstract': False,
            },
        ),
        migrations.DeleteModel(
            name='ClusterGroupOperation',
        ),
        migrations.CreateModel(
            name='Step',
            fields=[
            ],
            options={
                'verbose_name': 'Step',
                'proxy': True,
                'indexes': [],
                'constraints': [],
            },
            bases=('clouds.group',),
        ),
        migrations.AlterModelOptions(
            name='clusteroperation',
            options={'verbose_name': 'cluster operation'},
        ),
        migrations.AlterField(
            model_name='cluster',
            name='steps',
            field=models.ManyToManyField(blank=True, editable=False, to='engines.Step'),
        ),
        migrations.AddField(
            model_name='stepoperation',
            name='target',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='engines.Step'),
        ),
    ]
