# Generated by Django 3.1.1 on 2020-10-12 00:18

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


class Migration(migrations.Migration):

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

    operations = [
        migrations.CreateModel(
            name='Channel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('url_id', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('name', models.CharField(max_length=20)),
                ('description', models.CharField(blank=True, max_length=100)),
                ('accesspath', models.UUIDField(null=True)),
            ],
        ),
        migrations.CreateModel(
            name='News',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('body', models.CharField(max_length=100)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='QAPair',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('url_id', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('index', models.IntegerField()),
                ('question', models.CharField(max_length=50)),
                ('answer', models.CharField(max_length=20)),
                ('answer_set', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='QASet',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('url_id', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('valid', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='TestPlan',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('url_id', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('que_number', models.IntegerField(null=True)),
                ('release_time', models.DateTimeField(null=True)),
                ('released', models.BooleanField(default=False)),
                ('end_time', models.DateTimeField(null=True)),
                ('ended', models.BooleanField(default=False)),
                ('qaset', models.ForeignKey(db_column='set_id', on_delete=django.db.models.deletion.CASCADE, to='polls.qaset')),
            ],
        ),
        migrations.CreateModel(
            name='Unit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('url_id', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('index', models.IntegerField()),
                ('name', models.CharField(max_length=20)),
                ('opened', models.BooleanField(default=False)),
                ('bkd', models.ForeignKey(db_column='bkd_id', null=True, on_delete=django.db.models.deletion.SET_NULL, to='polls.bkd')),
                ('channel', models.ForeignKey(db_column='ch_id', on_delete=django.db.models.deletion.CASCADE, to='polls.channel')),
            ],
            options={
                'unique_together': {('channel', 'index')},
            },
        ),
        migrations.CreateModel(
            name='UserNews',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('news', models.ForeignKey(db_column='news_id', on_delete=django.db.models.deletion.CASCADE, to='polls.news')),
                ('user', models.ForeignKey(db_column='user_id', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='UnitTest',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('test', models.OneToOneField(db_column='test_id', on_delete=django.db.models.deletion.CASCADE, to='polls.testplan')),
                ('unit', models.OneToOneField(db_column='unit_id', on_delete=django.db.models.deletion.CASCADE, to='polls.unit')),
            ],
        ),
        migrations.CreateModel(
            name='UnitQA',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('qaset', models.OneToOneField(db_column='set_id', on_delete=django.db.models.deletion.CASCADE, to='polls.qaset')),
                ('unit', models.OneToOneField(db_column='unit_id', on_delete=django.db.models.deletion.CASCADE, to='polls.unit')),
            ],
        ),
        migrations.CreateModel(
            name='TestSet',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('url_id', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('received', models.BooleanField(default=False)),
                ('submitted', models.BooleanField(default=False)),
                ('score', models.FloatField(default=0.0)),
                ('test', models.ForeignKey(db_column='test_id', on_delete=django.db.models.deletion.CASCADE, to='polls.testplan')),
                ('user', models.ForeignKey(db_column='user_id', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'unique_together': {('user', 'test')},
            },
        ),
        migrations.CreateModel(
            name='TestPair',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('url_id', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('user_answer', models.CharField(blank=True, max_length=20)),
                ('correct', models.BooleanField(default=False)),
                ('pair_id', models.ForeignKey(db_column='pair_id', on_delete=django.db.models.deletion.CASCADE, to='polls.qapair')),
                ('tset', models.ForeignKey(db_column='tset_id', on_delete=django.db.models.deletion.CASCADE, to='polls.testset')),
            ],
        ),
        migrations.AddField(
            model_name='qapair',
            name='qaset',
            field=models.ForeignKey(db_column='set_id', on_delete=django.db.models.deletion.CASCADE, to='polls.qaset'),
        ),
        migrations.CreateModel(
            name='Host',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('channel', models.ForeignKey(db_column='ch_id', on_delete=django.db.models.deletion.CASCADE, to='polls.channel')),
                ('user', models.ForeignKey(db_column='user_id', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Guest',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('channel', models.ForeignKey(db_column='ch_id', on_delete=django.db.models.deletion.CASCADE, to='polls.channel')),
                ('user', models.ForeignKey(db_column='user_id', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='BKDToQA',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('bkd', models.ForeignKey(db_column='bkd_id', on_delete=django.db.models.deletion.CASCADE, to='polls.bkd')),
                ('qaset', models.OneToOneField(db_column='set_id', on_delete=django.db.models.deletion.CASCADE, to='polls.qaset')),
            ],
        ),
        migrations.CreateModel(
            name='BKDOwner',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('bkd', models.OneToOneField(db_column='bkd_id', on_delete=django.db.models.deletion.CASCADE, to='polls.bkd')),
                ('user', models.ForeignKey(db_column='user_id', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AlterUniqueTogether(
            name='qapair',
            unique_together={('qaset', 'index')},
        ),
    ]
