# Generated by Django 2.2.6 on 2020-09-05 13:26

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Flow',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('state', models.IntegerField(choices=[(0, 'Open'), (1, 'Closed - Successful'), (2, 'Closed - No success')], default=0)),
                ('user_query', models.TextField(blank=True)),
            ],
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='TroubleshootingLogicBlock',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField(blank=True)),
                ('success_rate', models.FloatField(default=1)),
                ('successors', models.ManyToManyField(blank=True, to='support.TroubleshootingLogicBlock')),
                ('tags', models.ManyToManyField(to='support.Tag')),
            ],
        ),
        migrations.CreateModel(
            name='FlowStep',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('position', models.IntegerField()),
                ('flow', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='support.Flow')),
                ('tlb', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='support.TroubleshootingLogicBlock')),
            ],
        ),
        migrations.AddField(
            model_name='flow',
            name='steps',
            field=models.ManyToManyField(through='support.FlowStep', to='support.TroubleshootingLogicBlock'),
        ),
    ]
