# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-01-04 15:00
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_fsm.db.fields.fsmfield
import django_light_enums.db
import jsonfield.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Record',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('instructions', models.TextField(blank=True, help_text='Information needed to run this particular scenario, such as usernames and login information.', null=True)),
                ('status', django_fsm.db.fields.fsmfield.FSMIntegerField(choices=[(1, b'READY'), (10, b'IN_PROGRESS'), (20, b'DONE'), (-1, b'NOT_READY'), (-10, b'FAILED')], db_index=True, default=-1)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('updated_on', models.DateTimeField(auto_now=True)),
                ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='RecordedObject',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('object_id', models.PositiveIntegerField()),
                ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
                ('record', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='recorded_objects', to='quade.Record')),
            ],
        ),
        migrations.CreateModel(
            name='Scenario',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('slug', models.SlugField(unique=True)),
                ('status', django_light_enums.db.EnumField(choices=[(0, b'INACTIVE'), (10, b'ACTIVE')], default=10, enum_values=[0, 10])),
                ('config', jsonfield.fields.JSONField()),
                ('description', models.TextField()),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('updated_on', models.DateTimeField(auto_now=True)),
            ],
            options={
                'ordering': ['description'],
            },
        ),
        migrations.AddField(
            model_name='record',
            name='scenario',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='quade.Scenario'),
        ),
    ]
