# Generated by Django 2.0.8 on 2018-08-22 15:21

import uuid

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("cases", "0003_auto_20180821_1045"),
        ("challenges", "0009_auto_20180808_1350"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="AnnotationSet",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("modified", models.DateTimeField(auto_now=True)),
                (
                    "kind",
                    models.CharField(
                        choices=[("P", "Prediction"), ("G", "Ground Truth")],
                        default="G",
                        max_length=1,
                    ),
                ),
            ],
            options={"abstract": False},
        ),
        migrations.CreateModel(
            name="ImageSet",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("modified", models.DateTimeField(auto_now=True)),
                (
                    "phase",
                    models.CharField(
                        choices=[("TRN", "Training"), ("TST", "Testing")],
                        default="TRN",
                        max_length=3,
                    ),
                ),
                (
                    "challenge",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="challenges.Challenge",
                    ),
                ),
                (
                    "images",
                    models.ManyToManyField(
                        related_name="imagesets", to="cases.Image"
                    ),
                ),
            ],
        ),
        migrations.AddField(
            model_name="annotationset",
            name="base",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to="datasets.ImageSet",
            ),
        ),
        migrations.AddField(
            model_name="annotationset",
            name="creator",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AddField(
            model_name="annotationset",
            name="images",
            field=models.ManyToManyField(
                related_name="annotationsets", to="cases.Image"
            ),
        ),
        migrations.AlterUniqueTogether(
            name="imageset", unique_together={("challenge", "phase")}
        ),
    ]
