# Generated by Django 3.2.6 on 2021-08-05 13:05

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('poll_app', '0003_auto_20210804_2004'),
    ]

    operations = [
        migrations.CreateModel(
            name='Answers',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('answer', models.TextField(null=True, verbose_name='Ответ')),
            ],
        ),
        migrations.RemoveField(
            model_name='polls',
            name='is_active',
        ),
        migrations.RemoveField(
            model_name='questions',
            name='type_answer',
        ),
        migrations.AddField(
            model_name='questions',
            name='answer_type',
            field=models.CharField(choices=[('text_answer', 'Ответ текстом'), ('radio', 'Один вариант'), ('check_boxes', 'Выбор нескольких вариантов')], default=1, max_length=20, verbose_name='Тип вопроса'),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='polls',
            name='finished_at',
            field=models.DateField(verbose_name='Дата окончания опроса'),
        ),
        migrations.AlterField(
            model_name='polls',
            name='started_at',
            field=models.DateField(auto_now_add=True, verbose_name='Дата старта опроса'),
        ),
        migrations.AlterField(
            model_name='polls',
            name='title',
            field=models.CharField(max_length=100, verbose_name='Наименование'),
        ),
        migrations.AlterField(
            model_name='questions',
            name='poll',
            field=models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, related_name='questions', to='poll_app.polls', verbose_name='Опрос'),
        ),
        migrations.DeleteModel(
            name='Polled_users',
        ),
        migrations.AddField(
            model_name='answers',
            name='question',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='answers', to='poll_app.questions', verbose_name='Вопрос'),
        ),
        migrations.AddField(
            model_name='answers',
            name='user',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Пользователь'),
        ),
    ]
