# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2018-05-24 18:51
from __future__ import unicode_literals

import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
#import tantalus.generictask_models


class Migration(migrations.Migration):

    dependencies = [
        ('tantalus', '0040_auto_20180511_1932'),
    ]

    operations = [
        migrations.CreateModel(
            name='GenericTaskInstance',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('instance_name', models.CharField(help_text=b'The name for the instance.', max_length=50, unique=True)),
                ('args', django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=dict, help_text=b'The arguments to call the task type with as a JSON object. The arguments must be a subset of the arguments required by the task type.', null=True)),
                ('running', models.BooleanField(default=False)),
                ('finished', models.BooleanField(default=False)),
                ('success', models.BooleanField(default=False)),
                ('stopping', models.BooleanField(default=False)),
                ('state', models.TextField(blank=True)),
                ('host', models.ForeignKey(help_text=b'The host on which the task will run.', on_delete=django.db.models.deletion.CASCADE, to='tantalus.ServerStorage')),
            ],
        ),
        migrations.CreateModel(
            name='GenericTaskType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('task_name', models.CharField(help_text=b'The name of the task.', max_length=50, unique=True)),
                ('relative_script_path', models.CharField(help_text=b'The path of the script used by this generic task type (relative to the root of the generic task scripts directory.', max_length=400)),
                ('required_and_default_args', django.contrib.postgres.fields.jsonb.JSONField(blank=True, help_text=b"The arguments that the task requires as a JSON object. Looking at the object as a dictionary, the keys are the argument names and the corresponding values are the default values for these arguments. To specify an argument with no default value, simply use 'null' (without the quotes) as its value.", null=True, verbose_name=b'script required arguments (see help text)')),
                ('default_host', models.ForeignKey(help_text=b'The default host an instance of this task will run on (unless otherwise specified)', on_delete=django.db.models.deletion.CASCADE, to='tantalus.ServerStorage')),
            ],
        ),
        migrations.AddField(
            model_name='generictaskinstance',
            name='task_type',
            field=models.ForeignKey(help_text=b'The generic task type of which this is an instance.', on_delete=django.db.models.deletion.CASCADE, to='tantalus.GenericTaskType'),
        ),
    ]
