# Generated by Django 3.2 on 2021-05-17 18:09

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('course', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='DiscussionComment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('author_category', models.CharField(choices=[('I', 'Instructor'), ('T', 'Teaching Assistant'), ('S', 'Student')], max_length=1)),
                ('description', models.TextField()),
                ('pinned', models.BooleanField(default=False)),
                ('anonymous_to_student', models.BooleanField(default=False)),
                ('upvote', models.IntegerField(default=0)),
                ('downvote', models.IntegerField(default=0)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('modified_on', models.DateTimeField(auto_now=True)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-id'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='DiscussionForum',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('anonymous_to_instructor', models.BooleanField(default=True)),
                ('send_email_to_all', models.BooleanField(default=False)),
                ('course', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='df_settings', to='course.course')),
            ],
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content_id', models.IntegerField()),
                ('content_type', models.CharField(choices=[('V', 'Video'), ('D', 'Document'), ('Q', 'Quiz'), ('S', 'Section')], max_length=1)),
                ('tag_name', models.TextField()),
                ('discussion_forum', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='discussion_forum.discussionforum')),
            ],
        ),
        migrations.CreateModel(
            name='DiscussionThread',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('author_category', models.CharField(choices=[('I', 'Instructor'), ('T', 'Teaching Assistant'), ('S', 'Student')], max_length=1)),
                ('description', models.TextField()),
                ('pinned', models.BooleanField(default=False)),
                ('anonymous_to_student', models.BooleanField(default=False)),
                ('upvote', models.IntegerField(default=0)),
                ('downvote', models.IntegerField(default=0)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('modified_on', models.DateTimeField(auto_now=True)),
                ('title', models.CharField(max_length=100)),
                ('mark_as_important', models.BooleanField(default=False)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('discussion_forum', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='discussion_forum.discussionforum')),
                ('tag', models.ManyToManyField(blank=True, to='discussion_forum.Tag')),
            ],
            options={
                'ordering': ['-id'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='DiscussionReply',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('author_category', models.CharField(choices=[('I', 'Instructor'), ('T', 'Teaching Assistant'), ('S', 'Student')], max_length=1)),
                ('description', models.TextField()),
                ('pinned', models.BooleanField(default=False)),
                ('anonymous_to_student', models.BooleanField(default=False)),
                ('upvote', models.IntegerField(default=0)),
                ('downvote', models.IntegerField(default=0)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('modified_on', models.DateTimeField(auto_now=True)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('discussion_comment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='discussion_forum.discussioncomment')),
            ],
            options={
                'ordering': ['-id'],
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='discussioncomment',
            name='discussion_thread',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='discussion_forum.discussionthread'),
        ),
        migrations.AddConstraint(
            model_name='tag',
            constraint=models.UniqueConstraint(fields=('content_id', 'content_type'), name='unique_tag'),
        ),
    ]
