# Generated by Django 2.2.10 on 2021-03-09 13:37

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='BaseAnswer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
            options={
                'verbose_name': 'ответ',
                'verbose_name_plural': 'ответы',
            },
        ),
        migrations.CreateModel(
            name='Poll',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=35, verbose_name='заголовок опроса')),
                ('description', models.CharField(blank=True, max_length=140, null=True, verbose_name='описание')),
                ('start_date', models.DateTimeField(verbose_name='дата/время старта')),
                ('end_date', models.DateTimeField(blank=True, null=True, verbose_name='дата/время старта')),
            ],
            options={
                'verbose_name': 'опрос',
                'verbose_name_plural': 'опросы',
            },
        ),
        migrations.CreateModel(
            name='Respondent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
            options={
                'verbose_name': 'пользователь',
                'verbose_name_plural': 'пользователи',
            },
        ),
        migrations.CreateModel(
            name='TextAnswer',
            fields=[
                ('response', models.TextField(verbose_name='ответ текстом')),
                ('pm_link', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='answer_text', serialize=False, to='api.BaseAnswer')),
            ],
            options={
                'verbose_name': 'текст',
                'verbose_name_plural': 'тексты',
            },
            bases=('api.baseanswer',),
        ),
        migrations.CreateModel(
            name='Question',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=140, verbose_name='вопрос')),
                ('q_type', models.CharField(choices=[('radio', 'один вариант из предложенных'), ('check', 'один или несколько вариантов из предложенных'), ('text', 'произвольный текст')], max_length=5, verbose_name='тип вопроса')),
                ('poll', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='poll', to='api.Poll', verbose_name='опрос')),
            ],
            options={
                'verbose_name': 'вопрос',
                'verbose_name_plural': 'вопросы',
            },
        ),
        migrations.CreateModel(
            name='Option',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=50, verbose_name='вариант ответа')),
                ('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='options', to='api.Question', verbose_name='вопрос')),
            ],
            options={
                'verbose_name': 'вариант ответа',
                'verbose_name_plural': 'варианты ответа',
            },
        ),
        migrations.AddField(
            model_name='baseanswer',
            name='question',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='question', to='api.Question', verbose_name='вопрос'),
        ),
        migrations.AddField(
            model_name='baseanswer',
            name='respondent',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='respondent', to='api.Respondent', verbose_name='пользователь'),
        ),
        migrations.CreateModel(
            name='OptionAnswer',
            fields=[
                ('pm_link', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='answer_option', serialize=False, to='api.BaseAnswer')),
                ('response', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='response', to='api.Option', verbose_name='ответ из вариантов')),
            ],
            options={
                'verbose_name': 'выбранная опция',
                'verbose_name_plural': 'выбранные опции',
            },
            bases=('api.baseanswer',),
        ),
    ]
