# Generated by Django 5.2.5 on 2025-09-04 12:59

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        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='referenzen.referenz')),
            ],
            options={
                'verbose_name_plural': 'Referenzen',
                'db_table': 'standards_referenz',
            },
        ),
        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)),
                ('order', models.PositiveIntegerField(default=0)),
                ('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='referenzen.referenz')),
            ],
            options={
                'verbose_name': 'Erklärung',
                'db_table': 'standards_referenzerklaerung',
            },
        ),
    ]
