# Generated by Django 4.2.1 on 2023-08-28 05:26

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


class Migration(migrations.Migration):
    dependencies = [
        ("contenttypes", "0002_remove_content_type_name"),
        ("formkit_ninja", "0004_remove_formkitschema_key_and_more"),
    ]

    operations = [
        migrations.AddField(
            model_name="option",
            name="last_updated",
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AddField(
            model_name="option",
            name="object_id",
            field=models.IntegerField(
                blank=True,
                help_text="This is a reference to the primary key of the original source object (typically a PNDS ztable ID) or a user-specified ID for a new group",
                null=True,
            ),
        ),
        migrations.CreateModel(
            name="OptionLabel",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("label", models.CharField(max_length=1024)),
                (
                    "lang",
                    models.CharField(
                        choices=[
                            ("en", "English"),
                            ("tet", "Tetum"),
                            ("pt", "Portugese"),
                        ],
                        default="en",
                        max_length=4,
                    ),
                ),
                (
                    "option",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="formkit_ninja.option",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="OptionGroup",
            fields=[
                (
                    "group",
                    models.CharField(
                        help_text="The label to use for these options",
                        max_length=1024,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "content_type",
                    models.ForeignKey(
                        blank=True,
                        help_text="This is a reference to the original source object (typically a PNDS ztable)",
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="contenttypes.contenttype",
                    ),
                ),
            ],
        ),
        migrations.AddConstraint(
            model_name="optionlabel",
            constraint=models.UniqueConstraint(
                fields=("option", "lang"), name="unique_option_label"
            ),
        ),
    ]
