# Generated by Django 5.2.5 on 2025-08-26 09:34

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('abschnitte', '0001_initial'),
        ('stichworte', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Dokumententyp',
            fields=[
                ('name', models.CharField(max_length=100, primary_key=True, serialize=False)),
                ('verantwortliche_ve', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Person',
            fields=[
                ('name', models.CharField(max_length=100, primary_key=True, serialize=False)),
                ('funktion', models.CharField(max_length=255)),
            ],
            options={
                'verbose_name_plural': 'Personen',
            },
        ),
        migrations.CreateModel(
            name='Thema',
            fields=[
                ('name', models.CharField(max_length=100, primary_key=True, serialize=False)),
                ('erklaerung', models.TextField(blank=True)),
            ],
            options={
                'verbose_name_plural': 'Themen',
            },
        ),
        migrations.CreateModel(
            name='Referenz',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name_nummer', models.CharField(max_length=100)),
                ('name_text', models.CharField(blank=True, max_length=255)),
                ('url', models.URLField(blank=True)),
                ('lft', models.PositiveIntegerField(editable=False)),
                ('rght', models.PositiveIntegerField(editable=False)),
                ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
                ('level', models.PositiveIntegerField(editable=False)),
                ('oberreferenz', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='unterreferenzen', to='dokumente.referenz')),
            ],
            options={
                'verbose_name_plural': 'Referenzen',
            },
        ),
        migrations.CreateModel(
            name='Referenzerklaerung',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('inhalt', models.TextField(blank=True, null=True)),
                ('abschnitttyp', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='abschnitte.abschnitttyp')),
                ('erklaerung', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dokumente.referenz')),
            ],
            options={
                'verbose_name': 'Erklärung',
            },
        ),
        migrations.CreateModel(
            name='Standard',
            fields=[
                ('nummer', models.CharField(max_length=50, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=255)),
                ('gueltigkeit_von', models.DateField(blank=True, null=True)),
                ('gueltigkeit_bis', models.DateField(blank=True, null=True)),
                ('signatur_cso', models.CharField(blank=True, max_length=255)),
                ('anhaenge', models.TextField(blank=True)),
                ('autoren', models.ManyToManyField(related_name='verfasste_dokumente', to='dokumente.person')),
                ('dokumententyp', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='dokumente.dokumententyp')),
                ('pruefende', models.ManyToManyField(related_name='gepruefte_dokumente', to='dokumente.person')),
            ],
            options={
                'verbose_name': 'Standard',
                'verbose_name_plural': 'Standards',
            },
        ),
        migrations.CreateModel(
            name='Geltungsbereich',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('inhalt', models.TextField(blank=True, null=True)),
                ('abschnitttyp', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='abschnitte.abschnitttyp')),
                ('geltungsbereich', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dokumente.standard')),
            ],
            options={
                'verbose_name': 'Geltungsbereichs-Abschnitt',
                'verbose_name_plural': 'Geltungsbereich',
            },
        ),
        migrations.CreateModel(
            name='Changelog',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('datum', models.DateField()),
                ('aenderung', models.TextField()),
                ('autoren', models.ManyToManyField(to='dokumente.person')),
                ('dokument', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='changelog', to='dokumente.standard')),
            ],
        ),
        migrations.CreateModel(
            name='Vorgabe',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nummer', models.IntegerField()),
                ('titel', models.CharField(max_length=255)),
                ('gueltigkeit_von', models.DateField()),
                ('gueltigkeit_bis', models.DateField(blank=True, null=True)),
                ('dokument', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='vorgaben', to='dokumente.standard')),
                ('referenzen', models.ManyToManyField(blank=True, to='dokumente.referenz')),
                ('stichworte', models.ManyToManyField(blank=True, to='stichworte.stichwort')),
                ('thema', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='dokumente.thema')),
            ],
            options={
                'verbose_name_plural': 'Vorgaben',
            },
        ),
        migrations.CreateModel(
            name='Checklistenfrage',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('frage', models.CharField(max_length=255)),
                ('vorgabe', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='checklistenfragen', to='dokumente.vorgabe')),
            ],
            options={
                'verbose_name_plural': 'Fragen für Checkliste',
            },
        ),
        migrations.CreateModel(
            name='VorgabeKurztext',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('inhalt', models.TextField(blank=True, null=True)),
                ('abschnitt', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dokumente.vorgabe')),
                ('abschnitttyp', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='abschnitte.abschnitttyp')),
            ],
            options={
                'verbose_name': 'Kurztext-Abschnitt',
                'verbose_name_plural': 'Kurztext',
            },
        ),
        migrations.CreateModel(
            name='VorgabeLangtext',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('inhalt', models.TextField(blank=True, null=True)),
                ('abschnitt', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dokumente.vorgabe')),
                ('abschnitttyp', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='abschnitte.abschnitttyp')),
            ],
            options={
                'verbose_name': 'Langtext-Abschnitt',
                'verbose_name_plural': 'Langtext-Abschnitte',
            },
        ),
    ]
