# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-07-28 06:47
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

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

    operations = [
        migrations.CreateModel(
            name='AccountTest',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='ФИО тестируемого')),
                ('email', models.EmailField(max_length=254, verbose_name='Email тестируемого')),
                ('information', models.TextField(blank=True, verbose_name='Дополнительная информация по тестируемуму')),
            ],
            options={
                'verbose_name_plural': 'Аккаунты для тестирования',
                'verbose_name': 'Аккаунт для тестирования',
            },
        ),
        migrations.CreateModel(
            name='Test',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_start', models.DateTimeField(auto_now_add=True, verbose_name='Дата начала тестирования')),
                ('date_end', models.DateTimeField(blank=True, null=True, verbose_name='Дата окончания тестирования')),
                ('answers', models.TextField(blank=True, verbose_name='Ответы аккаунта в формате JSON')),
                ('account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='account_test_result', to='quiz.AccountTest', verbose_name='Аккаунт для тестирования')),
            ],
            options={
                'verbose_name_plural': 'Тесты для пользователя',
                'verbose_name': 'Тест для пользователя',
            },
        ),
        migrations.CreateModel(
            name='TestCase',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=255, verbose_name='Название теста')),
                ('is_active', models.BooleanField(default=False, verbose_name='Активен ли тест?')),
                ('time_to_test', models.DurationField(verbose_name='Время на тест')),
            ],
            options={
                'verbose_name_plural': 'Тесты',
                'verbose_name': 'Тест',
            },
        ),
        migrations.AlterField(
            model_name='question',
            name='category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='questions', to='quiz.Category', verbose_name='Категория'),
        ),
        migrations.AddField(
            model_name='testcase',
            name='questions',
            field=models.ManyToManyField(related_name='test_case', to='quiz.Question', verbose_name='Вопросы на тест'),
        ),
        migrations.AddField(
            model_name='test',
            name='test_case',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='testcase_test_result', to='quiz.TestCase', verbose_name='Конкретный тест'),
        ),
        migrations.AddField(
            model_name='accounttest',
            name='tests',
            field=models.ManyToManyField(related_name='account_test', to='quiz.TestCase', verbose_name='Тесты для пользователя'),
        ),
    ]
