# Generated by Django 3.2.6 on 2021-08-04 14:32

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', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Polled_users',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('answer', models.TextField(blank=True, verbose_name='Ответ')),
            ],
        ),
        migrations.CreateModel(
            name='Polls',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=150, verbose_name='Наименование')),
                ('started_at', models.DateTimeField(auto_now_add=True, verbose_name='Дата создания')),
                ('finished_at', models.DateTimeField(verbose_name='Дата закрытия')),
                ('is_active', models.BooleanField(default=True, verbose_name='Активен')),
            ],
        ),
        migrations.CreateModel(
            name='Questions',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type_answer', models.IntegerField(choices=[(1, 'text'), (2, 'one'), (3, 'multiple')], verbose_name='Тип')),
                ('text', models.TextField(blank=True, verbose_name='Текст')),
                ('poll', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='questions', to='poll_app.polls', verbose_name='Опрос')),
            ],
        ),
        migrations.RemoveField(
            model_name='choice',
            name='question',
        ),
        migrations.DeleteModel(
            name='Answer',
        ),
        migrations.DeleteModel(
            name='Choice',
        ),
        migrations.DeleteModel(
            name='Question',
        ),
        migrations.AddField(
            model_name='polled_users',
            name='questions',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='poll_app.questions', verbose_name='Вопрос'),
        ),
        migrations.AddField(
            model_name='polled_users',
            name='user',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
    ]
