# Generated by Django 3.1.7 on 2023-02-14 14:01

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


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="LegalContract",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("datetime_created", models.DateTimeField(auto_now_add=True)),
                ("datetime_updated", models.DateTimeField(auto_now=True)),
                (
                    "publish_status",
                    models.TextField(
                        choices=[("DRAFT", "Draft"), ("PUBLISHED", "Published")],
                        default="DRAFT",
                    ),
                ),
                ("datetime_published", models.DateTimeField(blank=True, null=True)),
                ("title", models.CharField(max_length=128)),
                ("slug", models.SlugField(max_length=128, unique=True)),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="LegalContractVersion",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("datetime_created", models.DateTimeField(auto_now_add=True)),
                ("datetime_updated", models.DateTimeField(auto_now=True)),
                (
                    "publish_status",
                    models.TextField(
                        choices=[("DRAFT", "Draft"), ("PUBLISHED", "Published")],
                        default="DRAFT",
                    ),
                ),
                ("datetime_published", models.DateTimeField(blank=True, null=True)),
                ("html_content", models.TextField(blank=True, null=True)),
                ("markdown_content", models.TextField(blank=True, null=True)),
                (
                    "contract",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="versions",
                        to="contracts.legalcontract",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.AddField(
            model_name="legalcontract",
            name="latest",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="+",
                to="contracts.legalcontractversion",
            ),
        ),
    ]
