# Generated by Django 2.2.12 on 2020-05-22 09:45

import uuid

import django.utils.timezone
import model_utils.fields
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("cases", "0027_auto_20200522_0945"),
        ("countries", "0001_initial"),
        ("control_list_entries", "0005_auto_20200519_1617"),
    ]

    operations = [
        migrations.CreateModel(
            name="OpenGeneralLicence",
            fields=[
                (
                    "created_at",
                    model_utils.fields.AutoCreatedField(
                        default=django.utils.timezone.now, editable=False, verbose_name="created_at"
                    ),
                ),
                (
                    "updated_at",
                    model_utils.fields.AutoLastModifiedField(
                        default=django.utils.timezone.now, editable=False, verbose_name="updated_at"
                    ),
                ),
                ("id", models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ("name", models.CharField(max_length=250, unique=True)),
                ("description", models.TextField()),
                ("url", models.URLField(default=None)),
                ("registration_required", models.BooleanField()),
                (
                    "status",
                    models.CharField(
                        choices=[("active", "Active"), ("deactivated", "Deactivated")], default="active", max_length=20
                    ),
                ),
                (
                    "case_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="OpenGeneralLicence",
                        to="cases.CaseType",
                    ),
                ),
                (
                    "control_list_entries",
                    models.ManyToManyField(
                        related_name="OpenGeneralLicence", to="control_list_entries.ControlListEntry"
                    ),
                ),
                (
                    "countries",
                    models.ManyToManyField(default=[], related_name="OpenGeneralLicence", to="countries.Country"),
                ),
            ],
            options={"db_table": "open_general_licence", "ordering": ["name"],},
        ),
        migrations.AddIndex(
            model_name="opengenerallicence",
            index=models.Index(fields=["status", "name"], name="open_genera_status_80e1d9_idx"),
        ),
    ]
