# Generated by Django 4.0.3 on 2022-04-20 20:55

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('tasks', '0002_slug'),
    ]

    operations = [
        migrations.CreateModel(
            name='Attachment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=128, verbose_name='Titel')),
                ('shortterm', models.CharField(max_length=10)),
                ('slug', models.SlugField(max_length=10)),
                ('description', models.TextField(blank=True, null=True)),
            ],
            options={
                'verbose_name': 'Anhang Ordner',
                'verbose_name_plural': 'Anhang Ordner',
            },
        ),
        migrations.CreateModel(
            name='TopicGroup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=128, verbose_name='Titel')),
                ('shortterm', models.CharField(max_length=10, unique=True)),
                ('slug', models.SlugField(max_length=10, unique=True)),
                ('short_description', models.TextField(blank=True, null=True)),
                ('order', models.PositiveSmallIntegerField(blank=True, null=True, unique=True, verbose_name='Reihenfolge')),
            ],
            options={
                'verbose_name': 'Themenbereich',
                'verbose_name_plural': 'Themenbereiche',
            },
        ),
        migrations.CreateModel(
            name='Topic',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=128, verbose_name='Titel')),
                ('shortterm', models.CharField(max_length=10, unique=True)),
                ('slug', models.SlugField(max_length=10, unique=True)),
                ('archive', models.BooleanField(default=False, verbose_name='Archiv')),
                ('description', models.TextField(blank=True, null=True)),
                ('task_list', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='tasks.tasklist')),
                ('topic_group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='intern.topicgroup', verbose_name='Themenbereich')),
            ],
            options={
                'verbose_name': 'Thema',
                'verbose_name_plural': 'Themen',
            },
        ),
        migrations.CreateModel(
            name='FileUpload',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=128, verbose_name='Titel')),
                ('file_field', models.FileField(upload_to='uploads/intern/files/', verbose_name='Dokument')),
                ('date', models.DateField(default=datetime.date.today, verbose_name='Datum')),
                ('attachment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='intern.attachment')),
            ],
            options={
                'verbose_name': 'Datei',
                'verbose_name_plural': 'Dateien',
            },
        ),
        migrations.CreateModel(
            name='Etherpad',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=128, verbose_name='Titel')),
                ('slug', models.SlugField(blank=True, null=True)),
                ('etherpad_key', models.CharField(blank=True, max_length=50)),
                ('date', models.DateField(default=datetime.date.today, verbose_name='Datum')),
                ('attachment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='intern.attachment')),
            ],
            options={
                'verbose_name': 'Etherpad',
                'verbose_name_plural': 'Etherpads',
            },
        ),
        migrations.AddField(
            model_name='attachment',
            name='topic',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='intern.topic'),
        ),
        migrations.AddConstraint(
            model_name='etherpad',
            constraint=models.UniqueConstraint(fields=('title', 'date', 'attachment'), name='unique_intern_etherpad'),
        ),
        migrations.AddConstraint(
            model_name='attachment',
            constraint=models.UniqueConstraint(fields=('slug', 'topic'), name='unique_intern_slug_topic'),
        ),
        migrations.AddConstraint(
            model_name='attachment',
            constraint=models.UniqueConstraint(fields=('title', 'topic'), name='unique_intern_title_topic'),
        ),
    ]
