<reponame>uktrade/lite-ap
# Generated by Django 2.2.17 on 2021-02-08 16:05

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


class Migration(migrations.Migration):

    dependencies = [
        ("documents", "0001_initial"),
        ("organisations", "0009_site_records_located_at"),
    ]

    operations = [
        migrations.CreateModel(
            name="DocumentOnOrganisation",
            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)),
                ("expiry_date", models.DateField(help_text="Date the document is no longer valid")),
                (
                    "document_type",
                    models.TextField(
                        choices=[
                            ("section-five-certificate", "Firearm Section 5 certificate"),
                            ("rfd-certificate", "Registered Firearm Dealer certificate"),
                        ]
                    ),
                ),
                (
                    "document",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="document_on_organisations",
                        to="documents.Document",
                    ),
                ),
                (
                    "organisation",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="document_on_organisations",
                        to="organisations.Organisation",
                    ),
                ),
            ],
            options={"abstract": False,},
        ),
    ]
