# Generated by Django 2.1.2 on 2019-01-24 10:26

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


class Migration(migrations.Migration):
    initial = True

    dependencies = [
        ("cases", "0017_case_source_file"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="AnnotationLabel",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        help_text="Verbose name, e.g. This Awesome annotation",
                        max_length=100,
                    ),
                ),
                (
                    "slug",
                    models.SlugField(
                        help_text="Identifier, e.g. this-awesome-annotation",
                        max_length=100,
                    ),
                ),
                (
                    "trusted",
                    models.BooleanField(
                        db_index=True,
                        default=False,
                        help_text="Trusted annotations are display by default in front end",
                    ),
                ),
                (
                    "private",
                    models.BooleanField(
                        db_index=True,
                        default=False,
                        help_text="Private annotations are only visible to its author",
                    ),
                ),
                (
                    "many_annotations_per_label",
                    models.BooleanField(
                        default=False,
                        help_text="A content object can have more than one annotation per label",
                    ),
                ),
                (
                    "use_marker",
                    models.BooleanField(
                        default=False,
                        help_text="Marker annotations are extracted from the text content and have a position in the text",
                    ),
                ),
                (
                    "annotation_value_type",
                    models.CharField(
                        choices=[("str", "String"), ("int", "Integer")],
                        default="str",
                        help_text="Annotation values must be in this data type",
                        max_length=5,
                    ),
                ),
                ("color", models.CharField(blank=True, max_length=18, null=True)),
                (
                    "created_at",
                    models.DateTimeField(
                        auto_now_add=True,
                        help_text="Entry is created at this date time",
                    ),
                ),
                (
                    "updated_at",
                    models.DateTimeField(
                        auto_now=True, help_text="Date time of last change"
                    ),
                ),
                (
                    "owner",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "Label",
                "db_table": "annotations_label",
            },
        ),
        migrations.CreateModel(
            name="CaseAnnotation",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("value_str", models.CharField(blank=True, max_length=250, null=True)),
                ("value_int", models.IntegerField(blank=True, null=True)),
                (
                    "created_at",
                    models.DateTimeField(
                        auto_now_add=True,
                        help_text="Entry is created at this date time",
                    ),
                ),
                (
                    "updated_at",
                    models.DateTimeField(
                        auto_now=True, help_text="Date time of last change"
                    ),
                ),
                (
                    "belongs_to",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE, to="cases.Case"
                    ),
                ),
                (
                    "label",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="annotations.AnnotationLabel",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.AlterUniqueTogether(
            name="annotationlabel",
            unique_together={("slug", "owner")},
        ),
    ]
