# Generated by Django 3.0.5 on 2020-06-29 16:34

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Checklist',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('is_mandatory', models.BooleanField(default=True)),
            ],
        ),
        migrations.CreateModel(
            name='Project',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('description', models.TextField()),
                ('created_at', models.DateTimeField(auto_now=True)),
                ('project_type', models.CharField(choices=[('Classic Software', 'Classic Software'), ('Financial', 'Financial'), ('CRM', 'CRM')], default=None, max_length=20, null=True)),
                ('created_by_id', models.IntegerField()),
            ],
            options={
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='State',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Transition',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('description', models.TextField()),
                ('checklist', models.ManyToManyField(to='project_management_portal.Checklist')),
                ('from_state', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='state_transitions', to='project_management_portal.State')),
                ('to_state', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='transitions', to='project_management_portal.State')),
            ],
        ),
        migrations.CreateModel(
            name='Workflow',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('created_at', models.DateTimeField(auto_now=True)),
                ('states', models.ManyToManyField(related_name='workflows', to='project_management_portal.State')),
                ('transitions', models.ManyToManyField(related_name='workflows', to='project_management_portal.Transition')),
            ],
        ),
        migrations.CreateModel(
            name='Task',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=100)),
                ('description', models.TextField()),
                ('issue_type', models.CharField(choices=[('Task', 'Task'), ('Bug', 'Bug'), ('Developer story', 'Developer story'), ('User story', 'User story'), ('Enhancement', 'Enhancement')], default=None, max_length=20, null=True)),
                ('created_by_id', models.IntegerField()),
                ('created_at', models.DateTimeField(auto_now=True)),
                ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tasks', to='project_management_portal.Project')),
                ('state', models.ForeignKey(default='TODO', on_delete=django.db.models.deletion.CASCADE, related_name='tasks', to='project_management_portal.State')),
            ],
        ),
        migrations.AddField(
            model_name='project',
            name='workflow_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='projects', to='project_management_portal.Workflow'),
        ),
    ]
