# -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-07-05 12:33
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='AppealGraderModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('appeal_explanation', models.TextField()),
                ('appeal_reason', models.TextField()),
                ('grade', models.IntegerField(null=True)),
                ('appeal_visible_status', models.BooleanField(default=False)),
                ('appeal_by_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='appeal_by_user', to=settings.AUTH_USER_MODEL)),
                ('appeal_grader', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'appeal_grader_master',
            },
        ),
        migrations.CreateModel(
            name='CourseHomeWorkModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('homework_name', models.TextField()),
                ('grade_deadline', models.DateTimeField()),
                ('homework_deadline', models.DateTimeField()),
                ('no_of_group', models.TextField(null=True)),
                ('no_of_grader', models.TextField(null=True)),
                ('constraints', models.TextField()),
                ('attachment', models.TextField(null=True)),
                ('status', models.BooleanField(default=True)),
            ],
            options={
                'db_table': 'course_homework',
            },
        ),
        migrations.CreateModel(
            name='CourseModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('course_id', models.TextField()),
                ('course_name', models.TextField()),
                ('grading_rubric', models.TextField(null=True)),
                ('appeal_role', models.TextField(null=True)),
                ('status', models.BooleanField(default=True)),
                ('investor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'course',
            },
        ),
        migrations.CreateModel(
            name='GroupCombinationModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('active', models.BooleanField(default=False)),
                ('peerevalutation', models.BooleanField(default=False)),
                ('is_used', models.BooleanField(default=False)),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='investor.CourseModel')),
            ],
            options={
                'db_table': 'group_group_combination',
            },
        ),
        migrations.CreateModel(
            name='HomeworkGroup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('group', models.TextField(unique=True)),
                ('attachment', models.TextField(null=True)),
                ('total_member', models.IntegerField(default=0)),
                ('grade', models.IntegerField()),
                ('appeal_done_count', models.IntegerField(default=0)),
                ('appeal_done_status', models.BooleanField(default=True)),
                ('appeal_reject_status', models.BooleanField(default=False)),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='investor.CourseModel')),
                ('homework', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='investor.CourseHomeWorkModel')),
            ],
            options={
                'db_table': 'homework_group_master',
            },
        ),
        migrations.CreateModel(
            name='HomeworkGroupGrade',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('grade', models.IntegerField(default=0)),
                ('explanation', models.TextField(null=True)),
                ('grader', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='investor.HomeworkGroup', to_field='group')),
            ],
            options={
                'db_table': 'homework_group_grade',
            },
        ),
        migrations.CreateModel(
            name='HomeworkGroupMember',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('has_appealed', models.BooleanField(default=False)),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='investor.HomeworkGroup', to_field='group')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'homework_group_member',
            },
        ),
        migrations.CreateModel(
            name='PeerEvaluationModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('peer_explanation', models.TextField()),
                ('grade', models.IntegerField(null=True)),
                ('appeal_grader', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='appeal_grader', to=settings.AUTH_USER_MODEL)),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='investor.CourseModel')),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='investor.HomeworkGroup', to_field='group')),
                ('homework', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='investor.CourseHomeWorkModel')),
                ('peer_grader', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='peer_grader', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'peer_evaluation',
            },
        ),
        migrations.CreateModel(
            name='StudentCourseEnrolledModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('student', models.TextField()),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='investor.CourseModel')),
            ],
            options={
                'db_table': 'course_student',
            },
        ),
        migrations.AddField(
            model_name='groupcombinationmodel',
            name='grader_group',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='group2', to='investor.HomeworkGroup', to_field='group'),
        ),
        migrations.AddField(
            model_name='groupcombinationmodel',
            name='grader_user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, to_field='username'),
        ),
        migrations.AddField(
            model_name='groupcombinationmodel',
            name='group',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='group1', to='investor.HomeworkGroup', to_field='group'),
        ),
        migrations.AddField(
            model_name='groupcombinationmodel',
            name='homework',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='investor.CourseHomeWorkModel'),
        ),
        migrations.AddField(
            model_name='coursehomeworkmodel',
            name='course',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='investor.CourseModel'),
        ),
        migrations.AddField(
            model_name='appealgradermodel',
            name='course',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='investor.CourseModel'),
        ),
        migrations.AddField(
            model_name='appealgradermodel',
            name='group',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='investor.HomeworkGroup', to_field='group'),
        ),
    ]
