# Generated by Django 2.2.5 on 2019-09-09 09:22

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Finding',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('description', models.TextField(null=True)),
                ('pluginID', models.IntegerField(null=True)),
                ('checked', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='Host',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ip', models.CharField(max_length=30)),
                ('fqdn', models.CharField(max_length=255, null=True)),
                ('mac', models.CharField(max_length=30, null=True)),
                ('os', models.CharField(max_length=100, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Import',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('running', models.IntegerField(default=0)),
                ('completed', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='ProofOfConcept',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('info', models.CharField(max_length=30)),
                ('poc', models.TextField(blank=True, null=True)),
                ('imported', models.IntegerField(default=0)),
                ('finding', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.Finding')),
            ],
        ),
        migrations.CreateModel(
            name='Service',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('port', models.IntegerField(default=0)),
                ('protocol', models.CharField(max_length=10)),
                ('haspoc', models.IntegerField(default=0)),
                ('falsepositive', models.IntegerField(default=0)),
                ('findings', models.ManyToManyField(through='api.ProofOfConcept', to='api.Finding')),
                ('host', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='services', to='api.Host')),
            ],
        ),
        migrations.CreateModel(
            name='Tool',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('commandstring', models.CharField(max_length=255)),
                ('expected_good', models.TextField(blank=True, null=True)),
                ('expected_bad', models.TextField(blank=True, null=True)),
                ('timeout', models.IntegerField(default=60)),
                ('threads', models.IntegerField(blank=True, default=5, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Task',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('starttime', models.DateTimeField(auto_now_add=True)),
                ('threads', models.IntegerField(default=5)),
                ('running', models.IntegerField(default=0)),
                ('completed', models.IntegerField(default=0)),
                ('errormessage', models.TextField(blank=True, null=True)),
                ('targets_completed', models.IntegerField(default=0)),
                ('services', models.ManyToManyField(to='api.Service')),
                ('tool', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Tool')),
            ],
        ),
        migrations.AddField(
            model_name='proofofconcept',
            name='service',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.Service'),
        ),
    ]
