# Generated by Django 4.2.23 on 2025-10-09 05:44

import django.db.models.deletion
import django_extensions.db.fields
from django.db import migrations
from django.db import models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("contenttypes", "0002_remove_content_type_name"),
    ]

    operations = [
        migrations.CreateModel(
            name="CustomField",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created",
                    django_extensions.db.fields.CreationDateTimeField(
                        auto_now_add=True, verbose_name="created"
                    ),
                ),
                (
                    "modified",
                    django_extensions.db.fields.ModificationDateTimeField(
                        auto_now=True, verbose_name="modified"
                    ),
                ),
                (
                    "allow_blank",
                    models.BooleanField(
                        default=True, verbose_name="Leeren String erlauben"
                    ),
                ),
                (
                    "allow_null",
                    models.BooleanField(
                        default=True, verbose_name="Leere Werte erlauben"
                    ),
                ),
                (
                    "choice_field",
                    models.BooleanField(default=False, verbose_name="Auswahlfeld"),
                ),
                (
                    "default",
                    models.JSONField(
                        blank=True, null=True, verbose_name="Standardwert"
                    ),
                ),
                (
                    "editable",
                    models.BooleanField(default=True, verbose_name="Editierbar"),
                ),
                (
                    "external_key",
                    models.CharField(
                        blank=True, null=True, verbose_name="Externer Key"
                    ),
                ),
                (
                    "field_type",
                    models.CharField(
                        choices=[
                            ("CHAR", "Text (einzeilig)"),
                            ("TEXT", "Text (mehrzeilig)"),
                            ("DATE", "Datum"),
                            ("DATETIME", "Datum und Zeit"),
                            ("INTEGER", "Zahl (Ganzzahl)"),
                            ("BOOLEAN", "Checkbox"),
                        ],
                        verbose_name="Feldtyp",
                    ),
                ),
                (
                    "hidden",
                    models.BooleanField(default=False, verbose_name="Ausblenden"),
                ),
                ("identifier", models.SlugField(max_length=64, unique=True)),
                ("label", models.CharField(verbose_name="Name")),
                ("multiple", models.BooleanField(default=False, verbose_name="Liste")),
                (
                    "multiple_choice",
                    models.BooleanField(
                        default=False, verbose_name="Mehrfachauswahlfeld"
                    ),
                ),
                (
                    "order",
                    models.PositiveSmallIntegerField(
                        default=0, verbose_name="Reihenfolge"
                    ),
                ),
                (
                    "required",
                    models.BooleanField(default=False, verbose_name="Erforderlich"),
                ),
                (
                    "content_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="contenttypes.contenttype",
                    ),
                ),
            ],
            options={
                "verbose_name": "Benutzerdefiniertes Feld",
                "verbose_name_plural": "Benutzerdefinierte Felder",
                "ordering": ["order", "created"],
            },
        ),
        migrations.CreateModel(
            name="CustomValue",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created",
                    django_extensions.db.fields.CreationDateTimeField(
                        auto_now_add=True, verbose_name="created"
                    ),
                ),
                (
                    "modified",
                    django_extensions.db.fields.ModificationDateTimeField(
                        auto_now=True, verbose_name="modified"
                    ),
                ),
                (
                    "order",
                    models.PositiveIntegerField(default=0, verbose_name="Reihenfolge"),
                ),
                ("text", models.CharField(blank=True, null=True, verbose_name="Text")),
                ("value", models.JSONField(blank=True, null=True, verbose_name="Wert")),
                (
                    "field",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="values",
                        to="custom_fields.customfield",
                        verbose_name="Feld",
                    ),
                ),
            ],
            options={
                "verbose_name": "Benutzerdefinierter Wert",
                "verbose_name_plural": "Benutzerdefinierte Werte",
                "ordering": ["order", "created"],
            },
        ),
    ]
